[Lldb-commits] [lldb] r140540 - /lldb/trunk/source/API/SBFrame.cpp

Johnny Chen johnny.chen at apple.com
Mon Sep 26 11:05:16 PDT 2011


Author: johnny
Date: Mon Sep 26 13:05:16 2011
New Revision: 140540

URL: http://llvm.org/viewvc/llvm-project?rev=140540&view=rev
Log:
Modify SBFrame::WatchValue() impl so that for the watchpoint location created,
it also populates the variable declaration location if possible.

Modified:
    lldb/trunk/source/API/SBFrame.cpp

Modified: lldb/trunk/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=140540&r1=140539&r2=140540&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFrame.cpp (original)
+++ lldb/trunk/source/API/SBFrame.cpp Mon Sep 26 13:05:16 2011
@@ -440,6 +440,18 @@
     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)", 





More information about the lldb-commits mailing list