Debugging improvements - Visual Studio Natvis, GDB, LLDB

mw mingwu at gmail.com
Sat Apr 24 18:59:29 UTC 2021


On Saturday, 24 April 2021 at 17:44:39 UTC, WebFreak001 wrote:
> On Saturday, 24 April 2021 at 17:16:48 UTC, mw wrote:
>> On Saturday, 24 April 2021 at 16:08:07 UTC, WebFreak001 wrote:
>>> those are GDB-MI commands. If you can only run GDB console 
>>> commands you can use
>>>
>>> ```
>>> source /path/to/gdb_dlang.py
>>> enable pretty-printer
>>> ```
>>
>> Thanks, I put these 2 lines into .gdbinit, and it seems loaded.
>>
>>
>> I have a question about print AA: it only print values?
>>
>> ```
>> 11	    int[int] aa = [1:2, 2:4];
>> (gdb) p aa
>> $1 = [2] = {4, 2}
>> (gdb) p aa[1]
>> Invalid binary operation specified.
>> ```
>>
>> I tried both dmd -g and ldc2 -g on Linux, both the same 
>> behavior.
>
> I haven't modified the expression parsing behavior (I don't 
> know if I can even do that), it's only pretty printers


Why they (keys & values) are showing below in VS code?


> Incredible -- below in VS Code (with launch.json and dub.json 
> config as shown on right) I am able to see arrays, strings, and 
> associative arrays keys/values!


The implementations are different? or there are fundamental 
obstacles that cannot be done for GDB console?



More information about the Digitalmars-d-announce mailing list