Re: [PATCH] PR/12691 Add the inferior to Python exited event

Tom Tromey
2011-04-25T18:19:37Z

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