How to debug and watch globals in windows debugger?

WebFreak001 d.forum at webfreak.org
Tue Mar 28 09:38:15 UTC 2023


On Tuesday, 28 March 2023 at 01:04:19 UTC, ryuukk_ wrote:
> I've now waste an entire day trying to figure out what's wrong, 
> perhaps trusted D for my projects was a bad idea, i now look 
> like a fool

sorry to hear that, I haven't really been looking to much into 
the debugging problems here yet. My extension mostly just 
integrates the existing tools here (Visual Studio Debugger / GDB 
+ whatever is emitted in the pdb files)

What I was talking about is that it's possible dmd didn't emit 
the globals information in any way that the GDB / Visual Studio 
Debugger understand right now. I'm not a debugger expert myself, 
looking into this is probably something that would take a bit of 
research about the DWARF / PDB formats and checking how DMD / LDC 
emit it. I think you can probably get some great help here from 
Martin Kinkelin. (I think the windows and linux debug info 
emission works differently / are different modules, so there 
might be discrepancies here)

I can help you point towards where to check and who to ask here, 
but I don't think I can help you actually solve this issue right 
now. I haven't really been focusing too much on the debugger, 
especially not on the implementation of debug symbol emissions 
and the debugger itself. I have only been adding a few scripts 
here to get the best out the debugger that we currently have. 
More things require more investment into actually improving the 
project.

I'm quite glad about your contributions you have been doing so 
far and I think the issues you are opening are good to find stuff 
to work on. (the DCD PRs you have open right now are very nice 
and appreciated, but need a bit of work still done to them before 
they can be merged. I have reviewed them, but didn't have time to 
actually make the changes and test them yet - if you want to get 
these changes in faster you can also implement or reply to my 
review comments)

Further people you could ask about here:
- Iain Buclaw (GDC developer), can probably tell you about what 
gcc does here and possibly has insights into the D backend code 
that generates debug info
- Martin Kinkelin (LDC developer), ditto
- Luís Ferreira (ljmf00 on discord) - has been working on LLDB 
for SAoC and implementing a bunch of things - if things are 
missing on the debugger side, he can probably help you with LLDB 
implementations (you probably only need to go this far if we want 
to add support for new custom data structure things that D has - 
most things can already be realized with the debug symbols)


More information about the Digitalmars-d-learn mailing list