[Lldb-commits] [PATCH] Fix -data-read-memory-bytes command (MI)
Ilia K
ki.stfu at gmail.com
Fri Feb 13 10:24:25 PST 2015
================
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")
----------------
clayborg wrote:
> Newbie MI question: no quotes needed around the path?
In this case not, because self.myexe equals to "a.out", which is loaded from current directory.
================
Comment at: tools/lldb-mi/MIUtilString.cpp:463
@@ +462,3 @@
+ errno = 0;
+ const MIuint64 nNum = ::strtoull(this->c_str(), nullptr, 16);
+ if (errno == ERANGE)
----------------
clayborg wrote:
> 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;
>
> ```
This function is called by CMICmdArgValNumber::ExtractNumber() which verifies that string contains only a number.
In other cases I think we can use it like:
```
CMIUtilString str("0x500 MyFunctionName");
MIuint64 n;
str.ExtractNumberFromHexadecimal(n);
assert (n == 0x500);
```
http://reviews.llvm.org/D7610
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the lldb-commits
mailing list