The gdb python API defines the gdb.BP_BREAKPOINT flag to use when creating a gdb.Breakpoint object, but there doesn't seem to be a flag that allows a hardware breakpoint to be set? Am I missing something?
I'd like to create a gdb.Breakpoint object so that I can override the stop method and react to breakpoints as they're triggered. As far as I can tell, there isn't a way to do this otherwise.
Interestingly enough, if I set a breakpoint the 'normal' way (eg, break *0x400123), then gdb.breakpoints() returns an object. However, if I set a hardware breakpoint the same way (hbreak *0x400123), no objects are returned. This seems to indicate that the python API can't access/manipulate HW breakpoints directly?
Using GDB 8.3.50.20190824-30.fc31 on Fedora 31.