Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Kevin Pouget <kevin.pouget@gmail.com>
To: gdb@sourceware.org
Subject: Re: GDB Python API: stop/continue after breakpoint
Date: Thu, 21 Apr 2011 14:32:00 -0000	[thread overview]
Message-ID: <BANLkTim7tBvGbAtJGDK247J2OT2GNGOUJQ@mail.gmail.com> (raw)
In-Reply-To: <BANLkTinwMfsxA24q-5ekbapVdM_OP6rOsQ@mail.gmail.com>

before I start any implementation, would you agree if I change

> int
> emit_stop_event (struct bpstats *bs, enum target_signal stop_signal)
> ...
>  if (bs && bs->breakpoint_at
>      && bs->breakpoint_at->py_bp_object)
>    {
>      stop_event_obj = create_breakpoint_event_object ((PyObject *) bs
>                                                       ->breakpoint_at
>                                                       ->py_bp_object);
>    }

so that it browses the `bs->next' list  and returns a python tuple
instead of a single object ?

>     /* Linked list because there can be more than one breakpoint at
>        the same place, and a bpstat reflects the fact that all have
>        been hit.  */
>     bpstat next;


Cordially,

Kevin

On Thu, Apr 21, 2011 at 9:01 AM, Kevin Pouget <kevin.pouget@gmail.com> wrote:
>> 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.
>
> I'm afraid that's impossible to do it with the current implementation, look:
>
> def handle_double_stop(event):
>        print "Stop event: ", event.breakpoint.number
> gdb.events.stop.connect(handle_double_stop)
>
> (gdb) break main
> Breakpoint 1
> (gdb) break main
> Breakpoint 2
> (gdb) run
> Stop event: 1
>
> ... as far as I know, there is no 'easy' way to know that Bp 2 was hit as well
>


  parent reply	other threads:[~2011-04-21 14:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 16:09 Kevin Pouget
2011-03-11 16:25 ` Phil Muldoon
     [not found]   ` <AANLkTin_a87WgchmZnzi9_XX4DXh8q-r3P7EyyDAzTA4@mail.gmail.com>
2011-03-11 17:52     ` Kevin Pouget
2011-04-20 14:59       ` Kevin Pouget
2011-04-20 15:15         ` Phil Muldoon
2011-04-20 15:39         ` Tom Tromey
2011-04-21 13:01           ` Kevin Pouget
     [not found]             ` <BANLkTinwMfsxA24q-5ekbapVdM_OP6rOsQ@mail.gmail.com>
2011-04-21 14:32               ` Kevin Pouget [this message]
2011-04-20 15:20       ` Tom Tromey
2011-03-21 14:20   ` Kevin Pouget
2011-03-21 14:39     ` Phil Muldoon
2011-03-21 15:11       ` Kevin Pouget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTim7tBvGbAtJGDK247J2OT2GNGOUJQ@mail.gmail.com \
    --to=kevin.pouget@gmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox