Countpoint support



Hello,

So I have been toying with a particular type of breakpoints that I
call countpoints.

Supposes you have a program that crashes in a function foo and you
want to step into foo a little bit to understand why it crashes. But
then suppose foo is called in a loop somewhere N times, and crashes
the N+1Th time.

First, you want to know what N is. Second you want to set a breakpoint
in foo and have it ignore the 300 first occurrences of stopping at that
breakpoint.

Nemiver allows you to set ignore count on breakpoints [so it addresses
the second point], but I wanted to have a way to count the number of
times we hit foo, without me having to set a breakpoint and hit
"continue" each time the breakpoint is hit -- so that I can count the
number of times execution stopped in foo.

Enter countpoints.

A countpoint is just a breakpoint which, once it's hit, instructs the
debugger to continue the execution of the program being debugged. The
user can then just look at the breakpoint views and see how many times
the countpoint was hit.

These days doing mockups is all the rage so here are some:

* http://seketeli.net/~dodji/pics/nemiver/count-points.png
So here, the user is preparing to set a countpoint on the fooprog.cc
program at line 82. That's in a loop. Notice how the user ticks the
"Set as countpoint" checkbox in the otherwise classical breakpoint
setting dialog that we already have today.

* http://seketeli.net/~dodji/pics/nemiver/set-countpoint.png
This is just a bigger picture of how breakpoint setting dialog. Notice
the "Set as countpoint" checkbox that got added.

* http://seketeli.net/~dodji/pics/nemiver/countpoint-final.png
Once you've set your the countpoint, it appears in the source code as
a blue marker, unlike normal breakpoints which appear as a red marker.
Then the user its continue. See at the bottom in the breakpoints view
how the type of breakpoint at line 82 is a "countpoint" (in the 8Th
column of the breakpoint view) and see how the number of Hits (in the
9Th column) is 1000. So the countpoint has been hit 1000 times, and
the debugger has stopped at the next "normal" breakpoint following the
countpoint.

Unlike classical mockups you can compile and execute this one from our
git repository by checking out the "count-point" branch at
http://git.gnome.org/browse/nemiver/log/?h=count-point

The commit that adds that feature is
http://git.gnome.org/browse/nemiver/commit/?h=count-point&id=fb3a23

If it's robust enough I plan to merge it into master unless you guys
feel otherwise, with good reasons.

Thank you for reading so far and have fun trying the mockup :-)

-- 
	Dodji


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]