On Saturday, 26 December 2020 at 11:55:58 UTC, Виталий Фадеев wrote:


Problem is:
    $ gdb ./app.exe
    GNU gdb (GDB) 9.2
    ...
    (No debugging symbols found in ./app.exe)

What is a right way to build .exe and debug with gdb ?

The version of gdb that ships with MSYS is probably going to expect debug info in a different format than what dmd puts out on Windows (I assume it expects DWARF2).

When using -m32(always the default on Windows when invoking dmd directly), it outputs debug info in an old version of the CodeView format (which you'll probably need an older version of WinDbg to work with). Otherwise (-m64, -m32mscoff), it creates a PDB file usable with the Visual Studio debugger and other debuggers that understand the PDB format (which is basically a wrapper for modern CodeView debug info). If there's a Windows version of gdb that supports CodeView/PDB, I'm unaware of it.

I know some people use Mago:
https://github.com/rainers/mago

Some docs on PDB & CodeView:
https://llvm.org/docs/PDB/index.html

DMD and debug info on Windows:
https://dlang.org/windbg.html


Reply via email to