[plt-scheme] MzTake - relative line numbers
On Tue, 2004-08-10 at 13:10, david.laffin at lineone.net wrote:
> I have just spent an hour or so playing with MzTake; it's seriously
> cool. However even in that short period of time, I found the fact
> that the absolute line and column locations of trace points have to
> be changed after even minor edits to the target text to be somewhat
> irritating.
>
> There must be a better way?
Moses DeJong[1] wrote a scriptable Tcl frontend[2] to GDB using
the GDB/MI interface[3].
He had this to say on the subject of fragile absolute breakpoints[1]:
| Currently, breakpoints are set at a line number in a file, and the
| line numbers need to be updated when the source file changes. It
| is obvious that having to update line numbers in every regression
| test after a change to the source code would be tedious and
| error-prone. A simple solution to this problem is to create a new
| type of breakpoint that contains a function name and an offset in
| lines from the start of the function. In this way, a breakpoint
| specification like {my_func + 5} could be given, the line number
| of my_func could be queried, and the breakpoint could be set at
| the returned line plus five. This would insulate breakpoints from
| changes in the source file that shift a function up or down some
| number of lines.
In and of itself, this is not a complete solution, but probably a
useful thing to add to MzTake. This seems to be a hard problem
with no apparent solution.
(Mo's paper was mentioned by David N. Welton[4].)
Vadim
References
1. Scripted Debugging : Using Tcl and GDB to debug C code
http://www.tcl.tk/community/tcl2004/Tcl2003papers/dejong.pdf
2. http://www.uncounted.org/tcl/gdbmi-0.1.tgz
3. GDB/MI Command Description Format
http://sources.redhat.com/gdb/current/onlinedocs/gdb_25.html
4. http://lambda-the-ultimate.org/node/view/179