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]

Re: [patch] Support inferior events in python


>>>>> "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


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