diff options
author | Slava Gurevich <sgurevich@gmail.com> | 2022-08-15 01:51:49 -0700 |
---|---|---|
committer | Slava Gurevich <sgurevich@gmail.com> | 2022-08-17 12:20:10 -0700 |
commit | 163319070947a51beed9d3773bf53d3d48120db8 (patch) | |
tree | 6bcaa39585fca26cfe19e8e68f8576039f16a0ee /lldb/source/Commands/CommandObjectThread.cpp | |
parent | 081dad9e9e8d31564fc52f50066f1e978aa93da9 (diff) | |
download | llvm-163319070947a51beed9d3773bf53d3d48120db8.zip llvm-163319070947a51beed9d3773bf53d3d48120db8.tar.gz llvm-163319070947a51beed9d3773bf53d3d48120db8.tar.bz2 |
[LLDB][NFC] Fix optons parsing and misc. reliability in CommandObjectThread
* Fix broken option parsing in SetOptionValue()
Differential Revision: https://reviews.llvm.org/D131983
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 5d7f3c1..7b739fe 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -62,15 +62,13 @@ public: const int short_option = m_getopt_table[option_idx].val; switch (short_option) { - case 'c': { - int32_t input_count = 0; - if (option_arg.getAsInteger(0, m_count)) { + case 'c': + if (option_arg.getAsInteger(0, m_count) || (m_count < 0)) { m_count = UINT32_MAX; error.SetErrorStringWithFormat( "invalid integer value for option '%c'", short_option); - } else if (input_count < 0) - m_count = UINT32_MAX; - } break; + } + break; case 's': if (option_arg.getAsInteger(0, m_start)) error.SetErrorStringWithFormat( @@ -991,7 +989,7 @@ protected: } LineEntry function_start; - uint32_t index_ptr = 0, end_ptr; + uint32_t index_ptr = 0, end_ptr = UINT32_MAX; std::vector<addr_t> address_list; // Find the beginning & end index of the function, but first make |