Get memory regions as string

This commit is contained in:
2025-03-18 23:58:56 +02:00
parent bf8c8f9dad
commit 3ecd88fe72
6 changed files with 130 additions and 16 deletions

View File

@@ -1,14 +1,18 @@
#include "memory.h"
#include "logger.h"
#include "files.h"
#include "logger.h"
#include "types.h"
static
str read_memory_maps_self() {
str memory_str = str_null;
str memory_str = str_null;
HiloadResult res = read_file_to_str(&memory_str, "/proc/self/maps");
sc_log_debug("Memory Map (/proc/self/maps):\n%s\n", str_ptr(memory_str));
HiloadResult res = read_stream_to_str(&memory_str, "/proc/self/maps");
if (res == HILOAD_FAIL)
return str_null;
return memory_str;
sc_log_debug("Memory Map\n-- /proc/self/maps:\n%s\n", str_ptr(memory_str));
return memory_str;
}