This is the mail archive of the gdb@sourceware.org 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]

[mingw] gdb does not handle rebased executables?


Hi,

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
wrong addresses.

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?

wbr,
Evgeny

P.S. For SVR4, something similar is done in
svr4_solib_create_inferior_hook -> svr4_relocate_main_executable. What
about Windows?


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