[Lldb-commits] [PATCH] D56027: [lldb] Fix ObjCExceptionRecognizedStackFrame to populate the list of recognized arguments

Kuba (Brecka) Mracek via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 21 14:42:03 PST 2018


kubamracek created this revision.
kubamracek added a reviewer: jingham.
kubamracek added a project: LLDB.

Looks like ObjCExceptionRecognizedStackFrame is only vending the recognized exception via GetExceptionObject. It should also present it just as a regular recognized argument, i.e. populate the m_arguments field. Adding test.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D56027

Files:
  packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp


Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
===================================================================
--- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -2630,6 +2630,9 @@
     exception = ValueObjectConstResult::Create(frame_sp.get(), value,
                                                ConstString("exception"));
     exception = exception->GetDynamicValue(eDynamicDontRunTarget);
+      
+    m_arguments = ValueObjectListSP(new ValueObjectList());
+    m_arguments->Append(exception);
   }
 
   ValueObjectSP exception;
Index: packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
===================================================================
--- packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
+++ packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
@@ -34,6 +34,17 @@
                 '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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56027.179361.patch
Type: text/x-patch
Size: 1724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181221/dd5a7ae3/attachment.bin>


More information about the lldb-commits mailing list