aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorHannes Domani <ssbssa@yahoo.de>2021-01-02 13:51:27 +0100
committerHannes Domani <ssbssa@yahoo.de>2021-01-21 18:55:45 +0100
commit325d39e4e09f0b7c8eec7e33ca93d0a9c82632ec (patch)
tree4f977273e946326896d6961751d7eebd26199d00 /gdb/python
parent7cb6d92a3f723f26830ca23b39ec94c2920936c4 (diff)
downloadgdb-325d39e4e09f0b7c8eec7e33ca93d0a9c82632ec.zip
gdb-325d39e4e09f0b7c8eec7e33ca93d0a9c82632ec.tar.gz
gdb-325d39e4e09f0b7c8eec7e33ca93d0a9c82632ec.tar.bz2
Add Python support for hardware breakpoints
This allows the creation of hardware breakpoints in Python with gdb.Breakpoint(type=gdb.BP_HARDWARE_BREAKPOINT) And they are included in the sequence returned by gdb.breakpoints(). gdb/ChangeLog: 2021-01-21 Hannes Domani <ssbssa@yahoo.de> PR python/19151 * python/py-breakpoint.c (bppy_get_location): Handle bp_hardware_breakpoint. (bppy_init): Likewise. (gdbpy_breakpoint_created): Likewise. gdb/doc/ChangeLog: 2021-01-21 Hannes Domani <ssbssa@yahoo.de> PR python/19151 * python.texi (Breakpoints In Python): Document gdb.BP_HARDWARE_BREAKPOINT. gdb/testsuite/ChangeLog: 2021-01-21 Hannes Domani <ssbssa@yahoo.de> PR python/19151 * gdb.python/py-breakpoint.exp: Add tests for hardware breakpoints.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-breakpoint.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 9f6ae96..3fbb1c6 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -58,6 +58,7 @@ static struct pybp_code pybp_codes[] =
{
{ "BP_NONE", bp_none},
{ "BP_BREAKPOINT", bp_breakpoint},
+ { "BP_HARDWARE_BREAKPOINT", bp_hardware_breakpoint},
{ "BP_WATCHPOINT", bp_watchpoint},
{ "BP_HARDWARE_WATCHPOINT", bp_hardware_watchpoint},
{ "BP_READ_WATCHPOINT", bp_read_watchpoint},
@@ -383,7 +384,8 @@ bppy_get_location (PyObject *self, void *closure)
BPPY_REQUIRE_VALID (obj);
- if (obj->bp->type != bp_breakpoint)
+ if (obj->bp->type != bp_breakpoint
+ && obj->bp->type != bp_hardware_breakpoint)
Py_RETURN_NONE;
const char *str = event_location_to_string (obj->bp->location.get ());
@@ -793,6 +795,7 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
switch (type)
{
case bp_breakpoint:
+ case bp_hardware_breakpoint:
{
event_location_up location;
symbol_name_match_type func_name_match_type
@@ -834,7 +837,7 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
create_breakpoint (python_gdbarch,
location.get (), NULL, -1, NULL,
0,
- temporary_bp, bp_breakpoint,
+ temporary_bp, type,
0,
AUTO_BOOLEAN_TRUE,
ops,
@@ -1008,6 +1011,7 @@ gdbpy_breakpoint_created (struct breakpoint *bp)
return;
if (bp->type != bp_breakpoint
+ && bp->type != bp_hardware_breakpoint
&& bp->type != bp_watchpoint
&& bp->type != bp_hardware_watchpoint
&& bp->type != bp_read_watchpoint