svaante / dape

Debug Adapter Protocol for Emacs
GNU General Public License v3.0
477 stars 31 forks source link

[FAQ] How to config STL pretty-printing for lldb-vscode #30

Closed zijianyue closed 10 months ago

zijianyue commented 11 months ago

My config:

(setq dape-configs
    '((lldb-vscode modes (c-mode c-ts-mode c++-mode c++-ts-mode rust-mode rust-ts-mode)
                   command "lldb-vscode"
                   compile "make -j10"
                   :type "lldb-vscode" ensure dape-ensure-command
                   :cwd "xxx/build-dbg/xxx/src/"
                   :program "/usr/bin/python3"
                   :args ["EdgeCondTests.py"]
                   :MIMode "lldb" 
                   :setupCommands [
                                   (
                                    :description "Enable pretty-printing for gdb"
                                    :text "-enable-pretty-printing"
                                    :ignoreFailures t
                                    )
                                   ]
                   )))

dape debug output:

[io] Sending: (:arguments (:type "lldb-vscode" :cwd "/home/gezijian/Yuwei/Libra/LibraPackAutoVersion/build-dbg/LibraTask/src/" :program "/usr/bin/python3" :args ["EdgeCondTests.py"] :MIMode "lldb" :setupCommands [(:description "Enable pretty-printing for gdb" :text "-enable-pretty-printing" :ignoreFailures t)]) :type "request" :command "launch" :seq 2) [io] Received: (:command "launch" :request_seq 2 :seq 0 :success t :type "response")

But the std::vector is not displayed as expected, then please tell me how to config it.

image
svaante commented 10 months ago

I am sorry for taking such a long time to respond.

I don't believe that setupCommands is an valid option for codelldb but maybe :preRunCommands https://github.com/search?q=repo%3Avadimcn%2Fcodelldb+setupCommands&type=issues

But after some quick googling "-enable-pretty-printing" is an gdb command and lldb-vscode does not use gdb.

Maybe you will have some luck with cpptools. I will find a base configuration for cpptools in the latest release on master

zijianyue commented 10 months ago

Yes, cpptools with gdb can work when setting "-enable-pretty-printing", but gdb is slower than lldb in my environment, so I'm trying to use lldb instead.

svaante commented 10 months ago

Then you have to figure out if there is any lldb command that does what "--enable-pretty-printing" does for gdb and consult the codelldb manual.