summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2019-01-04 00:25:08 +0000
committerKuba Mracek <mracek@apple.com>2019-01-04 00:25:08 +0000
commitddaf01877fabe04efdd05411382ad2c10a4dc037 (patch)
treee25749029e4c10adf198d81668205a15284b53ee
parentba08e833ed15a255799aabf9ca3ad1fd5cd0d16f (diff)
[lldb] Fix ObjCExceptionRecognizedStackFrame to populate the list of recognized arguments
Differential Revision: https://reviews.llvm.org/D56027
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py11
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp3
2 files changed, 14 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py b/lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
index b5511549fd5..92b32504cf2 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
@@ -34,6 +34,17 @@ class ObjCExceptionsTestCase(TestBase):
'name: "ThrownException" - reason: "SomeReason"',
])
+ target = self.dbg.GetSelectedTarget()
+ thread = target.GetProcess().GetSelectedThread()
+ frame = thread.GetSelectedFrame()
+
+ opts = lldb.SBVariablesOptions()
+ opts.SetIncludeRecognizedArguments(True)
+ variables = frame.GetVariables(opts)
+
+ self.assertEqual(variables.GetSize(), 1)
+ self.assertEqual(variables.GetValueAtIndex(0).name, "exception")
+
lldbutil.run_to_source_breakpoint(self, "// Set break point at this line.", lldb.SBFileSpec("main.mm"), launch_info=launch_info)
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index d3228d69eac..b6ed2fe376d 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -2630,6 +2630,9 @@ class ObjCExceptionRecognizedStackFrame : public RecognizedStackFrame {
exception = ValueObjectConstResult::Create(frame_sp.get(), value,
ConstString("exception"));
exception = exception->GetDynamicValue(eDynamicDontRunTarget);
+
+ m_arguments = ValueObjectListSP(new ValueObjectList());
+ m_arguments->Append(exception);
}
ValueObjectSP exception;