I just managed to setup lldb and add a rule to format (one of?) Nim's string type:NimStringV2
With this rule, the actual human-readable value of the string is shown in the editor, instead of an object containing a pointer to the actual characters
I did this by adding the following to the .lldbinit file:
type summary add --summary-string "${var.p.data%S}" NimStringV2
Now I wonder whether someone before me has done the Lord's work and made an .lldbinit file available that contain more mapppigs like this for Nim types?
There is this python script that is included https://github.com/nim-lang/Nim/blob/devel/tools/debug/nimlldb.py which iirc sets up pretty printers for most types
Sadly I've never used lldb so don't know how to use it
Thank you!
I'm using Nim 1.6.16 and I see that script is only available since Nim 2. But I'll try to see if it works anyway.
If there is a specific version for Nim 1.6 I haven't found yet, please let me know
Hmm nimlldb.py does not seem to work for me in 1.6.16.
It has a bool IS_NIM_V2. I tried both False and True for it. It would either format a string as an empty string or an array of chars.
I do use the CodeLLDB extension, not sure if you meant that one @jmgomez. I hadn't noticed any effect of a bundled config file. Should I enable it somewhere?
Great, thanks for thinking outside the box and providing a solution to problem rather than my original question.
Perhaps the official extension needs to be promoted more, it seems suspicious, with only 700 downloads. I was using another extension for that reason.
I gave it 5 stars, hope it helps