GNOME Bugzilla – Bug 514502
add support for "printf-action-on breakpoint"
Last modified: 2020-03-10 11:55:57 UTC
It would be nice to be able to define "print <expr>" style expressions to be executed whenever a given breakpoint is hit. That help in preventing people to go through the long edit/add printf/compile/relaunch cycle of debugging.
Okay, so this task is well underway. It's code is momentarily in a git repository at http://www.gnome.org/~dodji/nemiver.git, in branch "breakpoint-actions". I have added support for BreakpointActions. A BreakpointAction is an action associated to a breakpoint. The BreakpointAction is then said to be registered to the breakpoint. When the breakpoint is hit, its associated BreakpointAction is executed. A particular type of BreakpointAction is a PrintpointAction. The action performed by a PrintpointAction (aka printpoint) is to print an expression provided by the user at PrintpointAction registration time. That expression can be a variable name - in which case the action would be to print the value of that variable - or any expression that can be executed like "1+3", in which case the result would be "4". When the breakpoint associated to the PrintpointAction is hit, the expression associated to the PrintpointAction is executed and the debugger will _continue_ the execution of the target program being debugged. The printed result is logged in a dialog called "printpoing log dialog". A very rough support of all this can be tested already in the branch "breakpoint-actions" of the git repository I linked to earlier. When the user selects a breakpoint from the breakpoints view, it can right click, choose "define a printpoint" and a dialog will appear, asking to enter the expression that will get printed when the breakpoint is it. From the main "debug" menu, the user can display the printpint log dialog to see the logs of printpoint being hit. Each log line contains the file:line:function-name (in the target source code) at which the printpoint action as been executed. Now I still have to add features like: + list all the breakpoint actions associated to a given breakpoint. + edit the breakpoint actions + breakpoints associated to actions should have markers of a different colors from breakpoints not associated with action,maybe.
Closing all open Nemiver tasks as this project does not seem to be maintained anymore. Please see https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/235#note_732192 for further information. Thanks!