Avoid exception from attach in DAP
authorTom Tromey <tromey@adacore.com>
Tue, 12 Dec 2023 17:09:55 +0000 (10:09 -0700)
committerTom Tromey <tromey@adacore.com>
Fri, 22 Dec 2023 16:57:49 +0000 (09:57 -0700)
commit0b32d225818f04390a576b1a68ef1a3060fdeb34
tree1d8485f4e1d20a9c6650048748ab40ef6d3c8c39
parentdfc4bd461b46d62f9eea3adda571da01cb3d6605
Avoid exception from attach in DAP

I noticed that the DAP attach test case (and similarly
remoted-dap.exp) had a rogue exception stack trace in the log.  It
turns out that an attach will generate a stop that does not have a
reason.

This patch fixes the problem in the _on_stop event listener by making
it a bit more careful when examining the event reason.  It also adds
some machinery so that attach stops can be suppressed, which I think
is the right thing to do.

Reviewed-By: Kévin Le Gouguec <legouguec@adacore.com>
gdb/python/lib/gdb/dap/events.py
gdb/python/lib/gdb/dap/launch.py