This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] PR/12691 Add the inferior to Python exited event
- From: Tom Tromey <tromey at redhat dot com>
- To: Kevin Pouget <kevin dot pouget at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 25 Apr 2011 12:19:15 -0600
- Subject: Re: [PATCH] PR/12691 Add the inferior to Python exited event
- References: <BANLkTikm-GqD0fubzfaoRUZCEz=JDy9GWg@mail.gmail.com>
>>>>> "Kevin" == Kevin Pouget <kevin.pouget@gmail.com> writes:
Kevin> Following Tom's advise
Kevin> (http://sourceware.org/ml/gdb/2011-04/msg00116.html), here is a patch
Kevin> which hooks the inferior to the `exited' event object
Kevin> let me know what you think about it
It looks pretty good, but I think it needs a couple small changes.
Kevin> + if (evpy_add_attribute (exited_event,
Kevin> + "inferior",
Kevin> + inferior_to_inferior_object (inf)) < 0)
Kevin> + goto fail;
This does not account for the possibility that
inferior_to_inferior_object could fail. I think there has
to be a temporary object that is explicitly checked against NULL.
Kevin> +gdb_test "continue" ".*event type: continue.*
Kevin> +.*event type: exit.*
Kevin> +.*exit code: 12.*
Kevin> +.*exit inf: 2.*"
Pass a test name to gdb_test.
Tom