Showing Column Information

If you compile your application with the option -debug extended or -debug emit_column the debugger will be able to show you the column in the current line that corresponds to the current PC.

 

(idb) stop in main

[#1: stop in int main(void)]

(idb) run

[1] stopped at [int main(void):382:14 0x08049438]

    382     static S a;

(idb) next

stopped at [int main(void):384:9 0x0804949f]

    384     int i = 123;

(idb) next

stopped at [int main(void):385:5 0x080494a6]

    385     a.i = 456;

(idb) list $curline-5:10

    380 {

    381

    382     static S a;

    383     S* p;

    384     int i = 123;

>   385     a.i = 456;

    386     p = &a;

    387     p->c = S::plus1;

    388

    389     g ();               // calls a number of overloaded functions

 

Note that the character at the current column of the current line is highlighted (underlined in the example) with your terminal's default highlight mode. Also note that in a breakpoint message, the current line and column numbers are displayed in the format <current line>:<current column>. The same format is used to display line/column information in the stack trace and the machine code listing when the column information is available.

This feature is available in the DBX mode, and in the GDB mode when $gdb_compatible_output is set to 0.