How to set a breakpoint on imported Win32 function?
Ruslan Kabatsayev <[email protected]> Thu, 16 Jan 2020 01:42:02 +0300
| Newsgroups | gmane.comp.gdb.devel,gmane.comp.gdb.general |
|---|---|
| Message-ID | <CAHEcG95zJ5Xy=u8JKseYEMYpybMkpmeNym_g6XYAiUJ4ew+M0g@mail.gmail.com> |
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