Watchpoint WIP:

o Rename from OptionGroupWatchpoint::WatchMode to OptionGroupWatchpoint::WatchType,
  and CommandArgumentType::eArgTypeWatchMode to CommandArgumentType::eArgTypeWatchType.
  Update the sources to reflect the change.

o Add a CreateWatchpointLocation() method to Target class, which is currently not implmeneted
  (returns an empty WatchpointLocationSP object).  Add logic to CommandObjectFrame::Execute()
  to exercise the added API for creating a watchpoint location.

llvm-svn: 139560
This commit is contained in:
Johnny Chen
2011-09-12 23:38:44 +00:00
parent 3337e396c8
commit 887062aeb3
9 changed files with 62 additions and 12 deletions

View File

@@ -493,7 +493,7 @@ public:
result.GetErrorStream().Printf ("error: unkown regex error when compiling '%s'\n", name_cstr);
}
}
else
else // No regex, either exact variable names or variable expressions.
{
Error error;
uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember;
@@ -514,10 +514,34 @@ public:
}
if (summary_format_sp)
valobj_sp->SetCustomSummaryFormat(summary_format_sp);
ValueObject::DumpValueObject (result.GetOutputStream(),
Stream &output_stream = result.GetOutputStream();
ValueObject::DumpValueObject (output_stream,
valobj_sp.get(),
valobj_sp->GetParent() ? name_cstr : NULL,
options);
// Process watchpoint if necessary.
if (m_option_watchpoint.watch_variable)
{
lldb::addr_t addr = LLDB_INVALID_ADDRESS;
size_t size = 0;
uint32_t watch_type = m_option_watchpoint.watch_type;
WatchpointLocation *wp_loc =
exe_ctx.target->CreateWatchpointLocation(addr, size, watch_type).get();
if (wp_loc)
{
output_stream.Printf("Watchpoint created: ");
wp_loc->GetDescription(&output_stream, lldb::eDescriptionLevelBrief);
output_stream.EOL();
result.SetStatus(eReturnStatusSuccessFinishResult);
}
else
{
result.AppendErrorWithFormat("Watchpoint creation failed.\n");
result.SetStatus(eReturnStatusFailed);
}
return (wp_loc != NULL);
}
}
else
{