From 3517d128263607187e815621190052d64d0f0061 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 16 Feb 2012 23:09:08 +0000 Subject: [PATCH] memory read -f X doesn't print anything (lldb should warn when encountering an unsupported byte size) Also add a test sequence for it. rdar://problem/10876841 llvm-svn: 150766 --- lldb/source/Core/DataExtractor.cpp | 2 +- lldb/test/functionalities/memory/read/TestMemoryRead.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp index d5296e2451fa..28303ab2e66f 100644 --- a/lldb/source/Core/DataExtractor.cpp +++ b/lldb/source/Core/DataExtractor.cpp @@ -1756,7 +1756,7 @@ DataExtractor::Dump (Stream *s, s->Printf ("%s", float_cstr); break; } - else if (sizeof(long double) * 2 == item_byte_size) + else { s->Printf ("unsupported hex float byte size %u", item_byte_size); return start_offset; diff --git a/lldb/test/functionalities/memory/read/TestMemoryRead.py b/lldb/test/functionalities/memory/read/TestMemoryRead.py index 72792562ae3a..a46f6a11a2e7 100644 --- a/lldb/test/functionalities/memory/read/TestMemoryRead.py +++ b/lldb/test/functionalities/memory/read/TestMemoryRead.py @@ -85,6 +85,11 @@ class MemoryReadTestCase(TestBase): self.expect("memory read --format char[] --size 7 --count 1 `&my_string`", substrs = ['abcdefg']) + # (lldb) memory read --format 'hex float' --size 16 `&argc` + # 0x7fff5fbff9a0: unsupported hex float byte size 16 + self.expect("memory read --format 'hex float' --size 16 `&argc`", + substrs = ['unsupported hex float byte size']) + if __name__ == '__main__': import atexit