I have files a.c
and b.c
which have different types with the same name:
a.c
struct map {
int a;
}map_t;
//map_t * is use in file
b.c
struct map {
int a;
int b;
}map_t;
//map_t * is use in file
What I need ? Here I know heap address that I want to typecast to particular map_t in a.c or b.c file. And then want to see values a or a,b (depend on typecast).
e.g.
Address = 0x1000
I want to see this address in typedef format of map_t define in a.c file.
I tried the following line in GDB but it fails to locate symbol a.c::map_t
.
(GDB) p *(('a.c::map_t'*)0x1000)
No symbol "a.c::map_t" in current context.
How can I typecast address by map_t mention in a.c file ? I'd also like to know how to do same in Python within GDB.
Note: I know which memory address of which type (I mean map_t from a.c or b.c). By raw memory I can work but want to see in proper GDB format.