This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB Python API: stop/continue after breakpoint
- From: Tom Tromey <tromey at redhat dot com>
- To: Kevin Pouget <kevin dot pouget at gmail dot com>
- Cc: pmuldoon at redhat dot com, gdb at sourceware dot org
- Date: Wed, 20 Apr 2011 09:39:30 -0600
- Subject: Re: GDB Python API: stop/continue after breakpoint
- References: <AANLkTim7t_4C8n=PJ8ZgCT=HsU7vdHMXyGWOe6QVCHfE@mail.gmail.com> <m3wrk58w0d.fsf@redhat.com> <AANLkTin_a87WgchmZnzi9_XX4DXh8q-r3P7EyyDAzTA4@mail.gmail.com> <AANLkTimdG3HKmwKCwaZW-Mz27_SFOBYq9=aHezkDYSWs@mail.gmail.com> <BANLkTikdOZEf4_85TA=Aj8+zBmPGX8-sBw@mail.gmail.com>
>>>>> "Kevin" == Kevin Pouget <kevin.pouget@gmail.com> writes:
Kevin> * in MyBreakpoint.stop(), I can say continue/stop the inferior, but I
Kevin> can't run "finish" (or "next" or what ever, I guess), because the
Kevin> inferior is still considered as running:
I think it would be pretty difficult to get this to work.
Kevin> * in event.stop.connect() that's possible, but I can't
Kevin> `gdb.execute("continue")' the execution because I would miss any
Kevin> "non-python" reasons to stop (ie, a user-breakpoint, a signal ...)
I think you should be able to examine the stop event object to see what
caused the event. If the event is a gdb.BreakpointEvent, and if
event.breakpoint is your breakpoint, then do what you want.
Tom