This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]