aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
authorMed Ismail Bennani <ismail@bennani.ma>2023-05-22 13:52:09 -0700
committerMed Ismail Bennani <ismail@bennani.ma>2023-05-22 16:14:00 -0700
commit1370a1cb5b97ecfc4fd2cb550159db9c9ebd3a68 (patch)
treea281d98fa2d451a04b2b657c02ee19a98c674e3c /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
parent01c5ec3d6209875de05de94cd7923c4e462c3317 (diff)
downloadllvm-1370a1cb5b97ecfc4fd2cb550159db9c9ebd3a68.zip
llvm-1370a1cb5b97ecfc4fd2cb550159db9c9ebd3a68.tar.gz
llvm-1370a1cb5b97ecfc4fd2cb550159db9c9ebd3a68.tar.bz2
[lldb] Add support for negative integer to {SB,}StructuredData
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 also adds 2 new `Get{Signed,Unsigned}IntegerValue` to the `SBStructuredData` class and marks `GetIntegerValue` as deprecated. Finally, this patch audits all the caller of `StructuredData::Integer` or `StructuredData::GetIntegerValue` to use the proper type as well the various tests that uses `SBStructuredData.GetIntegerValue`. rdar://105575764 Differential Revision: https://reviews.llvm.org/D150485 Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index d43401c..d97e3a7 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -2633,7 +2633,7 @@ size_t GDBRemoteCommunicationClient::QueryGDBServer(
uint16_t port = 0;
if (StructuredData::ObjectSP port_osp =
element->GetValueForKey(llvm::StringRef("port")))
- port = port_osp->GetIntegerValue(0);
+ port = port_osp->GetUnsignedIntegerValue(0);
std::string socket_name;
if (StructuredData::ObjectSP socket_name_osp =