diff options
author | Tom Tromey <tromey@adacore.com> | 2023-04-28 09:14:09 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-05-23 14:17:15 -0600 |
commit | ef7a143133f235246052217fa4d43e22a63cb6b3 (patch) | |
tree | ceaa1a5d540f5cd49e8a9e43c5854e73f9ecd289 /gdb/python | |
parent | 125862f0f220f631a184599ea7c9ff7efbea9044 (diff) | |
download | gdb-ef7a143133f235246052217fa4d43e22a63cb6b3.zip gdb-ef7a143133f235246052217fa4d43e22a63cb6b3.tar.gz gdb-ef7a143133f235246052217fa4d43e22a63cb6b3.tar.bz2 |
Handle DAP evaluate request without a frame ID
DAP specifies that if an evaluate request does not have a frameID
parameter, then the expression is evaluated in the global scope.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/lib/gdb/dap/evaluate.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/python/lib/gdb/dap/evaluate.py b/gdb/python/lib/gdb/dap/evaluate.py index 0581647..fffd255 100644 --- a/gdb/python/lib/gdb/dap/evaluate.py +++ b/gdb/python/lib/gdb/dap/evaluate.py @@ -30,10 +30,12 @@ class EvaluateResult(VariableReference): # Helper function to evaluate an expression in a certain frame. @in_gdb_thread def _evaluate(expr, frame_id): + global_context = True if frame_id is not None: frame = frame_for_id(frame_id) frame.select() - val = gdb.parse_and_eval(expr) + global_context = False + val = gdb.parse_and_eval(expr, global_context=global_context) ref = EvaluateResult(val) return ref.to_object() |