[Lldb-commits] [lldb] [lldb] Fix string truncation method when substring is the prefix of string (NFC) (PR #94785)
Shivam Gupta via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 9 03:31:21 PDT 2024
https://github.com/xgupta updated https://github.com/llvm/llvm-project/pull/94785
>From 6ec5b1a005b7551f2857b30e2461d297e7febfa3 Mon Sep 17 00:00:00 2001
From: Shivam Gupta <shivam98.tkg at gmail.com>
Date: Fri, 7 Jun 2024 23:44:49 +0530
Subject: [PATCH 1/3] [LLDB][NFC] Fix a cppcheck warning in
Platform/Android/PlatformAndroid.cpp
Fix #91211
---
lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
index e177c134fea20..6367763dd8b4a 100644
--- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -287,7 +287,7 @@ Status PlatformAndroid::DownloadModuleSlice(const FileSpec &src_file_spec,
static constexpr llvm::StringLiteral k_zip_separator("!/");
size_t pos = source_file.find(k_zip_separator);
if (pos != std::string::npos)
- source_file = source_file.substr(0, pos);
+ source_file = source_file.resize(0, pos);
Status error;
AdbClientUP adb(GetAdbClient(error));
>From c05f1a9812b8ef6cfc4f1f4c2d7525371d65a95b Mon Sep 17 00:00:00 2001
From: Shivam Gupta <shivma98.tkg at gmail.com>
Date: Sat, 6 Jul 2024 11:00:16 +0200
Subject: [PATCH 2/3] address review comment
---
lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
index 6367763dd8b4a..ff63af68aec9d 100644
--- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -287,7 +287,7 @@ Status PlatformAndroid::DownloadModuleSlice(const FileSpec &src_file_spec,
static constexpr llvm::StringLiteral k_zip_separator("!/");
size_t pos = source_file.find(k_zip_separator);
if (pos != std::string::npos)
- source_file = source_file.resize(0, pos);
+ source_file = source_file.resize(pos);
Status error;
AdbClientUP adb(GetAdbClient(error));
>From 1cd2f9c11070bcbee2efad2e5b84433eef31438c Mon Sep 17 00:00:00 2001
From: Shivam Gupta <shivma98.tkg at gmail.com>
Date: Tue, 9 Jul 2024 12:31:01 +0200
Subject: [PATCH 3/3] address review comment
---
lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
index ff63af68aec9d..50b6a5c29a657 100644
--- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -287,7 +287,7 @@ Status PlatformAndroid::DownloadModuleSlice(const FileSpec &src_file_spec,
static constexpr llvm::StringLiteral k_zip_separator("!/");
size_t pos = source_file.find(k_zip_separator);
if (pos != std::string::npos)
- source_file = source_file.resize(pos);
+ source_file.resize(pos);
Status error;
AdbClientUP adb(GetAdbClient(error));
More information about the lldb-commits
mailing list