Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'll preface this by saying that I don't have that much C or C++ experience. Now on to the topic of debugging em:

I'd suggest trying out lldb [0] as an alternative to gdb. In general it has more sensible commands [1] and it can be scripted with python.

If you're willing to pay, CLion [2] is amazing and it includes an interactive debugger [3] which, IMO, completely blows away these CLI tools.

[0] https://lldb.llvm.org/index.html

[1] https://lldb.llvm.org/lldb-gdb.html

[2] https://www.jetbrains.com/clion/

[3] https://www.youtube.com/watch?v=wUZyoAnPdCY



In general it has more sensible commands

I completely disagree (and I don't think GDB's command set is all that great either); the page you linked shows that LLDB's commands are even longer, which is extremely annoying when you're forced to use it for any length of time. Getting a good standard hexdump out of either is a pain too, and LLDB has this ridiculously stupid arbitrary limit of 1024 bytes to display each command (which can be overridden by specifying an additional option each time, but... why!?)

I think "more sensible commands" would be what WinDbg and SoftICE have. Short and unobtrusive.


> the page you linked shows that LLDB's commands are even longer

Where? In almost all cases, LLDB has an alias for the GDB command.


gdb has been scriptable with python since 7.0 https://sourceware.org/gdb/onlinedocs/gdb/Python.html#Python


How is CLion for embedded work these days? If I have, say, an ARM GDB server running, can I use that with CLion's debugger?


Kind of. After connecting to the gdb server, CLion's GDB client usually sends some commands (IIRC start) that will not return a proper response because the server does not support it. Our solution was writing a wrapper to the GDB's machine interface that just ate the problematic commands that are being sent and from then on it works. I don't know if it has been fixed, this is the most recent article i found and it's been a while since I last tried to tackle this problem (previous job).

https://blog.jetbrains.com/clion/2017/12/clion-for-embedded-...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: