[Lldb-commits] [lldb] 96927ba - [lldb] Correct unsigned decimal argument check in memory write

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 17 09:10:55 PDT 2021


Author: David Spickett
Date: 2021-03-17T16:08:54Z
New Revision: 96927bafa41397f3f053ad705a57f5d834e3fb03

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

LOG: [lldb] Correct unsigned decimal argument check in memory write

getAsInteger returns false when it succeeds.

Before:
(lldb) memory write 0x00007ffff7dd3000 99 -f "unsigned decimal"
error: '99' is not a valid unsigned decimal string value.

After:
(lldb) memory write 0x00007ffff7dd3000 99 -f "unsigned decimal"
(lldb) memory read 0x00007ffff7dd3000 0x00007ffff7dd3001
0x7ffff7dd3000: 63                                               c

Added: 
    

Modified: 
    lldb/source/Commands/CommandObjectMemory.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 3e7f67fcbc1f..ca8487906fd0 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -1505,7 +1505,7 @@ class CommandObjectMemoryWrite : public CommandObjectParsed {
 
       case eFormatUnsigned:
 
-        if (!entry.ref().getAsInteger(0, uval64)) {
+        if (entry.ref().getAsInteger(0, uval64)) {
           result.AppendErrorWithFormat(
               "'%s' is not a valid unsigned decimal string value.\n",
               entry.c_str());


        


More information about the lldb-commits mailing list