public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* [mingw] gdb does not handle rebased executables?
@ 2012-02-07 13:51 Evgeny Eltsin
  0 siblings, 0 replies; only message in thread
From: Evgeny Eltsin @ 2012-02-07 13:51 UTC (permalink / raw)
  To: gdb

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?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-07 13:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-07 13:51 [mingw] gdb does not handle rebased executables? Evgeny Eltsin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).