editing source files in gdb

Nick Roberts nickrob@snap.net.nz
Sat Dec 16 08:21:00 GMT 2006


 > The problem is that when i give 'edit' from inside gdb to edit the
 > current source file, gdb is opening a new file in the editor under a
 > different name. The funny thing is that the new file has the name of
 > the absolute path of the file with a slash between directory and file
 > missing. For eg: if file 'test.cpp' is in directory '/home/kiran' then
 > gdb is opening the file as /home/kirantest.cpp. Could any one help me
 > in this ?

You don't say what version of GDB this is.  I see what you do for 6.3 but
not GDB in CVS (6.6.50.20061210-cvs).  Perhaps updating to a newer GDB will
solve your problem.

 > This feature (coupled with make from inside gdb) would be useful to me
 > as dont have to exit from gdb for editing the source file if i find a
 > mistake in my code.

As a side note, the mode that I'm writing for Emacs tries to achieve this too.

-- 
Nick                                           http://www.inet.net.nz/~nickrob



More information about the Gdb mailing list