[Lldb-commits] [lldb] r270592 - Skip leading spaces when decoding hex values

Francis Ricci via lldb-commits lldb-commits at lists.llvm.org
Tue May 24 11:19:45 PDT 2016


Author: fjricci
Date: Tue May 24 13:19:45 2016
New Revision: 270592

URL: http://llvm.org/viewvc/llvm-project?rev=270592&view=rev
Log:
Skip leading spaces when decoding hex values

Summary:
The StringExtractor functions using stroull will already
skip leading whitespace (ie GetU64). Make sure that the manual
hex parsing functions also skip leading whitespace.

This is important for members of the gdb protocol which are defined
as using whitespace separators (ie qfThreadInfo, qC, etc). While
lldb-server does not use the whitespace separators, gdb-remotes
should work if they do, as the whitespace is defined by the gdb-remote
protocol.

Reviewers: vharron, jasonmolenda, clayborg

Subscribers: sas, lldb-commits

Differential Revision: http://reviews.llvm.org/D20509

Modified:
    lldb/trunk/source/Utility/StringExtractor.cpp

Modified: lldb/trunk/source/Utility/StringExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractor.cpp?rev=270592&r1=270591&r2=270592&view=diff
==============================================================================
--- lldb/trunk/source/Utility/StringExtractor.cpp (original)
+++ lldb/trunk/source/Utility/StringExtractor.cpp Tue May 24 13:19:45 2016
@@ -104,6 +104,7 @@ StringExtractor::GetChar (char fail_valu
 int
 StringExtractor::DecodeHexU8()
 {
+    SkipSpaces();
     if (GetBytesLeft() < 2)
     {
         return -1;
@@ -230,6 +231,7 @@ StringExtractor::GetHexMaxU32 (bool litt
     uint32_t result = 0;
     uint32_t nibble_count = 0;
 
+    SkipSpaces();
     if (little_endian)
     {
         uint32_t shift_amount = 0;
@@ -292,6 +294,7 @@ StringExtractor::GetHexMaxU64 (bool litt
     uint64_t result = 0;
     uint32_t nibble_count = 0;
 
+    SkipSpaces();
     if (little_endian)
     {
         uint32_t shift_amount = 0;




More information about the lldb-commits mailing list