diff options
author | Michael Sartain <mikesart@valvesoftware.com> | 2013-08-22 20:42:30 +0000 |
---|---|---|
committer | Michael Sartain <mikesart@valvesoftware.com> | 2013-08-22 20:42:30 +0000 |
commit | b1e159257c54c9b4030a94f0dd222fa85138f3ae (patch) | |
tree | afdc6a85e2686db2a12ca210a81706c698db4e0b /lldb/source/Commands/CommandObjectTarget.cpp | |
parent | 15e4811455565e1d695999d0febf9667c1d44e0c (diff) | |
download | bcm5719-llvm-b1e159257c54c9b4030a94f0dd222fa85138f3ae.tar.gz bcm5719-llvm-b1e159257c54c9b4030a94f0dd222fa85138f3ae.zip |
add error checking and messages to 'target modules show-unwind' command
llvm-svn: 189058
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index dd0e2a0011b..27c6702f8f3 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -3468,6 +3468,7 @@ public: case 'a': { ExecutionContext exe_ctx (m_interpreter.GetExecutionContext()); + m_str = option_arg; m_type = eLookupTypeAddress; m_addr = Args::StringToAddress(&exe_ctx, option_arg, LLDB_INVALID_ADDRESS, &error); if (m_addr == LLDB_INVALID_ADDRESS) @@ -3481,6 +3482,10 @@ public: m_type = eLookupTypeFunctionOrSymbol; break; } + + default: + error.SetErrorStringWithFormat ("unrecognized option %c.", short_option); + break; } return error; @@ -3591,8 +3596,21 @@ protected: } } } + else + { + result.AppendError ("address-expression or function name option must be specified."); + result.SetStatus (eReturnStatusFailed); + return false; + } size_t num_matches = sc_list.GetSize(); + if (num_matches == 0) + { + result.AppendErrorWithFormat ("no unwind data found that matches '%s'.", m_options.m_str.c_str()); + result.SetStatus (eReturnStatusFailed); + return false; + } + for (uint32_t idx = 0; idx < num_matches; idx++) { SymbolContext sc; |