[Lldb-commits] [PATCH] D150485: [lldb] Add support for negative integer to {SB, }StructuredData

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 12 14:37:14 PDT 2023


mib created this revision.
mib added reviewers: labath, bulbazord, JDevlieghere, jingham.
mib added a project: LLDB.
Herald added a project: All.
mib requested review of this revision.
Herald added a subscriber: lldb-commits.

This patch refactors the `StructuredData::Integer` class to make it
templated, makes it private and adds 2 public specialization for both
`int64_t` & `uint64_t` with a public type aliases, respectively
`SignedInteger` & `UnsignedInteger`.

It adds new getter for signed and unsigned interger values to the
`StructuredData::Object` base class and changes the implementation of
`StructuredData::Array::GetItemAtIndexAsInteger` and
`StructuredData::Dictionary::GetValueForKeyAsInteger` to support signed
and unsigned integers.

This patch updates the `SBStructuredData::GetIntegerValue` by templating
it and specialize it for `int64_t` & `uint64_t` to avoid breaking the
current implementation. This way when called from python, the same
function will work for both signed and unsigned integers.

Finally, this patch audits all the caller of `StructuredData::Integer`
or `StructuredData::Integer::GetIntegerValue()` to use the proper type.

rdar://105575764

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150485

Files:
  lldb/bindings/interface/SBStructuredDataExtensions.i
  lldb/bindings/interfaces.swig
  lldb/include/lldb/API/SBStructuredData.h
  lldb/include/lldb/Core/StructuredDataImpl.h
  lldb/include/lldb/Utility/StructuredData.h
  lldb/include/lldb/lldb-enumerations.h
  lldb/source/API/SBStructuredData.cpp
  lldb/source/API/SBThread.cpp
  lldb/source/Breakpoint/BreakpointResolverName.cpp
  lldb/source/Core/FormatEntity.cpp
  lldb/source/Host/common/XML.cpp
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
  lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp
  lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
  lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
  lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp
  lldb/source/Target/Thread.cpp
  lldb/source/Utility/StructuredData.cpp
  lldb/tools/lldb-vscode/JSONUtils.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150485.521799.patch
Type: text/x-patch
Size: 42153 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230512/a6665b7f/attachment-0001.bin>


More information about the lldb-commits mailing list