How to debug and watch globals in windows debugger?

ryuukk_ ryuukk.dev at gmail.com
Wed Mar 29 21:09:57 UTC 2023


On Wednesday, 29 March 2023 at 15:26:21 UTC, Steven Schveighoffer 
wrote:
> On 3/28/23 6:42 PM, ryuukk_ wrote:
>
>> 
>> Am i the only want who want to improve things, is it a lost 
>> cause?
>
> I'm not one to use a debugger often, but it is very helpful for 
> many people. I lament that the Windows debugging situation out 
> of the box is dreadful. The students I teach D to I don't show 
> the debugger because I'm worried it would confuse them more 
> than help.

I only use windows because i'm making a game and i have to test 
on that platform

> I both don't use Windows and mostly do debugging via writeln, 
> so for something that doesn't affect me much, I tend not to put 
> effort in. I'm hoping someone who is motivated enough will do 
> it.

I am motivated, hopefully someone more knowledgeable can join me 
figure that out

> If I recall correctly, visual studio debugging is better than 
> the other solutions. But I don't know having never got 
> debugging to work. I've heard that mago is supposed to work 
> better, and was written for D, but is Visual Studio dependent: 
> https://github.com/rainers/mago
>
> I wonder if there isn't some way to make this work well for 
> other IDEs? I couldn't get it to work on VSCode.

That's unfortunate that the solution is bound to a proprietary 
editor that requires a license

Effort should be made in the open and be universal, so it's easy 
to port/adapt to other tools/platforms

Coordinated efforts is the way to go, Go/Rust/Zig people are 
demonstrating this very well and it helped their growth


>> Should i move on?
>
> In any case, the debugging experience isn't perfect, but seems 
> like a drastic measure to leave D altogether if you can't debug 
> globals.
>
> -Steve

I exaggerate a little bit i must admit it, but I'm trying to 
raise awareness, when other languages have no problem with 
debugging out of the box on popular IDEs, why should it have 
problems only with D?

Currently, at least on windows, there are 2 problems with 
debugging:


- global variables
- extern(C) variables

I'm willing to find the cause for the 1st one, then i'll attempt 
the 2nd one, so expect more frustrated posts

I should emphasis again that the reason why i'm into this mess is 
due to a bug i'm trying to debug related to loading a shared DLL 
built using DMD on windows, wich apparently is known to be broken 
for YEARS.. great, more people should voice their complains, D is 
not a new language..

So what to expect other than frustration? specially when people 
keep recommending to use "workarounds", well, if the fix is a 
workaround, one shouldn't be surprised to see people getting 
frustrated every so often

Also it's more of an accumulation of problems that makes me very 
annoyed

https://issues.dlang.org/show_bug.cgi?id=20737

This for example shouldn't be a thing in 2023, period


More information about the Digitalmars-d-learn mailing list