[Lldb-commits] [PATCH] D43884: [lldb] Extract more fields from NSException values

Kuba (Brecka) Mracek via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 28 19:52:48 PST 2018


kubamracek added inline comments.


================
Comment at: packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py:1-4
+# encoding: utf-8
+"""
+Test lldb Obj-C exception support.
+"""
----------------
davide wrote:
> This looks like it doesn't need any interactivity whatsoever, so you can probably convert this to a lit test. See the examples in `lit/` (and please let me know if you have any questions.
Will do! I didn't realize we already have the lit infrastructure ready. Quick question: Can I test the SB layer from a lit test?


================
Comment at: source/Plugins/Language/ObjC/NSArray.cpp:221-228
+namespace CallStackArray {
+  struct DataDescriptor_32 {
+    uint32_t _data;
+    uint32_t _used;
+    uint32_t _offset;
+    const uint32_t _size = 0;
+  };
----------------
davide wrote:
> Do you mind to add comments to explain what the structure fields represent (or what this structure is for)?
There's many definitions of array layout throughout this file, so I don't see a comment to be necessary here. Basically, this just defines another layout of an array, see above for other instances.


================
Comment at: source/Plugins/Language/ObjC/NSException.cpp:57-64
+  auto name = process_sp->ReadPointerFromMemory(ptr + 1 * ptr_size, error);
+  if (error.Fail() || name == LLDB_INVALID_ADDRESS) return false;
+  auto reason = process_sp->ReadPointerFromMemory(ptr + 2 * ptr_size, error);
+  if (error.Fail() || reason == LLDB_INVALID_ADDRESS) return false;
+  auto userinfo = process_sp->ReadPointerFromMemory(ptr + 3 * ptr_size, error);
+  if (error.Fail() || reason == LLDB_INVALID_ADDRESS) return false;
+  auto reserved = process_sp->ReadPointerFromMemory(ptr + 4 * ptr_size, error);
----------------
davide wrote:
> The fact we have to calculate this by hand is slightly annoying, but I guess that's a bug to fix another day.
I'll be happy to send follow-up patches. Do you have suggestions how to avoid these manual pointer calculations?


https://reviews.llvm.org/D43884





More information about the lldb-commits mailing list