From: Luuk van Dijk Date: Thu, 29 Sep 2011 19:07:38 +0000 (-0700) Subject: runtime: gdb support, fix pretty printing of channels. X-Git-Tag: weekly.2011-10-06~62 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8a4ef5d1eb1d7fb46042026824fe50751179dde6;p=gostls13.git runtime: gdb support, fix pretty printing of channels. The type to cast the elements to was stolen from a field that's no longer there. R=rsc CC=golang-dev https://golang.org/cl/5143050 --- diff --git a/src/pkg/runtime/runtime-gdb.py b/src/pkg/runtime/runtime-gdb.py index f815e102c1..ace27e66df 100644 --- a/src/pkg/runtime/runtime-gdb.py +++ b/src/pkg/runtime/runtime-gdb.py @@ -122,8 +122,8 @@ class ChanTypePrinter: return str(self.val.type) def children(self): - # see chan.c chanbuf() - et = [x.type for x in self.val['free'].type.target().fields() if x.name == 'elem'][0] + # see chan.c chanbuf(). et is the type stolen from hchan::recvq->first->elem + et = [x.type for x in self.val['recvq']['first'].type.target().fields() if x.name == 'elem'][0] ptr = (self.val.address + 1).cast(et.pointer()) for i in range(self.val["qcount"]): j = (self.val["recvx"] + i) % self.val["dataqsiz"]