summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools/lldb-mi/TestMiData.py
diff options
context:
space:
mode:
authorIlia K <ki.stfu@gmail.com>2015-02-13 18:42:25 +0000
committerIlia K <ki.stfu@gmail.com>2015-02-13 18:42:25 +0000
commitb4a110f051b623f20808c57aa7b07400768c51b3 (patch)
treec97804f9ab4a6178f924882af9cdf6bf3699b06a /lldb/test/tools/lldb-mi/TestMiData.py
parenta4897fe79c9db88d9eaf0bf787a64c36ff2a609e (diff)
downloadbcm5719-llvm-b4a110f051b623f20808c57aa7b07400768c51b3.tar.gz
bcm5719-llvm-b4a110f051b623f20808c57aa7b07400768c51b3.zip
Fix -data-read-memory-bytes command (MI)
Summary: * Add IsHexadecimalNumber method to CMIUtilString (MI) * Add number format (dec,hex,auto) to CMICmdArgValNumber (MI) * Fix -data-read-memory-bytes to pass address in hex format (MI) * Fix output begin/end/offset fields format in -data-read-memory-bytes * Fix CMICmdArgValNumber::ExtractNumber to extract 64bit value * + tests All tests passed on OS X Reviewers: abidh, zturner, clayborg Reviewed By: clayborg Subscribers: lldb-commits, zturner, clayborg, abidh Differential Revision: http://reviews.llvm.org/D7610 llvm-svn: 229132
Diffstat (limited to 'lldb/test/tools/lldb-mi/TestMiData.py')
-rw-r--r--lldb/test/tools/lldb-mi/TestMiData.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/lldb/test/tools/lldb-mi/TestMiData.py b/lldb/test/tools/lldb-mi/TestMiData.py
index 8d59197eca8..d01b1c4dd32 100644
--- a/lldb/test/tools/lldb-mi/TestMiData.py
+++ b/lldb/test/tools/lldb-mi/TestMiData.py
@@ -37,6 +37,34 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase):
@lldbmi_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
+ def test_lldbmi_data_read_memory_bytes(self):
+ """Test that 'lldb-mi --interpreter' works for -data-read-memory-bytes."""
+
+ self.spawnLldbMi(args = None)
+
+ # Load executable
+ self.runCmd("-file-exec-and-symbols %s" % self.myexe)
+ self.expect("\^done")
+
+ # Run to main
+ self.runCmd("-break-insert -f main")
+ self.expect("\^done,bkpt={number=\"1\"")
+ self.runCmd("-exec-run")
+ self.expect("\^running")
+ self.expect("\*stopped,reason=\"breakpoint-hit\"")
+
+ # Get address of s_RawData
+ self.runCmd("-data-evaluate-expression &s_RawData")
+ self.expect("\^done,value=\"0x[0-9a-f]+\"",timeout=1)
+ addr = int(self.child.after.split("\"")[1], 16)
+ size = 5
+
+ # Test -data-read-memory-bytes: try to read data of s_RawData
+ self.runCmd("-data-read-memory-bytes %#x %d" % (addr, size))
+ self.expect("\^done,memory=\[{begin=\"0x0*%x\",offset=\"0x0+\",end=\"0x0*%x\",contents=\"1234567800\"}\]" % (addr, addr + size))
+
+ @lldbmi_test
+ @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
def test_lldbmi_data_list_register_names(self):
"""Test that 'lldb-mi --interpreter' works for -data-list-register-names."""
OpenPOWER on IntegriCloud