1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:25:08 +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:
Andreas Kling 2019-07-28 12:15:24 +02:00
parent 52a5e34902
commit cf57d64481
6 changed files with 181 additions and 0 deletions

View file

@ -0,0 +1,32 @@
#pragma once
#include <AK/JsonArray.h>
#include <LibGUI/GModel.h>
class ProcessMemoryMapModel final : public GModel {
public:
enum Column {
Address,
Size,
AmountResident,
Access,
Name,
__Count
};
ProcessMemoryMapModel() {}
virtual ~ProcessMemoryMapModel() override {}
virtual int row_count(const GModelIndex& = GModelIndex()) const override;
virtual int column_count(const GModelIndex& = GModelIndex()) const override { return Column::__Count; }
virtual String column_name(int) const override;
virtual ColumnMetadata column_metadata(int) const override;
virtual GVariant data(const GModelIndex&, Role = Role::Display) const override;
virtual void update() override;
void set_pid(pid_t);
private:
JsonArray m_process_vm;
int m_pid { -1 };
};