diff options
author | Tom Tromey <tromey@redhat.com> | 2011-06-03 15:32:44 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-06-03 15:32:44 +0000 |
commit | 8cf64490f293549a0b8e64342d7c97099df19974 (patch) | |
tree | 2aa409936b65cf0a40f19a32c9d2b053132f9bba /gdb/mi | |
parent | 8ddd9a20a759fb2dd5d221914747eaf62c62c994 (diff) | |
download | fsf-binutils-gdb-8cf64490f293549a0b8e64342d7c97099df19974.zip fsf-binutils-gdb-8cf64490f293549a0b8e64342d7c97099df19974.tar.gz fsf-binutils-gdb-8cf64490f293549a0b8e64342d7c97099df19974.tar.bz2 |
gdb
* python/py-inferior.c (python_inferior_exit): Use inferior's exit
code fields.
* python/py-exitedevent.c (create_exited_event_object): Change
type of 'exit_code'. Optionally add exit_code attribute.
(emit_exited_event): Change type of 'exit_code'.
* python/py-event.h (emit_exited_event): Update.
* mi/mi-interp.c (mi_inferior_exit): Print exit code.
* infrun.c (handle_inferior_event): Set exit code fields on
inferior.
* inferior.h (struct inferior) <has_exit_code, exit_code>: New
fields.
* inferior.c (exit_inferior_1): Initialize new fields.
gdb/doc
* gdb.texinfo (GDB/MI Async Records): Document 'exit-code' field.
(Events In Python): Note that exit_code is optional.
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-interp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index c075b0c..7358b73 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -366,8 +366,14 @@ mi_inferior_exit (struct inferior *inf) struct mi_interp *mi = top_level_interpreter_data (); target_terminal_ours (); - fprintf_unfiltered (mi->event_channel, "thread-group-exited,id=\"i%d\"", - inf->num); + if (inf->has_exit_code) + fprintf_unfiltered (mi->event_channel, + "thread-group-exited,id=\"i%d\",exit-code=\"%s\"", + inf->num, int_string (inf->exit_code, 8, 0, 0, 1)); + else + fprintf_unfiltered (mi->event_channel, + "thread-group-exited,id=\"i%d\"", inf->num); + gdb_flush (mi->event_channel); } |