diff options
author | Tom Tromey <tromey@adacore.com> | 2023-02-14 09:25:55 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-03-06 08:15:04 -0700 |
commit | 68ca7890ddaeb849c390295ecd914087da463497 (patch) | |
tree | 62ae6d0e11730458202151c31f48dd272534e58a /gdb/python | |
parent | c52e4861c61926a1e22e56837487b819e2dc3cc8 (diff) | |
download | binutils-68ca7890ddaeb849c390295ecd914087da463497.zip binutils-68ca7890ddaeb849c390295ecd914087da463497.tar.gz binutils-68ca7890ddaeb849c390295ecd914087da463497.tar.bz2 |
Fix DAP stackTrace through frames without debuginfo
The DAP stackTrace implementation did not fully account for frames
without debuginfo. Attemping this would yield a result like:
{"request_seq": 5, "type": "response", "command": "stackTrace", "success": false, "message": "'NoneType' object has no attribute 'filename'", "seq": 11}
This patch fixes the problem by adding another check for None.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/lib/gdb/dap/bt.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/python/lib/gdb/dap/bt.py b/gdb/python/lib/gdb/dap/bt.py index 7a17574..c5ede6e 100644 --- a/gdb/python/lib/gdb/dap/bt.py +++ b/gdb/python/lib/gdb/dap/bt.py @@ -69,7 +69,7 @@ def _backtrace(thread_id, levels, startFrame): "instructionPointerReference": hex(current_frame.pc()), } sal = _safe_sal(current_frame) - if sal is not None: + if sal is not None and sal.symtab is not None: newframe["source"] = { "name": os.path.basename(sal.symtab.filename), "path": sal.symtab.filename, |