Commit 8a4ef5d1 authored by Luuk van Dijk's avatar Luuk van Dijk

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
parent 12ad9b43
......@@ -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<T>::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"]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment