diff options
| author | Jason Molenda <jmolenda@apple.com> | 2017-01-25 01:41:48 +0000 |
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2017-01-25 01:41:48 +0000 |
| commit | a1609ff658f5be59d7441f8f7283ab485139fdd3 (patch) | |
| tree | 84100a358f590728c36106829e894e0ed5ef7585 /lldb/source/Interpreter/OptionGroupFormat.cpp | |
| parent | 4dbf368e14e4e96311abd084f29b07d398f680fc (diff) | |
Jim unintentionally had the gdb-format specifiers falling through
after r276132 so that 'x/4b' would print out a series of 4 8-byte
quantities. Fix that, add a test case.
<rdar://problem/29930833>
llvm-svn: 293002
Diffstat (limited to 'lldb/source/Interpreter/OptionGroupFormat.cpp')
| -rw-r--r-- | lldb/source/Interpreter/OptionGroupFormat.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/lldb/source/Interpreter/OptionGroupFormat.cpp b/lldb/source/Interpreter/OptionGroupFormat.cpp index c97d16ad9865..561576f50acf 100644 --- a/lldb/source/Interpreter/OptionGroupFormat.cpp +++ b/lldb/source/Interpreter/OptionGroupFormat.cpp @@ -235,32 +235,36 @@ bool OptionGroupFormat::ParserGDBFormatLetter( m_prev_gdb_format = format_letter; return true; - // Size isn't used for printing instructions, so if a size is specified, and - // the previous format was - // 'i', then we should reset it to the default ('x'). Otherwise we'll - // continue to print as instructions, - // which isn't expected. case 'b': - byte_size = 1; - LLVM_FALLTHROUGH; case 'h': - byte_size = 2; - LLVM_FALLTHROUGH; case 'w': - byte_size = 4; - LLVM_FALLTHROUGH; case 'g': - byte_size = 8; - - m_prev_gdb_size = format_letter; - if (m_prev_gdb_format == 'i') - m_prev_gdb_format = 'x'; - return true; + { + // Size isn't used for printing instructions, so if a size is specified, and + // the previous format was + // 'i', then we should reset it to the default ('x'). Otherwise we'll + // continue to print as instructions, + // which isn't expected. + if (format_letter == 'b') + byte_size = 1; + else if (format_letter == 'h') + byte_size = 2; + else if (format_letter == 'w') + byte_size = 4; + else if (format_letter == 'g') + byte_size = 8; + m_prev_gdb_size = format_letter; + if (m_prev_gdb_format == 'i') + m_prev_gdb_format = 'x'; + return true; + } break; default: break; } + + return false; } |
