aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-08-04 09:50:01 -0600
committerTom Tromey <tromey@adacore.com>2023-08-16 09:55:10 -0600
commit100dbc6de52e6d4bfaf4b330ee923267e56e936c (patch)
treebec880d472556d9bc20931102b0fd3f2ce5c0baa /gdb/python
parenta345d14fa65c2b69f2ba3abac8847b1c6a4dc656 (diff)
downloadgdb-100dbc6de52e6d4bfaf4b330ee923267e56e936c.zip
gdb-100dbc6de52e6d4bfaf4b330ee923267e56e936c.tar.gz
gdb-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/python')
-rw-r--r--gdb/python/lib/gdb/dap/events.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/python/lib/gdb/dap/events.py b/gdb/python/lib/gdb/dap/events.py
index aca2512..e9ddcab 100644
--- a/gdb/python/lib/gdb/dap/events.py
+++ b/gdb/python/lib/gdb/dap/events.py
@@ -68,6 +68,18 @@ def _new_objfile(event):
)
+@in_gdb_thread
+def _objfile_removed(event):
+ if is_module(event.objfile):
+ send_event(
+ "module",
+ {
+ "reason": "removed",
+ "module": make_module(event.objfile),
+ },
+ )
+
+
_suppress_cont = False
@@ -150,3 +162,4 @@ gdb.events.new_thread.connect(_new_thread)
gdb.events.thread_exited.connect(_thread_exited)
gdb.events.cont.connect(_cont)
gdb.events.new_objfile.connect(_new_objfile)
+gdb.events.free_objfile.connect(_objfile_removed)