문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top