mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 05:08:56 +00:00
ProcessManager: Add a "Memory map" view to show a process's VM layout.
Fetch all the data from /proc/PID/vm for the selected process and show it in a nice GTableView. :^)
This commit is contained in:
25
Applications/ProcessManager/ProcessMemoryMapWidget.cpp
Normal file
25
Applications/ProcessManager/ProcessMemoryMapWidget.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "ProcessMemoryMapWidget.h"
|
||||
#include "ProcessMemoryMapModel.h"
|
||||
#include <LibGUI/GBoxLayout.h>
|
||||
#include <LibGUI/GTableView.h>
|
||||
|
||||
ProcessMemoryMapWidget::ProcessMemoryMapWidget(GWidget* parent)
|
||||
: GWidget(parent)
|
||||
{
|
||||
set_layout(make<GBoxLayout>(Orientation::Vertical));
|
||||
layout()->set_margins({ 4, 4, 4, 4 });
|
||||
m_table_view = new GTableView(this);
|
||||
m_table_view->set_model(adopt(*new ProcessMemoryMapModel));
|
||||
}
|
||||
|
||||
ProcessMemoryMapWidget::~ProcessMemoryMapWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void ProcessMemoryMapWidget::set_pid(pid_t pid)
|
||||
{
|
||||
if (m_pid == pid)
|
||||
return;
|
||||
m_pid = pid;
|
||||
static_cast<ProcessMemoryMapModel*>(m_table_view->model())->set_pid(pid);
|
||||
}
|
||||
Reference in New Issue
Block a user