Groups | Search | Server Info | Login | Register


Groups > comp.arch.embedded > #32327

Inspecting memory on the field

From pozz <pozzugno@gmail.com>
Newsgroups comp.arch.embedded
Subject Inspecting memory on the field
Date 2025-02-03 00:12 +0100
Organization A noiseless patient Spider
Message-ID <vnou73$tcss$1@dont-email.me> (permalink)

Show all headers | View raw


I instrumented one of my system with a low-level memory read 
functionality. I'm able to read the content of a memory block in a 
running system by remote.

I also have the source code and build files of the firmware running in 
the system.

Now suppose you have a complex static data structure at address X. Its 
size is 1000 bytes. The struct could be defined as:

--- mystruct.c ---
#include "object1.h"
#include "object2.h"

static struct {
   int x;
   int y;
   struct {
     enum { OBJ1, OBJ2 } type;
     union {
       object1 obj1;		// object1 is another struct
       object2 obj2;		// object2 is another struct
     };
   } array[10];
   ...
} mystruct;
---

By using low-level memory read function, I can read the current values 
of all the bytes in mystruct. How to print a nice report of mystruct 
values, such as:

mystruct = {
   x = 10,
   y = 3,
   array = [
     { OBJ1, obj={...}, obj2={...} },
     { OBJ1, obj={...}, obj2={...} },
     { OBJ1, obj={...}, obj2={...} },
     { OBJ1, obj={...}, obj2={...} },
   ]
}

I know I can write a script that works on a specific mystruct, maybe 
calculating the offset address of each field. I'm searching for a tool 
that can calculate the correct offset address and print a nice report as 
before.

Back to comp.arch.embedded | Previous | Next | Find similar


Thread

Inspecting memory on the field pozz <pozzugno@gmail.com> - 2025-02-03 00:12 +0100

csiph-web