(Preface: I'm pretty new to C/C++ and I don't really know how debugging in native code actually works.)
Some sources say that gdb and lldb can debug any program compiled to machine code. Others say that to debug with gdb you must compile in gcc with the -g
flag. The documentation for gcc itself suggests this is optional, and that in fact if you use it, it can cause problems for debuggers other than gdb. Clang also has a -g
flag and the documentation basically just says "Generate debug information."
So are these debuggers restricted to their own toolchains (GNU and LLVM), or are they somehow independent of the compiler used?