diff options
author | Tom Tromey <tromey@adacore.com> | 2023-07-25 10:55:14 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-08-01 13:06:53 -0600 |
commit | 7b4a5561e4bfc251f35c3bdf14f5a780cd3695a8 (patch) | |
tree | 84db1f6ffc82f0edf236c128b1c09c214a19ddae | |
parent | e13769988480865662e8347ed9f131ce0b8f5afc (diff) | |
download | gdb-7b4a5561e4bfc251f35c3bdf14f5a780cd3695a8.zip gdb-7b4a5561e4bfc251f35c3bdf14f5a780cd3695a8.tar.gz gdb-7b4a5561e4bfc251f35c3bdf14f5a780cd3695a8.tar.bz2 |
Don't supply DAP 'path' for non-file shared libraries
The DAP 'module' event may include a 'path' component. I noticed that
this is supplied even when the module in question does not come from a
file.
This patch only emits this field when the objfile corresponds to a
real file.
No test case, because I wasn't sure how to write a portable one.
However, it's clear from gdb.log on Linux:
{"type": "event", "event": "module", "body": {"reason": "new", "module": {"id": "system-supplied DSO at 0x7ffff7fc4000", "name": "system-supplied DSO at 0x7ffff7fc4000"}}, "seq": 21}
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30676
-rw-r--r-- | gdb/python/lib/gdb/dap/modules.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/python/lib/gdb/dap/modules.py b/gdb/python/lib/gdb/dap/modules.py index 6ba613b..1aec1cb 100644 --- a/gdb/python/lib/gdb/dap/modules.py +++ b/gdb/python/lib/gdb/dap/modules.py @@ -36,11 +36,13 @@ def make_module(objf): """Return a Module representing the objfile OBJF. The objfile must pass the 'is_module' test.""" - return { + result = { "id": module_id(objf), "name": objf.username, - "path": objf.filename, } + if objf.is_file: + result["path"] = objf.filename + return result @in_gdb_thread |