[Lldb-commits] [lldb] 8a45a54 - [lldb] Fix -Wreturn-type in RegisterInfos_x86_64_with_base_shared.cpp (NFC)

2023-07-20 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-07-21T11:42:42+08:00
New Revision: 8a45a54d59fcd29f559f4f260e2c447bef498e1e

URL: 
https://github.com/llvm/llvm-project/commit/8a45a54d59fcd29f559f4f260e2c447bef498e1e
DIFF: 
https://github.com/llvm/llvm-project/commit/8a45a54d59fcd29f559f4f260e2c447bef498e1e.diff

LOG: [lldb] Fix -Wreturn-type in RegisterInfos_x86_64_with_base_shared.cpp (NFC)

/data/llvm-project/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp:319:1:
 error: non-void function does
not return a value in all control paths [-Werror,-Wreturn-type]
}
^
1 error generated.

Added: 


Modified: 

lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp 
b/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp
index a894dfe6143c41..7b2d64de230f33 100644
--- 
a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp
+++ 
b/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp
@@ -238,7 +238,7 @@ uint32_t 
RegisterInfos_x86_64_with_base_shared::g_invalidate_st7_64[] = {
 RegInfo &GetRegInfoShared(llvm::Triple::ArchType arch_type, bool with_base) {
   static std::once_flag once_flag_x86, once_flag_x86_64,
   once_flag_x86_64_with_base;
-  static RegInfo reg_info_x86, reg_info_x86_64, reg_info_x86_64_with_base;
+  static RegInfo reg_info_x86, reg_info_x86_64, reg_info_x86_64_with_base, 
reg_info_invalid;
 
   switch (arch_type) {
   case llvm::Triple::x86:
@@ -314,7 +314,7 @@ RegInfo &GetRegInfoShared(llvm::Triple::ArchType arch_type, 
bool with_base) {
 }
   default:
 assert(false && "Unhandled target architecture.");
-break;
+return reg_info_invalid;
   }
 }
 



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 34fe58e - [lldb] Add a deduction guides for scoped_lock in OptionValue.cpp & ThreadList.cpp (NFC)

2023-08-04 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-08-05T07:56:38+08:00
New Revision: 34fe58e0bc76eff973c9dd7daeddf13c38d184d9

URL: 
https://github.com/llvm/llvm-project/commit/34fe58e0bc76eff973c9dd7daeddf13c38d184d9
DIFF: 
https://github.com/llvm/llvm-project/commit/34fe58e0bc76eff973c9dd7daeddf13c38d184d9.diff

LOG: [lldb] Add a deduction guides for scoped_lock in OptionValue.cpp & 
ThreadList.cpp (NFC)

/data/llvm-project/lldb/source/Interpreter/OptionValue.cpp:28:3: error: 
'scoped_lock' may not intend to support class template argument deduction 
[-Werror,-Wctad-maybe-unsupported]
  std::scoped_lock lock(m_mutex, other.m_mutex);
  ^
/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/mutex:692:11:
 note: add a deduction guide to suppress this warning
class scoped_lock
  ^
1 error generated.

/data/llvm-project/lldb/source/Target/ThreadList.cpp:739:5: error: 
'scoped_lock' may not intend to support class template argument deduction 
[-Werror,-Wctad-maybe-unsupported]
std::scoped_lock guard(GetMutex(), rhs.GetMutex());
^
/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/mutex:692:11:
 note: add a deduction guide to suppress this warning
class scoped_lock
  ^
1 error generated.

Added: 


Modified: 
lldb/source/Interpreter/OptionValue.cpp
lldb/source/Target/ThreadList.cpp

Removed: 




diff  --git a/lldb/source/Interpreter/OptionValue.cpp 
b/lldb/source/Interpreter/OptionValue.cpp
index 5ff7e3c3208980..fe1d8829c5adf6 100644
--- a/lldb/source/Interpreter/OptionValue.cpp
+++ b/lldb/source/Interpreter/OptionValue.cpp
@@ -25,7 +25,7 @@ OptionValue::OptionValue(const OptionValue &other) {
 }
 
 OptionValue& OptionValue::operator=(const OptionValue &other) {
-  std::scoped_lock lock(m_mutex, other.m_mutex);
+  std::scoped_lock lock(m_mutex, other.m_mutex);
 
   m_parent_wp = other.m_parent_wp;
   m_callback = other.m_callback;

diff  --git a/lldb/source/Target/ThreadList.cpp 
b/lldb/source/Target/ThreadList.cpp
index c5c3f667c90471..1ba0c435b993d3 100644
--- a/lldb/source/Target/ThreadList.cpp
+++ b/lldb/source/Target/ThreadList.cpp
@@ -736,7 +736,7 @@ void ThreadList::Update(ThreadList &rhs) {
   if (this != &rhs) {
 // Lock both mutexes to make sure neither side changes anyone on us while
 // the assignment occurs
-std::scoped_lock guard(GetMutex(), rhs.GetMutex());
+std::scoped_lock 
guard(GetMutex(), rhs.GetMutex());
 
 m_process = rhs.m_process;
 m_stop_id = rhs.m_stop_id;



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] a330759 - [lldb] Fix -Wsign-compare in TestSectionSize.cpp (NFC)

2023-08-04 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-08-05T08:34:19+08:00
New Revision: a330759d6e4b7b241b70092e3dd1d0e237ad2a8a

URL: 
https://github.com/llvm/llvm-project/commit/a330759d6e4b7b241b70092e3dd1d0e237ad2a8a
DIFF: 
https://github.com/llvm/llvm-project/commit/a330759d6e4b7b241b70092e3dd1d0e237ad2a8a.diff

LOG: [lldb] Fix -Wsign-compare in TestSectionSize.cpp (NFC)

In file included from 
/data/workspace/llvm-project/lldb/unittests/ObjectFile/PECOFF/TestSectionSize.cpp:10:
/data/workspace/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1620:28:
 error: comparison of integers of different signs: 'c
onst unsigned long' and 'const int' [-Werror,-Wsign-compare]
GTEST_IMPL_CMP_HELPER_(NE, !=);
~~~^~~

Added: 


Modified: 
lldb/unittests/ObjectFile/PECOFF/TestSectionSize.cpp

Removed: 




diff  --git a/lldb/unittests/ObjectFile/PECOFF/TestSectionSize.cpp 
b/lldb/unittests/ObjectFile/PECOFF/TestSectionSize.cpp
index 3ce1e20265f4d9..1a95a0d0fc4e97 100644
--- a/lldb/unittests/ObjectFile/PECOFF/TestSectionSize.cpp
+++ b/lldb/unittests/ObjectFile/PECOFF/TestSectionSize.cpp
@@ -69,10 +69,10 @@ symbols: []
   DataExtractor section_data;
   ASSERT_NE(object_file->ReadSectionData(swiftast_section.get(),
  section_data),
-0);
+(size_t)0);
 
   // Check that the section data size is equal to VirtualSize (496)
   // without the zero padding, instead of SizeOfRawData (512).
-  EXPECT_EQ(section_data.GetByteSize(), 496);
+  EXPECT_EQ(section_data.GetByteSize(), (uint64_t)496);
 }
 



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 989f250 - [lldb] 'scoped_lock' may not intend to support class template argument deduction (NFC)

2023-08-10 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-08-11T09:06:11+08:00
New Revision: 989f25001aee3457738c431ba1e977a8140726a0

URL: 
https://github.com/llvm/llvm-project/commit/989f25001aee3457738c431ba1e977a8140726a0
DIFF: 
https://github.com/llvm/llvm-project/commit/989f25001aee3457738c431ba1e977a8140726a0.diff

LOG: [lldb] 'scoped_lock' may not intend to support class template argument 
deduction (NFC)

/data/home/jiefu/llvm-project/lldb/source/Host/common/File.cpp:251:3: error: 
'scoped_lock' may not intend to support class template argument deduction 
[-Werror,-Wctad-maybe-unsupported]
  std::scoped_lock lock(m_descriptor_mutex, m_stream_mutex);
  ^
/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/mutex:692:11:
 note: add a deduction guide to suppress this warning
class scoped_lock
  ^
/data/home/jiefu/llvm-project/lldb/source/Host/common/File.cpp:316:3: error: 
'scoped_lock' may not intend to support class template argument deduction 
[-Werror,-Wctad-maybe-unsupported]
  std::scoped_lock lock(m_descriptor_mutex, m_stream_mutex);
  ^
/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/mutex:692:11:
 note: add a deduction guide to suppress this warning
class scoped_lock
  ^
2 errors generated.

Added: 


Modified: 
lldb/source/Host/common/File.cpp

Removed: 




diff  --git a/lldb/source/Host/common/File.cpp 
b/lldb/source/Host/common/File.cpp
index 82cfcedd616fc2..174feecf2de0ad 100644
--- a/lldb/source/Host/common/File.cpp
+++ b/lldb/source/Host/common/File.cpp
@@ -248,7 +248,7 @@ uint32_t File::GetPermissions(Status &error) const {
 }
 
 bool NativeFile::IsValid() const {
-  std::scoped_lock lock(m_descriptor_mutex, m_stream_mutex);
+  std::scoped_lock lock(m_descriptor_mutex, 
m_stream_mutex);
   return DescriptorIsValidUnlocked() || StreamIsValidUnlocked();
 }
 
@@ -313,7 +313,7 @@ FILE *NativeFile::GetStream() {
 }
 
 Status NativeFile::Close() {
-  std::scoped_lock lock(m_descriptor_mutex, m_stream_mutex);
+  std::scoped_lock lock(m_descriptor_mutex, 
m_stream_mutex);
 
   Status error;
 



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] d32bcbf - [lldb] Fix build failure in Debugger.cpp (NFC)

2024-03-05 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2024-03-06T10:17:58+08:00
New Revision: d32bcbf6a7f5beb63ce435c2bea737d33d5b7468

URL: 
https://github.com/llvm/llvm-project/commit/d32bcbf6a7f5beb63ce435c2bea737d33d5b7468
DIFF: 
https://github.com/llvm/llvm-project/commit/d32bcbf6a7f5beb63ce435c2bea737d33d5b7468.diff

LOG: [lldb] Fix build failure in Debugger.cpp (NFC)

llvm-project/lldb/source/Core/Debugger.cpp:107:14:
error: no type named 'DefaultThreadPoolThreadPool' in namespace 'llvm'
static llvm::DefaultThreadPoolThreadPool *g_thread_pool = nullptr;
   ~~^
1 error generated.

Added: 


Modified: 
lldb/source/Core/Debugger.cpp

Removed: 




diff  --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 9d62b2a908f770..90aabde2b764f1 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -104,7 +104,7 @@ static std::recursive_mutex *g_debugger_list_mutex_ptr =
 nullptr; // NOTE: intentional leak to avoid issues with C++ destructor 
chain
 static Debugger::DebuggerList *g_debugger_list_ptr =
 nullptr; // NOTE: intentional leak to avoid issues with C++ destructor 
chain
-static llvm::DefaultThreadPoolThreadPool *g_thread_pool = nullptr;
+static llvm::DefaultThreadPool *g_thread_pool = nullptr;
 
 static constexpr OptionEnumValueElement g_show_disassembly_enum_values[] = {
 {



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] ba97dc8 - [lldb] Fix -Wctad-maybe-unsupported in Alarm.cpp (NFC)

2024-03-15 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2024-03-16T06:52:12+08:00
New Revision: ba97dc8c7a8fc26516fbdfe822343bc4d38fe3db

URL: 
https://github.com/llvm/llvm-project/commit/ba97dc8c7a8fc26516fbdfe822343bc4d38fe3db
DIFF: 
https://github.com/llvm/llvm-project/commit/ba97dc8c7a8fc26516fbdfe822343bc4d38fe3db.diff

LOG: [lldb] Fix -Wctad-maybe-unsupported in Alarm.cpp (NFC)

llvm-project/lldb/source/Host/common/Alarm.cpp:37:5:
error: 'lock_guard' may not intend to support class template argument deduction 
[-Werror,-Wctad-maybe-unsupported]
std::lock_guard alarm_guard(m_alarm_mutex);
^

Added: 


Modified: 
lldb/source/Host/common/Alarm.cpp

Removed: 




diff  --git a/lldb/source/Host/common/Alarm.cpp 
b/lldb/source/Host/common/Alarm.cpp
index 80c544773d7650..245cdc7ae5c2da 100644
--- a/lldb/source/Host/common/Alarm.cpp
+++ b/lldb/source/Host/common/Alarm.cpp
@@ -34,7 +34,7 @@ Alarm::Handle Alarm::Create(std::function callback) {
   Handle handle = INVALID_HANDLE;
 
   {
-std::lock_guard alarm_guard(m_alarm_mutex);
+std::lock_guard alarm_guard(m_alarm_mutex);
 
 // Create a new unique entry and remember its handle.
 m_entries.emplace_back(callback, expiration);
@@ -59,7 +59,7 @@ bool Alarm::Restart(Handle handle) {
   const TimePoint expiration = GetNextExpiration();
 
   {
-std::lock_guard alarm_guard(m_alarm_mutex);
+std::lock_guard alarm_guard(m_alarm_mutex);
 
 // Find the entry corresponding to the given handle.
 const auto it =
@@ -86,7 +86,7 @@ bool Alarm::Cancel(Handle handle) {
 return false;
 
   {
-std::lock_guard alarm_guard(m_alarm_mutex);
+std::lock_guard alarm_guard(m_alarm_mutex);
 
 const auto it =
 std::find_if(m_entries.begin(), m_entries.end(),
@@ -126,7 +126,7 @@ void Alarm::StartAlarmThread() {
 void Alarm::StopAlarmThread() {
   if (m_alarm_thread.IsJoinable()) {
 {
-  std::lock_guard alarm_guard(m_alarm_mutex);
+  std::lock_guard alarm_guard(m_alarm_mutex);
   m_exit = true;
 }
 m_alarm_cv.notify_one();
@@ -154,7 +154,7 @@ lldb::thread_result_t Alarm::AlarmThread() {
 //
 // Below we only deal with the timeout expiring and fall through for 
dealing
 // with the rest.
-std::unique_lock alarm_lock(m_alarm_mutex);
+std::unique_lock alarm_lock(m_alarm_mutex);
 if (next_alarm) {
   if (!m_alarm_cv.wait_until(alarm_lock, *next_alarm, predicate)) {
 // The timeout for the next alarm expired.



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 8f2632c - [lldb][test] Fix -Wctad-maybe-unsupported in AlarmTest.cpp (NFC)

2024-03-15 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2024-03-16T06:59:07+08:00
New Revision: 8f2632c45f54d1e91248be81db5d4908d1036213

URL: 
https://github.com/llvm/llvm-project/commit/8f2632c45f54d1e91248be81db5d4908d1036213
DIFF: 
https://github.com/llvm/llvm-project/commit/8f2632c45f54d1e91248be81db5d4908d1036213.diff

LOG: [lldb][test] Fix -Wctad-maybe-unsupported in AlarmTest.cpp (NFC)

llvm-project/lldb/unittests/Host/AlarmTest.cpp:49:7:
error: 'lock_guard' may not intend to support class template argument deduction 
[-Werror,-Wctad-maybe-unsupported]
  std::lock_guard guard(m);
  ^

Added: 


Modified: 
lldb/unittests/Host/AlarmTest.cpp

Removed: 




diff  --git a/lldb/unittests/Host/AlarmTest.cpp 
b/lldb/unittests/Host/AlarmTest.cpp
index e5895574376e38..9f6ad189dee970 100644
--- a/lldb/unittests/Host/AlarmTest.cpp
+++ b/lldb/unittests/Host/AlarmTest.cpp
@@ -46,7 +46,7 @@ TEST(AlarmTest, Create) {
 ALARM_TIMEOUT);
 
 alarm.Create([&callbacks_actual, &m, i]() {
-  std::lock_guard guard(m);
+  std::lock_guard guard(m);
   callbacks_actual[i] = std::chrono::system_clock::now();
 });
 
@@ -75,7 +75,7 @@ TEST(AlarmTest, Exit) {
   callbacks.emplace_back(false);
 
   handles.push_back(alarm.Create([&callbacks, &m, i]() {
-std::lock_guard guard(m);
+std::lock_guard guard(m);
 callbacks[i] = true;
   }));
 }
@@ -101,7 +101,7 @@ TEST(AlarmTest, Cancel) {
 callbacks.emplace_back(false);
 
 handles.push_back(alarm.Create([&callbacks, &m, i]() {
-  std::lock_guard guard(m);
+  std::lock_guard guard(m);
   callbacks[i] = true;
 }));
   }
@@ -137,7 +137,7 @@ TEST(AlarmTest, Restart) {
 ALARM_TIMEOUT);
 
 handles.push_back(alarm.Create([&callbacks_actual, &m, i]() {
-  std::lock_guard guard(m);
+  std::lock_guard guard(m);
   callbacks_actual[i] = std::chrono::system_clock::now();
 }));
 



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 904cf66 - [lldb] Fix build error in lldb-dap.cpp (NFC)

2024-01-19 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2024-01-20T08:09:20+08:00
New Revision: 904cf66ec1d4089e5e661eb996487ba132b97664

URL: 
https://github.com/llvm/llvm-project/commit/904cf66ec1d4089e5e661eb996487ba132b97664
DIFF: 
https://github.com/llvm/llvm-project/commit/904cf66ec1d4089e5e661eb996487ba132b97664.diff

LOG: [lldb] Fix build error in lldb-dap.cpp (NFC)

llvm-project/lldb/tools/lldb-dap/lldb-dap.cpp:679:5:
 error: unknown type name ''
 response["success"] = false;
^

Added: 


Modified: 
lldb/tools/lldb-dap/lldb-dap.cpp

Removed: 




diff  --git a/lldb/tools/lldb-dap/lldb-dap.cpp 
b/lldb/tools/lldb-dap/lldb-dap.cpp
index 828cc67c42dddeb..01494dcc7da00f2 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -676,7 +676,7 @@ void request_attach(const llvm::json::Object &request) {
 
   // Run any initialize LLDB commands the user specified in the launch.json
   if (llvm::Error err = g_dap.RunInitCommands()) {
- response["success"] = false;
+response["success"] = false;
 EmplaceSafeString(response, "message", llvm::toString(std::move(err)));
 g_dap.SendJSON(llvm::json::Value(std::move(response)));
 return;



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 58bedae - [LLDB] Remove unused variable 'lang_rt' in ClangExpressionParser.cpp (NFC)

2023-02-16 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-02-17T09:43:09+08:00
New Revision: 58bedaed0fea43fbf14bdb5f1da500528ca6dc80

URL: 
https://github.com/llvm/llvm-project/commit/58bedaed0fea43fbf14bdb5f1da500528ca6dc80
DIFF: 
https://github.com/llvm/llvm-project/commit/58bedaed0fea43fbf14bdb5f1da500528ca6dc80.diff

LOG: [LLDB] Remove unused variable 'lang_rt' in ClangExpressionParser.cpp (NFC)

/data/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:398:34:
 error: variable 'lang_rt' set but not used [-Werror,-Wunused-but-set-variable]
  lldb_private::LanguageRuntime *lang_rt = nullptr;
 ^
1 error generated.

Added: 


Modified: 
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
index 18d89b91e8313..0b40df141f098 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -395,7 +395,6 @@ ClangExpressionParser::ClangExpressionParser(
 
   lldb::LanguageType frame_lang =
   expr.Language(); // defaults to lldb::eLanguageTypeUnknown
-  lldb_private::LanguageRuntime *lang_rt = nullptr;
 
   std::string abi;
   ArchSpec target_arch;
@@ -415,7 +414,6 @@ ClangExpressionParser::ClangExpressionParser(
 frame_lang = frame_sp->GetLanguage();
 
   if (process_sp && frame_lang != lldb::eLanguageTypeUnknown) {
-lang_rt = process_sp->GetLanguageRuntime(frame_lang);
 LLDB_LOGF(log, "Frame has language of type %s",
   Language::GetNameForLanguageType(frame_lang));
   }



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 42ecceb - [lldb] Fix -Wformat in DWARFDebugAranges.cpp (NFC)

2023-02-22 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-02-23T07:28:38+08:00
New Revision: 42ecceb76bfad21acc589cae0f25110f28006c3a

URL: 
https://github.com/llvm/llvm-project/commit/42ecceb76bfad21acc589cae0f25110f28006c3a
DIFF: 
https://github.com/llvm/llvm-project/commit/42ecceb76bfad21acc589cae0f25110f28006c3a.diff

LOG: [lldb] Fix -Wformat in DWARFDebugAranges.cpp (NFC)

/data/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp:79:66:
 error: format specifies type 'unsigned int' but the argument has type 
'lldb_private::RangeData::DataType' 
(aka 'unsigned long') [-Werror,-Wformat]
  LLDB_LOGF(log, "0x%8.8x: [0x%" PRIx64 " - 0x%" PRIx64 ")", entry->data,
~^~~
%8.8lx
/data/llvm-project/lldb/include/lldb/Utility/Log.h:348:27: note: expanded from 
macro 'LLDB_LOGF'
  log_private->Printf(__VA_ARGS__);\
  ^~~
1 error generated.

Added: 


Modified: 
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp

Removed: 




diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
index a37499175858..c52caab3e735 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
@@ -76,7 +76,7 @@ void DWARFDebugAranges::Dump(Log *log) const {
   for (size_t i = 0; i < num_entries; ++i) {
 const RangeToDIE::Entry *entry = m_aranges.GetEntryAtIndex(i);
 if (entry)
-  LLDB_LOGF(log, "0x%8.8x: [0x%" PRIx64 " - 0x%" PRIx64 ")", entry->data,
+  LLDB_LOGF(log, "0x%8.8lx: [0x%" PRIx64 " - 0x%" PRIx64 ")", entry->data,
 entry->GetRangeBase(), entry->GetRangeEnd());
   }
 }



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 5195e14 - [lldb] Add missing switch case for SveCount in TypeSystemClang::GetEncoding (NFC)

2023-03-07 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-03-08T09:08:42+08:00
New Revision: 5195e14bc1222e1b3f1b7b43c04e1c1ac3504cb1

URL: 
https://github.com/llvm/llvm-project/commit/5195e14bc1222e1b3f1b7b43c04e1c1ac3504cb1
DIFF: 
https://github.com/llvm/llvm-project/commit/5195e14bc1222e1b3f1b7b43c04e1c1ac3504cb1.diff

LOG: [lldb] Add missing switch case for SveCount in 
TypeSystemClang::GetEncoding (NFC)

/data/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4841:13:
 error: enumeration value 'SveCount' not handled in switch [-Werror,-Wswitch]
switch (llvm::cast(qual_type)->getKind()) {
^~~~
1 error generated.

Added: 


Modified: 
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Removed: 




diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index f26147e7d408e..49ebf5181477a 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -5033,6 +5033,7 @@ lldb::Encoding 
TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
 case clang::BuiltinType::SveFloat64x2:
 case clang::BuiltinType::SveFloat64x3:
 case clang::BuiltinType::SveFloat64x4:
+case clang::BuiltinType::SveCount:
   break;
 
 // RISC-V V builtin types.



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 55aa4bf - [lldb] Fix -Wswitch in TypeSystemClang.cpp ('SveBoolx2' and 'SveBoolx4' not handled in switch) (NFC)

2023-03-14 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-03-14T22:24:37+08:00
New Revision: 55aa4bfaee8a2bd5c56765b4d54c4115dcc5d6f3

URL: 
https://github.com/llvm/llvm-project/commit/55aa4bfaee8a2bd5c56765b4d54c4115dcc5d6f3
DIFF: 
https://github.com/llvm/llvm-project/commit/55aa4bfaee8a2bd5c56765b4d54c4115dcc5d6f3.diff

LOG: [lldb] Fix -Wswitch in TypeSystemClang.cpp ('SveBoolx2' and 'SveBoolx4' 
not handled in switch) (NFC)

/data/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4859:13:
 error: enumeration values 'SveBoolx2' and 'SveBoolx4' not handled in switch 
[-Werror,-Wswitch]
switch (llvm::cast(qual_type)->getKind()) {
^~~~
1 error generated.

Added: 


Modified: 
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Removed: 




diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 1d4d66d6e6dc..a739494cffcc 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -5003,6 +5003,8 @@ lldb::Encoding 
TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
 
 // ARM -- Scalable Vector Extension
 case clang::BuiltinType::SveBool:
+case clang::BuiltinType::SveBoolx2:
+case clang::BuiltinType::SveBoolx4:
 case clang::BuiltinType::SveCount:
 case clang::BuiltinType::SveInt8:
 case clang::BuiltinType::SveInt8x2:



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] e42f920 - [lldb] Remove unused private field 'm_orig_rax_info' in RegisterContextLinux_x86_64.h (NFC)

2023-04-05 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-04-05T19:54:23+08:00
New Revision: e42f920918ca5b84329970825ce6a69b53f17bdb

URL: 
https://github.com/llvm/llvm-project/commit/e42f920918ca5b84329970825ce6a69b53f17bdb
DIFF: 
https://github.com/llvm/llvm-project/commit/e42f920918ca5b84329970825ce6a69b53f17bdb.diff

LOG: [lldb] Remove unused private field 'm_orig_rax_info' in 
RegisterContextLinux_x86_64.h (NFC)

/data/llvm-project/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h:32:30:
 error: private field 'm_orig_rax_info' is not used 
[-Werror,-Wunused-private-field]
  lldb_private::RegisterInfo m_orig_rax_info;
 ^
1 error generated.

Added: 


Modified: 
lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h

Removed: 




diff  --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h 
b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h
index 2918e5d5ec31..d141ba66b4e2 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h
@@ -29,7 +29,6 @@ class RegisterContextLinux_x86_64
   const lldb_private::RegisterInfo *m_register_info_p;
   uint32_t m_register_info_count;
   uint32_t m_user_register_count;
-  lldb_private::RegisterInfo m_orig_rax_info;
 };
 
 #endif



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 0ae342f - [lldb][test] Fix -Wsign-compare in RegisterFlagsTest.cpp (NFC)

2023-04-13 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-04-14T09:47:21+08:00
New Revision: 0ae342f45bedd29e34690de087011a9da4db6a65

URL: 
https://github.com/llvm/llvm-project/commit/0ae342f45bedd29e34690de087011a9da4db6a65
DIFF: 
https://github.com/llvm/llvm-project/commit/0ae342f45bedd29e34690de087011a9da4db6a65.diff

LOG: [lldb][test] Fix -Wsign-compare in RegisterFlagsTest.cpp (NFC)

/data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1526:11:
 error: comparison of integers of different signs: 'const unsigned long long' 
and 'const int' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
  ~~~ ^  ~~~
/data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1553:12:
 note: in instantiation of function template specialization 
'testing::internal::CmpHelperEQ' requested here
return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
   ^
/data/llvm-project/lldb/unittests/Target/RegisterFlagsTest.cpp:128:3: note: in 
instantiation of function template specialization 
'testing::internal::EqHelper::Compare' 
requested here
  ASSERT_EQ(0x12345678ULL, rf.ReverseFieldOrder(0x12345678));
  ^
/data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:2056:32:
 note: expanded from macro 'ASSERT_EQ'
   ^
/data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:2040:54:
 note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
 ^
1 error generated.

Added: 


Modified: 
lldb/unittests/Target/RegisterFlagsTest.cpp

Removed: 




diff  --git a/lldb/unittests/Target/RegisterFlagsTest.cpp 
b/lldb/unittests/Target/RegisterFlagsTest.cpp
index 3819c6fda6ceb..c24a6d9bf6c32 100644
--- a/lldb/unittests/Target/RegisterFlagsTest.cpp
+++ b/lldb/unittests/Target/RegisterFlagsTest.cpp
@@ -125,11 +125,11 @@ TEST(RegisterFlagsTest, RegisterFlagsPadding) {
 TEST(RegisterFieldsTest, ReverseFieldOrder) {
   // Unchanged
   RegisterFlags rf("", 4, {make_field(0, 31)});
-  ASSERT_EQ(0x12345678ULL, rf.ReverseFieldOrder(0x12345678));
+  ASSERT_EQ(0x12345678ULL, (unsigned long 
long)rf.ReverseFieldOrder(0x12345678));
 
   // Swap the two halves around.
   RegisterFlags rf2("", 4, {make_field(16, 31), make_field(0, 15)});
-  ASSERT_EQ(0x56781234ULL, rf2.ReverseFieldOrder(0x12345678));
+  ASSERT_EQ(0x56781234ULL, (unsigned long 
long)rf2.ReverseFieldOrder(0x12345678));
 
   // Many small fields.
   RegisterFlags rf3("", 4,



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] c5fc780 - [lldb] Fix -Wctad-maybe-unsupported in PathMappingList.cpp (NFC)

2023-04-20 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-04-21T11:59:38+08:00
New Revision: c5fc7809e05940674424aaed7dd06c6be0639864

URL: 
https://github.com/llvm/llvm-project/commit/c5fc7809e05940674424aaed7dd06c6be0639864
DIFF: 
https://github.com/llvm/llvm-project/commit/c5fc7809e05940674424aaed7dd06c6be0639864.diff

LOG: [lldb] Fix -Wctad-maybe-unsupported in PathMappingList.cpp (NFC)

/home/jiefu/llvm-project/lldb/source/Target/PathMappingList.cpp:51:5: error: 
'scoped_lock' may not intend to support class template argument deduction 
[-Werror,-Wctad-maybe-unsupported]
std::scoped_lock locks(m_mutex, rhs.m_mutex);
^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/mutex:692:11: note: 
add a deduction guide to suppress this warning
class scoped_lock
  ^
/home/jiefu/llvm-project/lldb/source/Target/PathMappingList.cpp:72:3: error: 
'scoped_lock' may not intend to support class template argument deduction 
[-Werror,-Wctad-maybe-unsupported]
  std::scoped_lock locks(m_mutex, rhs.m_mutex);
  ^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/mutex:692:11: note: 
add a deduction guide to suppress this warning
class scoped_lock
  ^
2 errors generated.

Added: 


Modified: 
lldb/source/Target/PathMappingList.cpp

Removed: 




diff  --git a/lldb/source/Target/PathMappingList.cpp 
b/lldb/source/Target/PathMappingList.cpp
index 4efc0bf16c6d2..c369018122a59 100644
--- a/lldb/source/Target/PathMappingList.cpp
+++ b/lldb/source/Target/PathMappingList.cpp
@@ -48,7 +48,7 @@ PathMappingList::PathMappingList(const PathMappingList &rhs)
 
 const PathMappingList &PathMappingList::operator=(const PathMappingList &rhs) {
   if (this != &rhs) {
-std::scoped_lock locks(m_mutex, rhs.m_mutex);
+std::scoped_lock 
locks(m_mutex, rhs.m_mutex);
 m_pairs = rhs.m_pairs;
 m_callback = nullptr;
 m_callback_baton = nullptr;
@@ -69,7 +69,7 @@ void PathMappingList::Append(llvm::StringRef path, 
llvm::StringRef replacement,
 }
 
 void PathMappingList::Append(const PathMappingList &rhs, bool notify) {
-  std::scoped_lock locks(m_mutex, rhs.m_mutex);
+  std::scoped_lock locks(m_mutex, 
rhs.m_mutex);
   ++m_mod_id;
   if (!rhs.m_pairs.empty()) {
 const_iterator pos, end = rhs.m_pairs.end();



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 7b0e548 - [lldb] Fix enumeration value 'RvvInt32m1x2' not handled in switch (NFC)

2023-05-22 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-05-22T16:28:40+08:00
New Revision: 7b0e5485762b9fbbf81419aa67575c38e922e0a5

URL: 
https://github.com/llvm/llvm-project/commit/7b0e5485762b9fbbf81419aa67575c38e922e0a5
DIFF: 
https://github.com/llvm/llvm-project/commit/7b0e5485762b9fbbf81419aa67575c38e922e0a5.diff

LOG: [lldb] Fix enumeration value 'RvvInt32m1x2' not handled in switch (NFC)

/data/llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:4851:13:
 error: enumeration value 'RvvInt32m1x2' not handled in switch 
[-Werror,-Wswitch]
switch (llvm::cast(qual_type)->getKind()) {
^~~~
1 error generated.
ninja: build stopped: subcommand failed.

Added: 


Modified: 
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Removed: 




diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 1a648de721eaa..fa6ab9b2f86b5 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -5115,6 +5115,7 @@ lldb::Encoding 
TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
 case clang::BuiltinType::RvvBool16:
 case clang::BuiltinType::RvvBool32:
 case clang::BuiltinType::RvvBool64:
+case clang::BuiltinType::RvvInt32m1x2:
   break;
 
 // WebAssembly builtin types.



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] f6938ff - [lldb][test] Fix -Wsign-compare in GDBRemoteCommunicationClientTest.cpp (NFC)

2023-05-22 Thread Jie Fu via lldb-commits

Author: Jie Fu
Date: 2023-05-23T09:09:07+08:00
New Revision: f6938ffd4c56d270af62296e405a6b8bddf7955f

URL: 
https://github.com/llvm/llvm-project/commit/f6938ffd4c56d270af62296e405a6b8bddf7955f
DIFF: 
https://github.com/llvm/llvm-project/commit/f6938ffd4c56d270af62296e405a6b8bddf7955f.diff

LOG: [lldb][test] Fix -Wsign-compare in GDBRemoteCommunicationClientTest.cpp 
(NFC)

/data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1526:11:
 error: comparison of integers of different signs: 'const int' and 'const 
unsigned long' [-Werror,-Wsign-compare]
  if (lhs == rhs) {
  ~~~ ^  ~~~
/data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:1553:12:
 note: in instantiation of function template specialization 
'testing::internal::CmpHelperEQ' requested here
return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
   ^
/data/llvm-project/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp:303:3:
 note: in instantiation of function template specialization 
'testing::internal::EqHelper::Compare' requested 
here
  ASSERT_EQ(10, num_packets);
  ^
/data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:2056:32:
 note: expanded from macro 'ASSERT_EQ'
   ^
/data/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:2040:54:
 note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
 ^
1 error generated.

Added: 


Modified: 
lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

Removed: 




diff  --git 
a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp 
b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index eec494f6759ff..f93cf8ce679c5 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -300,7 +300,7 @@ TEST_F(GDBRemoteCommunicationClientTest, 
TestPacketSpeedJSON) {
   size_t num_packets;
   ASSERT_TRUE(dict_sp->GetValueForKeyAsInteger("num_packets", num_packets))
   << ss.GetString();
-  ASSERT_EQ(10, num_packets);
+  ASSERT_EQ(10, (int)num_packets);
 }
 
 TEST_F(GDBRemoteCommunicationClientTest, SendSignalsToIgnore) {



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits