summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/runtime-gdb.py
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-04-26 09:55:32 +0200
committerOndřej Surý <ondrej@sury.org>2011-04-26 09:55:32 +0200
commit7b15ed9ef455b6b66c6b376898a88aef5d6a9970 (patch)
tree3ef530baa80cdf29436ba981f5783be6b4d2202b /src/pkg/runtime/runtime-gdb.py
parent50104cc32a498f7517a51c8dc93106c51c7a54b4 (diff)
downloadgolang-7b15ed9ef455b6b66c6b376898a88aef5d6a9970.tar.gz
Imported Upstream version 2011.04.13upstream/2011.04.13
Diffstat (limited to 'src/pkg/runtime/runtime-gdb.py')
-rw-r--r--src/pkg/runtime/runtime-gdb.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/pkg/runtime/runtime-gdb.py b/src/pkg/runtime/runtime-gdb.py
index 68dd8abdc..08772a431 100644
--- a/src/pkg/runtime/runtime-gdb.py
+++ b/src/pkg/runtime/runtime-gdb.py
@@ -215,6 +215,8 @@ class IfacePrinter:
return 'string'
def to_string(self):
+ if self.val['data'] == 0:
+ return 0x0
try:
dtype = iface_dtype(self.val)
except:
@@ -308,15 +310,11 @@ class GoroutinesCmd(gdb.Command):
for ptr in linked_list(gdb.parse_and_eval("'runtime.allg'"), 'alllink'):
if ptr['status'] == 6: # 'gdead'
continue
- m = ptr['m']
s = ' '
- if m:
- pc = m['sched']['pc'].cast(vp)
- sp = m['sched']['sp'].cast(vp)
+ if ptr['m']:
s = '*'
- else:
- pc = ptr['sched']['pc'].cast(vp)
- sp = ptr['sched']['sp'].cast(vp)
+ pc = ptr['sched']['pc'].cast(vp)
+ sp = ptr['sched']['sp'].cast(vp)
blk = gdb.block_for_pc(long((pc)))
print s, ptr['goid'], "%8s" % sts[long((ptr['status']))], blk.function
@@ -326,7 +324,7 @@ def find_goroutine(goid):
if ptr['status'] == 6: # 'gdead'
continue
if ptr['goid'] == goid:
- return [(ptr['m'] or ptr)['sched'][x].cast(vp) for x in 'pc', 'sp']
+ return [ptr['sched'][x].cast(vp) for x in 'pc', 'sp']
return None, None