diff options
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectWatchpoint.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp index 2f350ee..bed490a 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.cpp +++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -1066,6 +1066,7 @@ protected: // Now it's time to create the watchpoint. uint32_t watch_type = m_option_watchpoint.watch_type; + error.Clear(); Watchpoint *wp = target->CreateWatchpoint(addr, size, &type, watch_type, error).get(); if (wp) @@ -1221,16 +1222,13 @@ protected: // If no argument is present, issue an error message. There's no way to set a watchpoint. if (command.GetArgumentCount() == 0) { - result.GetErrorStream().Printf("error: required argument missing; specify an expression to evaulate into the addres to watch for\n"); + result.GetErrorStream().Printf("error: required argument missing; specify an expression to evaulate into the address to watch for\n"); result.SetStatus(eReturnStatusFailed); return false; } - bool with_dash_w = m_option_watchpoint.watch_type_specified; - bool with_dash_x = (m_option_watchpoint.watch_size != 0); - // If no '-w' is specified, default to '-w write'. - if (!with_dash_w) + if (!m_option_watchpoint.watch_type_specified) { m_option_watchpoint.watch_type = OptionGroupWatchpoint::eWatchWrite; } @@ -1271,8 +1269,11 @@ protected: result.SetStatus(eReturnStatusFailed); return false; } - size = with_dash_x ? m_option_watchpoint.watch_size - : target->GetArchitecture().GetAddressByteSize(); + + if (m_option_watchpoint.watch_size != 0) + size = m_option_watchpoint.watch_size; + else + size = target->GetArchitecture().GetAddressByteSize(); // Now it's time to create the watchpoint. uint32_t watch_type = m_option_watchpoint.watch_type; |