Searching for pattern in memory from GDB?
Michael Elizabeth Chastain
mec@shout.net
Mon Apr 8 12:12:00 GMT 2002
You can build your executable file with symbols, then strip the symbols
and ship it. Then run gdb on the unstripped executable and the core
dump from the stripped executable.
You could do this:
static char signpost [64];
sprintf (signpost, "\nFOO_BUFFER_ADDRESS=0x%p\n", foo_buffer_address);
Then when you get the core dump, you can do:
strings -a core | grep FOO_BUFFER_ADDRESS
If your target operating system(s) support mmap at a fixed address,
then you can mmap to that address. Obviously that is not portable but
if it works, it works. That would make it exceptionally easy to attach
to a running process.
Hope this helps,
Michael C
More information about the Gdb
mailing list