Fixed the implementation of "bool Block::Contains (const Block *block) const"
to return the correct result.
Fixed "bool Variable::IsInScope (StackFrame *frame)" to return the correct
result when there are no location lists.
Modified the "frame variable" command such that:
- if no arguments are given (dump all frame variables), then we only show
variables that are currently in scope
- if some arguments are given, we show an error if the variable is out of
scope
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113830 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Symbol/Variable.cpp b/source/Symbol/Variable.cpp
index 3aafa2b..4ab9fa3 100644
--- a/source/Symbol/Variable.cpp
+++ b/source/Symbol/Variable.cpp
@@ -168,15 +168,15 @@
{
// We don't have a location list, we just need to see if the block
// that this variable was defined in is currently
- Block *frame_block = frame->GetFrameBlock();
- if (frame_block)
+ Block *deepest_frame_block = frame->GetSymbolContext(eSymbolContextBlock).block;
+ if (deepest_frame_block)
{
SymbolContext variable_sc;
CalculateSymbolContext (&variable_sc);
- if (frame_block == variable_sc.block)
+ if (variable_sc.block == deepest_frame_block)
return true;
- return frame_block->Contains (variable_sc.block);
+ return variable_sc.block->Contains (deepest_frame_block);
}
}
break;