binutils-gdb/gdb/testsuite/gdb.mi
Pedro Alves a78ef87574 Always emit =thread-exited notifications, even if silent
[Note: the testcased added by this commit depends on
https://sourceware.org/pipermail/gdb-patches/2022-June/190259.html,
otherwise GDB just crashes when detaching the core]

Currently, in MI, =thread-created are always emitted, like:

 =thread-group-started,id="i1",pid="195680"
 =thread-created,id="1",group-id="i1"
 ...

but on teardown, if the target uses exit_inferior_silent, then you'll
only see the inferior exit notification (thread-group-exited), no
notification for threads.

The core target is one of the few targets that use
exit_inferior_silent.  Here's an example session:

 -target-select core $corefile
 =thread-group-started,id="i1",pid="195680"
 =thread-created,id="1",group-id="i1"
 ...
 ^connected,frame=....
 (gdb)
 -target-detach
 =thread-group-exited,id="i1"
 ^done
 (gdb)

This imbalance of emitting =thread-created but then not =thread-exited
seems off to me.  (And, it complicates changes I want to do to
centralize emitting thread exit notifications for the CLI, which is
why I'm looking at this.)

And then, since most other targets use exit_inferior instead of
exit_inferior_silent, MI is already emitting =thread-exited
notifications when tearing down an inferior, for most targets.

This commit makes MI always emit the =thread-exited notifications,
even for exit_inferior_silent.

Afterwards, when debugging a core, MI outputs:

 (gdb)
 -target-detach
 =thread-exited,id="1",group-id="i1"    << new line
 =thread-group-exited,id="i1"
 ^done
 (gdb)

Surprisingly, there's no MI testcase debugging a core file.  This
commit adds the first.

Change-Id: I5100501a46f07b6bbad3e04d120c2562a51c93a4
2022-07-11 19:43:37 +01:00
..
array.f90
basics.c
ChangeLog-1999-2003
dw2-ref-missing-frame-func.c
dw2-ref-missing-frame-main.c
dw2-ref-missing-frame.exp
dw2-ref-missing-frame.S
gdb669.exp
gdb680.exp
gdb701.c
gdb701.exp
gdb792.cc
gdb792.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
gdb2549.exp
interrupt-thread-group.c
interrupt-thread-group.exp
list-thread-groups-available.c
list-thread-groups-available.exp
list-thread-groups-no-inferior.exp
mi2-amd64-entry-value.c
mi2-amd64-entry-value.exp
mi2-amd64-entry-value.s
mi2-cli-display.c
mi2-cli-display.exp
mi2-prompt.exp
mi2-var-child.exp
mi-add-inferior.exp
mi-async-run.c
mi-async-run.exp
mi-async.exp
mi-basics.exp
mi-break-qualified.cc
mi-break-qualified.exp
mi-break.exp
mi-breakpoint-changed.exp
mi-breakpoint-multiple-locations.cc
mi-breakpoint-multiple-locations.exp
mi-catch-cpp-exceptions.cc
mi-catch-cpp-exceptions.exp
mi-catch-load-so.c
mi-catch-load.c
mi-catch-load.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
mi-cli.exp
mi-cmd-error.exp
mi-cmd-param-changed.exp
mi-cmd-user-context.c
mi-cmd-user-context.exp
mi-complete.cc
mi-complete.exp
mi-condbreak-call-thr-state-mt.c
mi-condbreak-call-thr-state-st.c
mi-condbreak-call-thr-state.c
mi-condbreak-call-thr-state.exp
mi-console.c
mi-console.exp
mi-corefile.c Always emit =thread-exited notifications, even if silent 2022-07-11 19:43:37 +01:00
mi-corefile.exp Always emit =thread-exited notifications, even if silent 2022-07-11 19:43:37 +01:00
mi-detach.exp
mi-disassemble.exp
mi-dprintf-pending.c
mi-dprintf-pending.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
mi-dprintf-pendshr.c
mi-dprintf.c
mi-dprintf.exp
mi-editing.exp
mi-eval.exp
mi-exec-run.exp
mi-exit-code.c
mi-exit-code.exp
mi-file-transfer.exp
mi-file.exp
mi-fill-memory.exp
mi-fortran-modules-2.f90
mi-fortran-modules.exp
mi-fortran-modules.f90
mi-frame-regs.exp
mi-fullname-deleted.exp
mi-hack-cli.exp
mi-i-cmd.exp
mi-info-os.exp
mi-info-sources-base.c
mi-info-sources.c
mi-info-sources.exp
mi-inheritance-syntax-error.cc
mi-inheritance-syntax-error.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
mi-language.exp
mi-linespec-err-cp.cc
mi-linespec-err-cp.exp
mi-logging.exp
mi-memory-changed.exp
mi-multi-commands.exp
mi-nonstop-exit.exp
mi-nonstop.exp
mi-ns-stale-regcache.exp
mi-nsintrall.exp
mi-nsmoribund.exp
mi-nsthrexec.exp
mi-pending.c
mi-pending.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
mi-pendshr2.c
mi-pendshr.c
mi-pthreads.exp
mi-read-memory.c
mi-read-memory.exp
mi-record-changed.exp
mi-reg-undefined.c
mi-reg-undefined.exp
mi-reg-undefined.S
mi-regs.exp
mi-return.exp
mi-reverse.exp
mi-simplerun.exp
mi-solib.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
mi-stack.c
mi-stack.exp
mi-start.c
mi-start.exp
mi-stepi.exp
mi-stepn.c
mi-stepn.exp
mi-sym-info-1.c
mi-sym-info-2.c
mi-sym-info.exp
mi-syn-frame.c
mi-syn-frame.exp
mi-threads-interrupt.c
mi-threads-interrupt.exp
mi-undefined-cmd.exp
mi-until.exp
mi-var-block.exp
mi-var-child-f.exp
mi-var-child.c
mi-var-child.exp
mi-var-cmd.exp
mi-var-cp.cc
mi-var-cp.exp gdb/testsuite: remove unneeded calls to get_compiler_info 2022-06-24 15:07:29 +01:00
mi-var-create-rtti.c
mi-var-create-rtti.exp
mi-var-display.exp
mi-var-invalidate.exp
mi-var-list-children-invalid-grandchild.c
mi-var-list-children-invalid-grandchild.exp
mi-var-rtti.cc
mi-var-rtti.exp
mi-vla-c99.exp
mi-vla-fortran.exp
mi-watch-nonstop.exp
mi-watch.exp
new-ui-mi-sync.c
new-ui-mi-sync.exp
non-stop-exit.c
non-stop.c
ns-stale-regcache.c
nsintrall.c
nsmoribund.c
nsthrexec.c
pending.c
pendshr1.c
pendshr2.c
pr11022.c
pr11022.exp
pthreads.c
solib-lib.c
solib-main.c
testcmds
until.c
user-selected-context-sync.c
user-selected-context-sync.exp
var-cmd.c
vla.c
vla.f90
watch-nonstop.c