summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2015-10-29 23:40:24 +0000
committerEnrico Granata <egranata@apple.com>2015-10-29 23:40:24 +0000
commit7a33621fa576cfd75864dbacef3391e1aa9cca28 (patch)
treee6b22625e0678f776cefedfdfad7782bf804b079 /lldb/packages/Python/lldbsuite
parentbcfd1f0c5607c4a0a231e55961baf4a5a36c8c3c (diff)
downloadbcm5719-llvm-7a33621fa576cfd75864dbacef3391e1aa9cca28.tar.gz
bcm5719-llvm-7a33621fa576cfd75864dbacef3391e1aa9cca28.zip
Add a --offset option to memory read that allows one to specify, given a type, how many sizeof(type) bytes to speak before starting to read memory
llvm-svn: 251668
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py9
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/memory/read/main.cpp1
2 files changed, 10 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py b/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py
index 085c9bdd989..4fa570fc13a 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py
@@ -89,3 +89,12 @@ class MemoryReadTestCase(TestBase):
# 0x7fff5fbff598: error: unsupported byte size (20) for float format
self.expect("memory read --format 'float' --count 1 --size 20 `&my_double`",
substrs = ['unsupported byte size (20) for float format'])
+
+ self.expect('memory read --type int --count 5 `&my_ints[0]`',
+ substrs=['(int) 0x', '2','4','6','8','10'])
+
+ self.expect('memory read --type int --count 5 --format hex `&my_ints[0]`',
+ substrs=['(int) 0x', '0x','0a'])
+
+ self.expect('memory read --type int --count 5 --offset 5 `&my_ints[0]`',
+ substrs=['(int) 0x', '12', '14','16','18', '20'])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/main.cpp
index b4d7809d27c..cd367ff318a 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/main.cpp
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/memory/read/main.cpp
@@ -12,6 +12,7 @@ int main (int argc, char const *argv[])
{
char my_string[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 0};
double my_double = 1234.5678;
+ int my_ints[] = {2,4,6,8,10,12,14,16,18,20,22};
printf("my_string=%s\n", my_string); // Set break point at this line.
printf("my_double=%g\n", my_double);
return 0;
OpenPOWER on IntegriCloud