[Lldb-commits] [PATCH] Fix -data-read-memory-bytes command (MI)

Greg Clayton clayborg at gmail.com
Fri Feb 13 09:48:47 PST 2015


Check your strtoull call and make sure you don't need to check if all characters were consumed otherwise the call to strtoull can succeed with "123qed" or any string that isn't all numbers.


================
Comment at: test/tools/lldb-mi/TestMiData.py:46
@@ +45,3 @@
+        # Load executable
+        self.runCmd("-file-exec-and-symbols %s" % self.myexe)
+        self.expect("\^done")
----------------
Newbie MI question: no quotes needed around the path?

================
Comment at: tools/lldb-mi/MIUtilString.cpp:463
@@ +462,3 @@
+    errno = 0;
+    const MIuint64 nNum = ::strtoull(this->c_str(), nullptr, 16);
+    if (errno == ERANGE)
----------------
Has the string been verified to only contain value number characters? If not, then you want to change this to:


```
    char *end = NULL;
    const MIuint64 nNum = ::strtoull(this->c_str(), &end, 16);
    if (end && *end != '\0')
        return false;

```

http://reviews.llvm.org/D7610

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list