Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an equivalent of GDB for GCC for debugging when compiling with CLANG?

I have found that you can debug with GDB when compiling with GCC however at our university we are required to use CLANG for compiling and I can't find an equivalent of GDB for GCC for CLANG, is there one?

like image 334
joshuatvernon Avatar asked Apr 16 '16 03:04

joshuatvernon


2 Answers

LLDB appears to be the equivalent debugger for CLANG. Here are some links I found on learning LLDB and the equivalent commands for LLDB from GDB.

http://lldb.llvm.org/lldb-gdb.html

http://meowni.ca/posts/unscary-lldb/

How to debug Clang plugin using lldb (or gdb)

like image 174
joshuatvernon Avatar answered Jan 03 '23 18:01

joshuatvernon


You can use GDB or lldb with clang.


for example

$ clang hello.c -g
$ gdb a.out
like image 42
Harry Avatar answered Jan 03 '23 17:01

Harry