This is the mail archive of the
mailing list for the GDB project.
[mingw] gdb does not handle rebased executables?
- From: Evgeny Eltsin <eaeltsin at google dot com>
- To: gdb <gdb at sourceware dot org>
- Date: Tue, 7 Feb 2012 17:50:48 +0400
- Subject: [mingw] gdb does not handle rebased executables?
It seems like gdb does not take into account that executable can be
rebased, so that process image base differs from what is given in the
PE file. When attaching to such a process, all its symbols in gdb have
We've made a dumb fix for that, by saving the image base at
CREATE_PROCESS_DEBUG_EVENT processing, and using it later right inside
attach_command_post_wait to relocate the executable.
However, injecting Windows-specific code in attach_command_post_wait
is ugly. Can you give me a hint which hook I can use to relocate the
executable after attach_command_post_wait figures it out? Probably
some observer event?
P.S. For SVR4, something similar is done in
svr4_solib_create_inferior_hook -> svr4_relocate_main_executable. What