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
This commit is contained in:
Johnny Chen 2012-02-16 23:09:08 +00:00
parent 4c006e557d
commit 3517d12826
2 changed files with 6 additions and 1 deletions

View File

@ -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;

View File

@ -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