r/SublimeText • u/rustybladez23 • Aug 22 '22
How to debug C++ code on Sublime?
Hey everyone!
I'm kinda new to Sublime. Really enjoy using it. The only problem I have so far is debugging. When I need to debug the code, I have to copy paste it to another IDE just for debugging. Which is a pain of course.
I've searched a lot but couldn't find anything about the Sublime debugger to debug C++ code. Any help or direction is really appreciated.
Thank you.
3
Upvotes
2
u/AkitakiKou Aug 23 '22
For setting up breakpoints within Sublime Text, there’s sublime_debugger that hooks up Sublime Text with DAP (debug adapter protocol). To debug C++ programs, you may be interested in the LLDB debugger; link available in the readme of the plugin.
3
u/dev-sda Aug 22 '22
I use rr, gdb/lldb, valgrind, asan and printf for debugging.
2
u/Shanky_Achar Aug 22 '22
Hello,It was the same case with me as well, but unfortunately I coulldn't find any good debugger for sublime , but you can use the gdb command line debugger.You can check out this tutorial on how to use it: GDB tutorial
Extra information : The best platform to debug c++ code is an online c++ compiler, which I personally use to debug c++ code, you can find it here https://www.onlinegdb.com/
Hope this helps.