[Lldb-commits] [PATCH] D92164: Make SBDebugger internal variable getter and setter not use CommandInterpreter's context

Tatyana Krasnukha via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 26 02:56:27 PST 2020


tatyana-krasnukha created this revision.
tatyana-krasnukha added reviewers: jingham, JDevlieghere, labath.
tatyana-krasnukha added a project: LLDB.
Herald added a subscriber: lldb-commits.
tatyana-krasnukha requested review of this revision.

SBDebugger asks CommandInterpreter for execution context, however, the interpreter's context will not be updated until a command will be executed (may never happen when using SB API). It means that the behavior of these functions depends on previous user actions. The context can stay uninitialized, point to a currently selected target, or point to one of the previously selected targets.

This patch makes SBDebugger use execution context built upon the selected target. Notice, that even SBCommandInterpreter::GetProcess doesn't use CommandInterpreter's execution context.
Also, add error logging to GetInternalVariableValue.

Added test reproduces the issue. Without this fix, the last assertion fails because the interpreter's execution context is empty until running "target list", so, the value of the global property was updated instead of the process's local instance.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92164

Files:
  lldb/packages/Python/lldbsuite/test/python_api/debugger/Makefile
  lldb/packages/Python/lldbsuite/test/python_api/debugger/main.cpp
  lldb/source/API/SBDebugger.cpp
  lldb/test/API/python_api/debugger/TestDebuggerAPI.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92164.307792.patch
Type: text/x-patch
Size: 6974 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20201126/6ee6b5b5/attachment-0001.bin>


More information about the lldb-commits mailing list