diff options
author | Tom Tromey <tromey@adacore.com> | 2023-08-04 09:50:01 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-08-16 09:55:10 -0600 |
commit | 100dbc6de52e6d4bfaf4b330ee923267e56e936c (patch) | |
tree | bec880d472556d9bc20931102b0fd3f2ce5c0baa /gdb/testsuite/gdb.dap | |
parent | a345d14fa65c2b69f2ba3abac8847b1c6a4dc656 (diff) | |
download | binutils-100dbc6de52e6d4bfaf4b330ee923267e56e936c.zip binutils-100dbc6de52e6d4bfaf4b330ee923267e56e936c.tar.gz binutils-100dbc6de52e6d4bfaf4b330ee923267e56e936c.tar.bz2 |
Implement DAP module-removed event
DAP specifies an event that should be sent when a module is removed.
This patch implements this.
Tested-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
Diffstat (limited to 'gdb/testsuite/gdb.dap')
-rw-r--r-- | gdb/testsuite/gdb.dap/modules.c | 3 | ||||
-rw-r--r-- | gdb/testsuite/gdb.dap/modules.exp | 15 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.dap/modules.c b/gdb/testsuite/gdb.dap/modules.c index 6ef8a60..7a4b9f0 100644 --- a/gdb/testsuite/gdb.dap/modules.c +++ b/gdb/testsuite/gdb.dap/modules.c @@ -36,5 +36,8 @@ main (void) func = (int (*)(void (*) (void))) dlsym (handle, "call_me"); func (stop); + dlclose (handle); + stop (); + return 0; } diff --git a/gdb/testsuite/gdb.dap/modules.exp b/gdb/testsuite/gdb.dap/modules.exp index e75ae57..949a3cf 100644 --- a/gdb/testsuite/gdb.dap/modules.exp +++ b/gdb/testsuite/gdb.dap/modules.exp @@ -42,7 +42,7 @@ if {[dap_launch $testfile] == ""} { return } -set obj [dap_check_request_and_response "set breakpoint on two functions" \ +set obj [dap_check_request_and_response "set breakpoint on stop function" \ setFunctionBreakpoints \ {o breakpoints [a [o name [s stop]]]}] set fn_bpno [dap_get_breakpoint_number $obj] @@ -53,7 +53,7 @@ dap_wait_for_event_and_check "stopped at function breakpoint" stopped \ "body reason" breakpoint \ "body hitBreakpointIds" $fn_bpno -dap_check_request_and_response "continue to next stop" continue \ +dap_check_request_and_response "continue to second stop" continue \ {o threadId [i 1]} @@ -78,4 +78,15 @@ set frame_id [dict get [lindex [dict get $bt body stackFrames] 1] moduleId] gdb_assert {[string match *$libname* $frame_id]} "module.id in stack trace" + +dap_check_request_and_response "continue to third stop" continue \ + {o threadId [i 1]} + +dap_wait_for_event_and_check "module removed event" module \ + "body reason" removed + +dap_wait_for_event_and_check "third stop at function breakpoint" stopped \ + "body reason" breakpoint \ + "body hitBreakpointIds" $fn_bpno + dap_shutdown |