This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Support inferior events in python
- From: Tom Tromey <tromey at redhat dot com>
- To: sami wagiaalla <swagiaal at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 02 Feb 2011 14:35:47 -0700
- Subject: Re: [patch] Support inferior events in python
- References: <4D2342A2.7060102@redhat.com> <m3d3oczb0t.fsf@fleche.redhat.com> <4D34AF3F.4090006@redhat.com> <m37he0g95v.fsf@fleche.redhat.com> <4D39FFFD.80304@redhat.com> <m3zkqldnlw.fsf@fleche.redhat.com> <4D49C69A.20401@redhat.com>
>>>>> "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