3

I think how gdb works on Windows under mingw? When compile with mingw C into .exe, it creates PE file, right (so Windows can run it).

But then you want debug the .exe with gdb. This gdb knows to debug PE file? How? Does it read debug info from PE file? Is it Dwarf debug info or something else?

1 Answer 1

3

As you say, in order to run natively on windows mingw obviously produces PE executables.

Run objdump -s your.exe to see the sections embedded in the PE file mingw produces. ( .debug_*). If you build the same executable on, say, Linux and do the same thing you'll see the section names match. Adding in the -s argument to objdump shows the section contents and you'll see the format looks the same, so mingw must be using DWARF.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.