This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Searching for pattern in memory from GDB?
- From: Michael Elizabeth Chastain <mec at shout dot net>
- To: drow at mvista dot com, jnordby at caspiannetworks dot com
- Cc: gdb at sources dot redhat dot com
- Date: Mon, 8 Apr 2002 14:12:38 -0500
- Subject: Re: Searching for pattern in memory from GDB?
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