mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 08:25:07 +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:
parent
52a5e34902
commit
cf57d64481
6 changed files with 181 additions and 0 deletions
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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue