This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
[patch] Add watchpoint support to save_breakpoints.py (and add supportingmethods to python-breakpoint.c)
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: Project Archer <archer at sourceware dot org>
- Date: Thu, 11 Jun 2009 14:53:35 +0100
- Subject: [patch] Add watchpoint support to save_breakpoints.py (and add supportingmethods to python-breakpoint.c)
Something that has been on my mind for awhile is that
save_breakpoints.py does not handle watchpoints very well. I like
watchpoints, and use them all the time! So I propose this patch:
This patch adds watchpoint support to the save_breakpoints.py command.
I added two new methods to python_breakpoint.c to achieve this goal. As
watchpoints only seemed to be represented as an expression, then the
bppy_get_expression function had to be included to interrogate the
expression behind the gdb breakpoint. To differentiate between the
types of watchpoint (and other breakpoints ...), I added a bppy_get_type
function along with supporting constants. Included are documentation
entries also. I elected not to include catchpoint support as catchpoint
"type" seems to be hidden behind the struct bp_ops function pointers in
the breakpoint struct. If there is another way to differentiate between
the different catchpoints by type, I'd be happy to add them into this
patch, too.
Regards
Phil
ChangeLog
2009-06-11 Phil Muldoon <pmuldoon@redhat.com>
* python/python-breakpoint.c (bppy_get_expression): New Function.
(bppy_get_type): Likewise.
(gdbpy_initialize_breakpoints): Initialize breakpoint constants.
* python/lib/gdb/command/save_breakpoints.py
(SaveBreakpointsCommand.breakpoint_type): New function.
(SaveBreakpointsCommand.invoke): Use breakpoint_type.
doc/ChangeLog
2009-06-11 Phil Muldoon <pmuldoon@redhat.com>
* gdb.texinfo (Breakpoints In Python): Add expression, type
variable text. Add breakpoint constants.
Attachment:
py_watchpoints.patch
Description: Text document