It looks like gdb has no API way of setting a hardware breakpoint. Which is annoying because implementing the 'stop' method may be the only way to perform some non-blocking actions.
I would also like to request this feature as I need to be able to script hardware breakpoints from Python. Any chance of this being included in the near future?
Hey Phil, We're starting the prep work for the GDB 8.2.x series of releases, and so I'm reviewing all tickets marked with Target Milestone set to 8.2. We use this to track the list of PRs we've identified as required for a given release. Given that this is a new feature, I don't think we want to pressure ourselves into any kind of schedule, so I'll remove the Target Milestone for that one. Cheers!
Patch posted here: https://sourceware.org/pipermail/gdb-patches/2021-January/174634.html
The master branch has been updated by Hannes Domani <ssbssa@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=325d39e4e09f0b7c8eec7e33ca93d0a9c82632ec commit 325d39e4e09f0b7c8eec7e33ca93d0a9c82632ec Author: Hannes Domani <ssbssa@yahoo.de> Date: Sat Jan 2 13:51:27 2021 +0100 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.
Fixed.