[Lldb-commits] [lldb] c0045a8 - [lldb] Use format specific for unprintabe char in DumpDataExtractor

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 23 11:56:46 PDT 2023


Author: Jonas Devlieghere
Date: 2023-06-23T11:56:41-07:00
New Revision: c0045a8e8e0c72a0c8be3a9c333885da4d14d472

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

LOG: [lldb] Use format specific for unprintabe char in DumpDataExtractor

Addresses Jason's post-commit feedback in D153644.

Added: 
    

Modified: 
    lldb/source/Core/DumpDataExtractor.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Core/DumpDataExtractor.cpp b/lldb/source/Core/DumpDataExtractor.cpp
index 728297a3a5ad8..cb76b118325b7 100644
--- a/lldb/source/Core/DumpDataExtractor.cpp
+++ b/lldb/source/Core/DumpDataExtractor.cpp
@@ -212,8 +212,7 @@ static void DumpCharacter(Stream &s, const char c) {
     s.PutChar(c);
     return;
   }
-  // Non-print characters can be assumed to be unsigned.
-  s.Printf("\\x%2.2x", static_cast<unsigned char>(c));
+  s.Printf("\\x%2.2hhx", c);
 }
 
 /// Dump a floating point type.


        


More information about the lldb-commits mailing list