Re: [patch] Support inferior events in python

Tom Tromey
2011-02-02T21:35:59Z

>>>>> "Sami" == sami wagiaalla <swagiaal@redhat.com> writes:

Sami> Hmm... We can just create the corresponding Python object, but
Sami> shouldn't this situation be an error condition since
Sami> gdbpy_breakpoint_created is observing breakpoint creation and creating
Sami> the needed python objects ?

No, because gdbpy_breakpoint_created filters out some breakpoints,
notably internal ones.

Sami> Yes that is correct. I created a new event type called ThreadEvent
Sami> to be a parent to all events which can be thread specific. Stop
Sami> events and continue event are now children of thread event.

In this case I think ThreadEvent should be in the docs.

Sami> +PyObject *
Sami> +create_breakpoint_event_object (struct bpstats *bs)
Sami> +{
Sami> + PyObject *breakpoint = gdbpy_breakpoint_from_bpstats (bs);
Sami> + PyObject *breakpoint_event_obj =
Sami> + create_stop_event_object (&breakpoint_event_object_type);
Sami> + if (!breakpoint_event_obj || !breakpoint)
Sami> + goto fail;

This wouldn't work, since if breakpoint==NULL, we never set an error
message.

I think this code should probably have a way to cause emit_stop_event to
fall through to the "unknown" case.

I didn't see py-threadevent.c in the patch.

Tom