libsysprof-analyze: give access to memory maps from process

And add it to test tool to ensure it works.
This commit is contained in:
Christian Hergert
2023-05-11 12:32:32 -07:00
parent 9b5e25037b
commit 5abad47160
3 changed files with 37 additions and 0 deletions

View File

@ -47,10 +47,24 @@ main (int argc,
for (guint i = 0; i < n_items; i++)
{
g_autoptr(SysprofDocumentProcess) process = g_list_model_get_item (processes, i);
g_autoptr(GListModel) memory_maps = sysprof_document_process_list_memory_maps (process);
guint n_maps;
g_print ("%d: %s\n",
sysprof_document_frame_get_pid (SYSPROF_DOCUMENT_FRAME (process)),
sysprof_document_process_get_command_line (process));
n_maps = g_list_model_get_n_items (memory_maps);
for (guint j = 0; j < n_maps; j++)
{
g_autoptr(SysprofDocumentMmap) map = g_list_model_get_item (memory_maps, j);
g_print (" [0x%"G_GINT64_MODIFIER"x:0x%"G_GINT64_MODIFIER"x] %s\n",
sysprof_document_mmap_get_start_address (map),
sysprof_document_mmap_get_end_address (map),
sysprof_document_mmap_get_file (map));
}
}
return 0;