title: Is it possible to debug a gcc-compiled program using lldb, or debug a clang-compiled program using gdb?
body: <p>(Preface: I'm pretty new to C/C++ and I don't really know how debugging in native code actually works.)</p>
  
  <p>Some sources say that gdb and lldb can debug <a href="http://www.lego.com/en-us/mindstorms/products/fan-made-bonus-robots/ev3meg">any program compiled to machine code</a>. Others say that to debug with gdb you <strong>must</strong> compile in gcc <a href="http://tedlab.mit.edu/~dr/gdbintro.html">with the <code>-g</code> flag</a>. The documentation for gcc itself suggests this is optional, and that in fact if you use it, it can cause problems for debuggers <em>other than</em> gdb. Clang also has a <code>-g</code> flag and the documentation basically just says "Generate debug information."</p>
  
  <p>So are these debuggers restricted to their own toolchains (GNU and LLVM), or are they somehow independent of the compiler used?</p>