summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
diff options
context:
space:
mode:
authorRyan Brown <ribrdb@google.com>2016-04-21 20:57:28 +0000
committerRyan Brown <ribrdb@google.com>2016-04-21 20:57:28 +0000
commit5852c5a12f268aee0274ced9109d72da50985ebe (patch)
tree88c99b720735ebe5e8fd46c7d4033e7dd71faa3f /lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
parent467dbdd030ec2a3aa259715fc092355ce847f04e (diff)
downloadbcm5719-llvm-5852c5a12f268aee0274ced9109d72da50985ebe.tar.gz
bcm5719-llvm-5852c5a12f268aee0274ced9109d72da50985ebe.zip
Update Go OS Plugin for newer runtimes.
Differential Revision: http://reviews.llvm.org/D19273 llvm-svn: 267048
Diffstat (limited to 'lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp')
-rw-r--r--lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp b/lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
index 4f4d476d62c..c8ed821ddfd 100644
--- a/lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
+++ b/lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
@@ -249,8 +249,19 @@ OperatingSystemGo::Init(ThreadList &threads)
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)
{
OpenPOWER on IntegriCloud