Debug with GDB on Windows

Aleksey Gorelov ustrobot at gmail.com
Sat May 18 22:57:23 UTC 2024


I am trying to debug on windows.

A simple hello world app compiled with
```
"c:\D\ldc2-1.38.0-windows-x64\bin\ldc2.exe" -gdwarf -O0 app.d
```

has debug symbols.

But the same app compiled with
```
  dub  build  -b debug 
--compiler="c:\D\ldc2-1.38.0-windows-x64\bin\ldc2.exe"  --force 
--root ../..
```
and dub.json
```
{
	"name" : "testd1",
	"description" : "Hello World - A minimal DUB bundle.",
	"dependencies" : {
	},
	"dflags": ["-gdwarf", "-O0", "-d-debug"]
}
```

has NO debug symbols. gdb reports
```
Reading symbols from ./testd1.exe...
(No debugging symbols found in ./testd1.exe)
```

If add additional option `-vv` to `dflags` the it is visible that 
ldc2 receives the `gdwarf` option. Probably the dub does some 
thing wrong? Or I am wrong. :-(


More information about the Digitalmars-d-debugger mailing list