public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* How to set a breakpoint on imported Win32 function?
@ 2020-01-15 22:42 Ruslan Kabatsayev
  2020-01-16 14:54 ` Luis Machado
  0 siblings, 1 reply; 8+ messages in thread
From: Ruslan Kabatsayev @ 2020-01-15 22:42 UTC (permalink / raw)
  To: gdb

Hello,

I have a program without any debug info, which has an import table
with some functions imported by name. E.g. kernel32!ExitProcess is
imported, and the debugger should know its name and address.

But whenever I run GDB (from mingw-w64) with my test exe and try to
set breakpoint on ExitProcess, GDB complains that no symbol table is
loaded and asks if I want it set on future library load. After I agree
and let the debuggee run, the debuggee exits without any trap
(although it does exit via this exact function).

OTOH, on Linux I can set a breakpoint on e.g. exit, which gets located
in /lib/i386-linux-gnu/libc.so.6 for which I don't have any debug
symbols, and the breakpoint successfully traps.

So, how can I set a breakpoint on an imported function in Windows? Or
is the handling of PE import table to fill GDB's symbol table not
implemented?

Thanks,
Ruslan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-01-17  8:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 22:42 How to set a breakpoint on imported Win32 function? Ruslan Kabatsayev
2020-01-16 14:54 ` Luis Machado
2020-01-16 17:17   ` Ruslan Kabatsayev
2020-01-16 18:14     ` Luis Machado
2020-01-16 18:28       ` Eli Zaretskii
2020-01-16 20:01         ` Ruslan Kabatsayev
2020-01-17  7:46           ` Eli Zaretskii
2020-01-17  8:41             ` Ruslan Kabatsayev

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).