This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [RFC] Extend gdb.Breakpoint to allow setting a breakpoint at the current execution address
- From: Siva Chandra <sivachandra at google dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb at sourceware dot org
- Date: Sat, 28 Apr 2012 00:43:28 +0530
- Subject: Re: [RFC] Extend gdb.Breakpoint to allow setting a breakpoint at the current execution address
- References: <CAGyQ6gwgaeptA6-C3-WFC6+1t_DW4pVc+pgJbQbAcZo=+SQ=bQ@mail.gmail.com> <878vhh5gk8.fsf@fleche.redhat.com>
Continuing from http://sourceware.org/ml/gdb-patches/2012-04/msg01001.html
I am posting to gdb@ as it is more suitable now.
Siva> I didn't find a way to set a breakpoint at the current execution
Siva> address through the existing Python API.
Tom> I think you can use '*$pc' as the linespec.
Tom> Or you can get the value of the PC (any way you want) and use ('*%d' % pc).
I didn't want to use $pc explicitly as the manual only says "on most
machines" with regard to its meaning. I do not know of any machine
where PC does not mean the program counter though.
What are the other ways to get the value of the PC?
Thanks,
Siva Chandra