Qt World Summit: Submit your Presentation

Debugging external application & showing C++ code, not assembly

  • Whenever I debug an external application compiled with gcc's -g or -ggdb flag, using Debug → Start Debugging → Start and Debug External Application… in Qt Creator, it shows the assembly code in a "Dissembler (raise)" pane, not the C++ code. If I click a break-point, a dialog box pops up saying, if e.g. my source file is called "main.cc": «Cannot open "main":0 for reading: No such file or directory.»

    How can I get the GDB debugger in Qt Creator to show the C++ code corresponding to my break-points, not the assembly?

    Is this a matter of a missing "marker file"? If so, how do I explicitly tell GDB where my C++ source file is?

  • It was because I was in instruction-wise operation mode. Unchecking Debug → Operate By Instruction solved my problem.