Add support for fetching signed values from tagged pointers.
authorJim Ingham <jingham@apple.com>
Wed, 31 Mar 2021 23:59:52 +0000 (16:59 -0700)
committerJim Ingham <jingham@apple.com>
Thu, 1 Apr 2021 17:59:25 +0000 (10:59 -0700)
commit4d9039c8dc2d1f0be1b5ee486d5a83b1614b038a
treedc093020455586517c01c450cc6e4e29dc4db7f9
parent432b2ab427e2b1980df47a76bbd7018b862ae8c3
Add support for fetching signed values from tagged pointers.

The ObjC runtime offers both signed & unsigned tagged pointer value
accessors to tagged pointer providers, but lldb's tagged pointer
code only implemented the unsigned one.  This patch adds an
emulation of the signed one.

The motivation for doing this is that NSNumbers use the signed
accessor (they are always signed) and we need to follow that in our
summary provider or we will get incorrect values for negative
NSNumbers.

The data-formatter-objc test file had NSNumber examples (along with lots of other
goodies) but the NSNumber values weren't tested.  So I also added
checks for those values to the test.

I also did a quick audit of the other types in that main.m file, and
it looks like pretty much all the other values are either intermediates
or are tested.

Differential Revision: https://reviews.llvm.org/D99694
lldb/source/Plugins/Language/ObjC/Cocoa.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h
lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCCF.py