1
0
mirror of https://github.com/golang/go synced 2024-11-22 02:14:40 -07:00

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
This commit is contained in:
Luuk van Dijk 2011-09-29 12:07:38 -07:00
parent 12ad9b4315
commit 8a4ef5d1eb

View File

@ -122,8 +122,8 @@ class ChanTypePrinter:
return str(self.val.type) return str(self.val.type)
def children(self): def children(self):
# see chan.c chanbuf() # see chan.c chanbuf(). et is the type stolen from hchan<T>::recvq->first->elem
et = [x.type for x in self.val['free'].type.target().fields() if x.name == 'elem'][0] 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()) ptr = (self.val.address + 1).cast(et.pointer())
for i in range(self.val["qcount"]): for i in range(self.val["qcount"]):
j = (self.val["recvx"] + i) % self.val["dataqsiz"] j = (self.val["recvx"] + i) % self.val["dataqsiz"]