March 28, 2023
On 28/03/2023 2:06 PM, Richard (Rikki) Andrew Cattermole wrote:
> Have you tried installing mago?
> 
> https://github.com/rainers/mago
> 
> There are instructions for vs-code in README.

Binaries are available in the installer of VisualD, they can be extracted by 7zip (I've checked everything is in there).
March 28, 2023
On Tuesday, 28 March 2023 at 01:06:50 UTC, Richard (Rikki) Andrew Cattermole wrote:
> Have you tried installing mago?
>
> https://github.com/rainers/mago
>
> There are instructions for vs-code in README.

I did not try mago, but it shouldn't be needed as pdb is universally understood by tools

It also doesn't work with remedybg for example:

https://i.imgur.com/P1Ph3Jh.png

While i will try with mago, it shouldn't satisfy us, workarounds are temporary solutions

This issue being fixed should be the goal, i opened a ticket for it: https://issues.dlang.org/show_bug.cgi?id=23811
March 28, 2023
On Tuesday, 28 March 2023 at 01:21:02 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 28/03/2023 2:06 PM, Richard (Rikki) Andrew Cattermole wrote:
>> Have you tried installing mago?
>> 
>> https://github.com/rainers/mago
>> 
>> There are instructions for vs-code in README.
>
> Binaries are available in the installer of VisualD, they can be extracted by 7zip (I've checked everything is in there).

what is: "Manual Installation of the Concord extension in VS Code", i can't find it anywhere

what are: "MagoNatCC.dll, MagoNatCC.vsdconfig and .vsdbg-config.json"? i can only find: "MagoNatDE.dll"

So far no bueno
March 28, 2023
On 28/03/2023 2:33 PM, ryuukk_ wrote:
> what is: "Manual Installation of the Concord extension in VS Code", i can't find it anywhere

Extension is mago, but don't forget: cpptools-1.4.0 or later needed.

> what are: "MagoNatCC.dll, MagoNatCC.vsdconfig and .vsdbg-config.json"? i can only find: "MagoNatDE.dll"

Look in $1..\Packages\Debugger

https://github.com/rainers/mago/blob/0b2ce787114a71b4088ebf14eb922c5b3c46f5be/EED/MagoNatCC/.vsdbg-config.json#L4
March 28, 2023
On 28/03/2023 2:25 PM, ryuukk_ wrote:
> On Tuesday, 28 March 2023 at 01:06:50 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> Have you tried installing mago?
>>
>> https://github.com/rainers/mago
>>
>> There are instructions for vs-code in README.
> 
> I did not try mago, but it shouldn't be needed as pdb is universally understood by tools

Agreed, I would expect globals (including TLS) to work without a debugger extension.

> While i will try with mago, it shouldn't satisfy us, workarounds are temporary solutions

Its not a workaround, mago (in this case) is an extension to MS's debugger framework which provides D specific features, you'd want it regardless if you work with the debugger with D a lot. Debuggers typically have language specific features to make them easier to work with.

Jan should be shipping this I think.
March 28, 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)
March 28, 2023

On Tuesday, 28 March 2023 at 04:22:24 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

On 28/03/2023 2:25 PM, ryuukk_ wrote:

>

On Tuesday, 28 March 2023 at 01:06:50 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

Have you tried installing mago?

https://github.com/rainers/mago

There are instructions for vs-code in README.

I did not try mago, but it shouldn't be needed as pdb is universally understood by tools

Agreed, I would expect globals (including TLS) to work without a debugger extension.

>

While i will try with mago, it shouldn't satisfy us, workarounds are temporary solutions

Its not a workaround, mago (in this case) is an extension to MS's debugger framework which provides D specific features, you'd want it regardless if you work with the debugger with D a lot. Debuggers typically have language specific features to make them easier to work with.

Jan should be shipping this I think.

I have looked into trying to get mago to work so far, but didn't have any working state yet, which is why that is currently stuck. (+ I don't personally use Windows for development, so I don't have much usage experience for code-d / debugging integration, outside when I actively develop Windows fixes on it)

If you get mago to work with vscode feel free to tell me how you did it so we can add a debug configuration preset for code-d users / other users who want to manually use it.

March 28, 2023
On Tuesday, 28 March 2023 at 04:22:24 UTC, Richard (Rikki) Andrew Cattermole wrote:
> On 28/03/2023 2:25 PM, ryuukk_ wrote:
>> On Tuesday, 28 March 2023 at 01:06:50 UTC, Richard (Rikki) Andrew Cattermole wrote:
>>> Have you tried installing mago?
>>>
>>> https://github.com/rainers/mago
>>>
>>> There are instructions for vs-code in README.
>> 
>> I did not try mago, but it shouldn't be needed as pdb is universally understood by tools
>
> Agreed, I would expect globals (including TLS) to work without a debugger extension.
>
>> While i will try with mago, it shouldn't satisfy us, workarounds are temporary solutions
>
> Its not a workaround, mago (in this case) is an extension to MS's debugger framework which provides D specific features, you'd want it regardless if you work with the debugger with D a lot. Debuggers typically have language specific features to make them easier to work with.
>
> Jan should be shipping this I think.

It is a workaround, it should work already out of the box with existing tools

It works for other languages, why not for D? problem

Check here:

https://godbolt.org/z/nYGfMTqYY


int global; on C++ has !dbg

int global; on D doesn't have !dbg

This is a bug in D, therefore it should be fixed
March 28, 2023
On Tuesday, 28 March 2023 at 11:07:02 UTC, ryuukk_ wrote:
> On Tuesday, 28 March 2023 at 04:22:24 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> On 28/03/2023 2:25 PM, ryuukk_ wrote:
>>> On Tuesday, 28 March 2023 at 01:06:50 UTC, Richard (Rikki) Andrew Cattermole wrote:
>>>> Have you tried installing mago?
>>>>
>>>> https://github.com/rainers/mago
>>>>
>>>> There are instructions for vs-code in README.
>>> 
>>> I did not try mago, but it shouldn't be needed as pdb is universally understood by tools
>>
>> Agreed, I would expect globals (including TLS) to work without a debugger extension.
>>
>>> While i will try with mago, it shouldn't satisfy us, workarounds are temporary solutions
>>
>> Its not a workaround, mago (in this case) is an extension to MS's debugger framework which provides D specific features, you'd want it regardless if you work with the debugger with D a lot. Debuggers typically have language specific features to make them easier to work with.
>>
>> Jan should be shipping this I think.
>
> It is a workaround, it should work already out of the box with existing tools
>
> It works for other languages, why not for D? problem
>
> Check here:
>
> https://godbolt.org/z/nYGfMTqYY
>
>
> int global; on C++ has !dbg
>
> int global; on D doesn't have !dbg
>
> This is a bug in D, therefore it should be fixed

Nevermind the godbolt link

March 28, 2023
I opened an issue on microsoft's github, let's see what they have to say: https://github.com/microsoft/vscode-cpptools/issues/10751