Bug 19151 - No Python API for hardware breakpoints
Summary: No Python API for hardware breakpoints
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: python (show other bugs)
Version: 7.10
: P2 normal
Target Milestone: 11.1
Assignee: Phil Muldoon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-19 03:30 UTC by Celelibi
Modified: 2021-01-21 17:59 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Celelibi 2015-10-19 03:30:14 UTC
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.
Comment 1 tanis 2016-10-01 09:47:15 UTC
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?
Comment 2 Joel Brobecker 2018-05-30 22:57:20 UTC
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!
Comment 3 Hannes Domani 2021-01-15 21:34:28 UTC
Patch posted here: https://sourceware.org/pipermail/gdb-patches/2021-January/174634.html
Comment 4 Sourceware Commits 2021-01-21 17:57:20 UTC
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.
Comment 5 Hannes Domani 2021-01-21 17:59:57 UTC
Fixed.