Have "View Code" take compilation directory into account.
commit9e9f307b10499df020eee5037d13be8569cb5851
authorBruno Vasselle <bruno.vasselle@laposte.net>
Tue, 8 Sep 2009 10:05:52 +0000 (8 12:05 +0200)
committerJohannes Sixt <j6t@kdbg.org>
Tue, 8 Sep 2009 20:45:22 +0000 (8 22:45 +0200)
treed8d484caef81f8fab35bb8f27e509751920f29a9
parentebdc4caa6954e8a2f3f981054cf9ff3d141172f5
Have "View Code" take compilation directory into account.

The "View Code" command cannot find the source file in some situations,
although the source is correctly displayed at program stops (breakpoint,
next, ...).

For example, compile kdbg in debug mode,  move the executable somewhere
else, say /var/build/debug/kdbg, then debug it:

  cd /var/build/debug/kdbg; ./kdbg kdbg

The code window shows the main() function. You can add breakpoints from
that window and run step by step. Everything is OK until now. Now add a
breakpoint to SourceWindow::loadFile and click "View Code": nothing
happens.

Inspecting the code, it appears that kdbg uses some heuristics when it
comes to find out the absolute path of a relative file, which fails in
the situation. However, gdb may know where to find the source.
With this change, kdbg asks gdb with "info line".
kdbg/brkpt.cpp
kdbg/debugger.cpp
kdbg/debugger.h
kdbg/gdbdriver.cpp