[Lldb-commits] [lldb] 361543e - [LLDB][Minidump] Change expected directories to the correct type; size_t (#96564)

via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 24 16:33:14 PDT 2024


Author: Jacob Lalonde
Date: 2024-06-24T16:33:09-07:00
New Revision: 361543e4100defe14334cfb11481be44a977e627

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

LOG: [LLDB][Minidump] Change expected directories to the correct type; size_t (#96564)

In #95312 I incorrectly set `m_expected_directories` to uint, this broke
the windows build and is the incorrect type.

`size_t` is more accurate because this value only ever represents the
expected upper bound of the directory vector.

Added: 
    

Modified: 
    lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
    lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
index 7a09c6104d08c..de212c6b20da7 100644
--- a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
+++ b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
@@ -109,7 +109,7 @@ Status MinidumpFileBuilder::AddDirectory(StreamType type,
   if (m_directories.size() + 1 > m_expected_directories) {
     error.SetErrorStringWithFormat(
         "Unable to add directory for stream type %x, exceeded expected number "
-        "of directories %d.",
+        "of directories %zu.",
         (uint32_t)type, m_expected_directories);
     return error;
   }

diff  --git a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h
index b606f925f9912..20564e0661f2a 100644
--- a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h
+++ b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h
@@ -146,7 +146,7 @@ class MinidumpFileBuilder {
   lldb_private::DataBufferHeap m_data;
   lldb::ProcessSP m_process_sp;
 
-  uint m_expected_directories = 0;
+  size_t m_expected_directories = 0;
   uint64_t m_saved_data_size = 0;
   lldb::offset_t m_thread_list_start = 0;
   // We set the max write amount to 128 mb, this is arbitrary


        


More information about the lldb-commits mailing list