There was a crash that would happen if an IDE would ask for a child of a shared pointer via any SB API call that ends up calling StackFrame::GetValueForVariableExpressionPath(). The previous code expects an error to be set describing why the synthetic child of a type was not able to be found, but we have some synthetic child providers that weren't setting the error and returning an empty value object shared pointer. This fixes that to ensure we don't lose our debug session by crashing, fully tests GetValueForVariableExpressionPath functionality, and ensures we don't crash on GetValueForVariableExpressionPath() in the future.
Details
Diff Detail
- Repository
- rLLDB LLDB
Event Timeline
packages/Python/lldbsuite/test/functionalities/var_path/TestVarPath.py | ||
---|---|---|
70 | If I'm not mistaken, you might be able to replace the first 40 lines or so of this test with |
packages/Python/lldbsuite/test/functionalities/var_path/TestVarPath.py | ||
---|---|---|
102 | until here. run_to_source_breakpoint should always return a valid frame or fail. |
source/Target/StackFrame.cpp | ||
---|---|---|
644–650 | Not your code, but incidentally this looks wrong. formatv uses python style format strings where you don't specify the type code but instead specify something like {0}. So either the function is incorrectly named or the call is incorrect. | |
655–656 | I think you can' just write this as SetErrorString, since there is no format happening. |
If I'm not mistaken, you might be able to replace the first 40 lines or so of this test with
lldbutil.run_to_source_breakpoint(self, "// Set a break point here", lldb.SBFileSpec("main.cpp"))