Modify SBFrame::WatchValue() impl so that for the watchpoint location created,

it also populates the variable declaration location if possible.

llvm-svn: 140540
This commit is contained in:
Johnny Chen
2011-09-26 18:05:16 +00:00
parent 0ceb8cadd2
commit 7aa043afd9

View File

@@ -440,6 +440,18 @@ SBFrame::WatchValue (const char *name, ValueType value_type, uint32_t watch_type
WatchpointLocationSP wp_loc_sp = m_opaque_sp->GetThread().GetProcess().GetTarget().
CreateWatchpointLocation(addr, size, watch_type);
if (wp_loc_sp) {
// StackFrame::GetInScopeVariableList(true) to get file globals as well.
VariableListSP var_list_sp(m_opaque_sp->GetInScopeVariableList(true));
VariableSP var_sp = var_list_sp->FindVariable(ConstString(name));
if (var_sp && var_sp->GetDeclaration().GetFile()) {
StreamString ss;
// True to show fullpath for declaration file.
var_sp->GetDeclaration().DumpStopContext(&ss, true);
wp_loc_sp->SetDeclInfo(ss.GetString());
}
}
LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
if (log)
log->Printf ("SBFrame(%p)::WatchValue (name=\"%s\", value_type=%i, watch_type=%i) => SBValue(%p) & wp_loc(%p)",