This revision was automatically updated to reflect the committed changes.
Closed by commit rL267048: Update Go OS Plugin for newer runtimes. (authored by 
ribrdb).

Changed prior to commit:
  http://reviews.llvm.org/D19273?vs=54427&id=54572#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19273

Files:
  lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp

Index: lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
===================================================================
--- lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
+++ lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
@@ -249,8 +249,19 @@
     TargetSP target_sp = m_process->CalculateTarget();
     if (!target_sp)
         return false;
-    m_allg_sp = FindGlobal(target_sp, "runtime.allg");
-    m_allglen_sp = FindGlobal(target_sp, "runtime.allglen");
+    // Go 1.6 stores goroutines in a slice called runtime.allgs
+    ValueObjectSP allgs_sp = FindGlobal(target_sp, "runtime.allgs");
+    if (allgs_sp)
+    {
+        m_allg_sp = allgs_sp->GetChildMemberWithName(ConstString("array"), 
true);
+        m_allglen_sp = allgs_sp->GetChildMemberWithName(ConstString("len"), 
true);
+    }
+    else
+    {
+        // Go 1.4 stores goroutines in the variable runtime.allg.
+        m_allg_sp = FindGlobal(target_sp, "runtime.allg");
+        m_allglen_sp = FindGlobal(target_sp, "runtime.allglen");
+    }
 
     if (m_allg_sp && !m_allglen_sp)
     {


Index: lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
===================================================================
--- lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
+++ lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
@@ -249,8 +249,19 @@
     TargetSP target_sp = m_process->CalculateTarget();
     if (!target_sp)
         return false;
-    m_allg_sp = FindGlobal(target_sp, "runtime.allg");
-    m_allglen_sp = FindGlobal(target_sp, "runtime.allglen");
+    // Go 1.6 stores goroutines in a slice called runtime.allgs
+    ValueObjectSP allgs_sp = FindGlobal(target_sp, "runtime.allgs");
+    if (allgs_sp)
+    {
+        m_allg_sp = allgs_sp->GetChildMemberWithName(ConstString("array"), true);
+        m_allglen_sp = allgs_sp->GetChildMemberWithName(ConstString("len"), true);
+    }
+    else
+    {
+        // Go 1.4 stores goroutines in the variable runtime.allg.
+        m_allg_sp = FindGlobal(target_sp, "runtime.allg");
+        m_allglen_sp = FindGlobal(target_sp, "runtime.allglen");
+    }
 
     if (m_allg_sp && !m_allglen_sp)
     {
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to