tags:

views:

220

answers:

3

Hi All,

I am currently working with NS-2(A network Simulator) and I wanted to use the tui option of gdb such that i can view the course code while debugging. (Just like Visual studio)

As of now the source window is blank when i run "gdb -tui" . However I can see the file when i do a "list" in gdb, but I am not able to make it go automatically to the file and point to the break location.

Any Ideas how to do this?

A: 

Did you try the Ctrl-X A combination? It tells gdb to enter/leave the TUI mode.

Gautam Borad
A: 

While I'm not sure about the GDB TUI, if you're familiar with vi then be sure to check out CGDB. It is a TUI front-end to GDB using vi-like key bindings.

To set a break point in CGDB, just hit escape (of course), navigate to the line you want to break on, then hit the space bar!

Peter Kovacs
A: 

You can always double check so that the elf-file contains correct data.

Let's say you break your program at some place, and there you will get some reading on the pc (program counter). That value can be cross checked with addr2line (in binutils) so you do have a correct source file.

Johan