This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] Extend gdb.Breakpoint to allow setting a breakpoint at the current execution address


Hi all,

I didn't find a way to set a breakpoint at the current execution
address through the existing Python API.  The attached patch 'extends'
gdb.Breakpoint to allow this.  Probably 'extend' is not the right
word, but what this patch does is to allow the SPEC argument of the
gdb.Breakpoint constructor to be 'None' or "" or white space space
string.  When SPEC takes one of these values, a breakpoint is set at
the current execution address.  Though this is not valid for a
watchpoint, the existing error mechanism will handle this correctly.

2012-04-27  Siva Chandra Reddy  <sivachandra@google.com>

        * breakpoint.c (parse_breakpoint_sals, watch_command_1): Treat
        argument with all white space to be equivalent to NULL argument.
        * python/py-breakpoint.c (bppy_init): Make the 'spec' argument
        optional and allow it to take the value 'None'.

doc/
2012-04-27  Siva Chandra Reddy  <sivachandra@google.com>

        * gdb.texinfo (Breakpoints In Python): Document that 'spec'
        argument, of the constructor of gdb.Breakpoint when setting
        breakpoints, is optional and can also be all white space or None
        when used.

testsuite/
2012-04-27  Siva Chandra Reddy  <sivachandra@google.com>

        * gdb.python/py-breakpoint.exp: Test setting breakpoints at the
        current execution address using different values for the 'spec'
        argument of the constructor of gdb.Breakpoint.

Thanks,
Siva Chandra

Attachment: bp_patch_v1.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]