Reputation: 4147
GDB, at least as it's configured by default on my Ubuntu 9.04 box, doesn't handle multi-line statements well. When I'm stepping through code, GDB only displays the last line of the current statement, even if that statement spans multiple lines.
I'm aware that I could use DDD or emacs as a frontend for GDB, but I'd prefer to solve this problem within GDB, if that's possible.
Does anyone know if there's a way to get GDB to do the right thing here?
Upvotes: 6
Views: 2460
Reputation: 55271
How about running GDB with the text user interface?
gdb -tui
It makes a world of difference to the ease of use of GDB.
Upvotes: 8
Reputation: 5719
I'm afraid the answer is "no, there is no way to get gdb to do what you want". The line info in the symbol tables associates each code instruction with a single source line (not a source statement). gdb has no way of knowing that several source lines are associated with the same source statement.
Upvotes: 4