aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectFrame.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-09-12 23:38:44 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-09-12 23:38:44 +0000
commit887062aeb3f78734ddeac73b227e8d1dd40b1bf3 (patch)
tree56b8bc67a4f1608327fea9c75753af921b52fb0d /lldb/source/Commands/CommandObjectFrame.cpp
parent3337e396c8863af74d84bac60115d25692dcb581 (diff)
downloadllvm-887062aeb3f78734ddeac73b227e8d1dd40b1bf3.zip
llvm-887062aeb3f78734ddeac73b227e8d1dd40b1bf3.tar.gz
llvm-887062aeb3f78734ddeac73b227e8d1dd40b1bf3.tar.bz2
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
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 235ecfd..a86156c 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -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
{