mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: fix gdb support for channels.
R=rsc CC=golang-dev https://golang.org/cl/4418043
This commit is contained in:
parent
9c3ecb3617
commit
dd93df35b9
3 changed files with 11 additions and 17 deletions
|
|
@ -122,10 +122,13 @@ class ChanTypePrinter:
|
|||
return str(self.val.type)
|
||||
|
||||
def children(self):
|
||||
ptr = self.val['recvdataq']
|
||||
for idx in range(self.val["qcount"]):
|
||||
yield ('[%d]' % idx, ptr['elem'])
|
||||
ptr = ptr['link']
|
||||
# see chan.c chanbuf()
|
||||
et = [x.type for x in self.val['free'].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"]
|
||||
yield ('[%d]' % i, (ptr + j).dereference())
|
||||
|
||||
|
||||
#
|
||||
# Register all the *Printer classes above.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue