Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
dd93df35
Commit
dd93df35
authored
Apr 14, 2011
by
Luuk van Dijk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: fix gdb support for channels.
R=rsc CC=golang-dev
https://golang.org/cl/4418043
parent
9c3ecb36
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
17 deletions
+11
-17
src/cmd/ld/dwarf.c
src/cmd/ld/dwarf.c
+4
-6
src/pkg/runtime/chan.c
src/pkg/runtime/chan.c
+0
-7
src/pkg/runtime/runtime-gdb.py
src/pkg/runtime/runtime-gdb.py
+7
-4
No files found.
src/cmd/ld/dwarf.c
View file @
dd93df35
...
...
@@ -1376,20 +1376,18 @@ synthesizemaptypes(DWDie *die)
static
void
synthesizechantypes
(
DWDie
*
die
)
{
DWDie
*
sudog
,
*
waitq
,
*
link
,
*
hchan
,
DWDie
*
sudog
,
*
waitq
,
*
hchan
,
*
dws
,
*
dww
,
*
dwh
,
*
elemtype
;
DWAttr
*
a
;
int
elemsize
,
linksize
,
sudogsize
;
int
elemsize
,
sudogsize
;
sudog
=
defgotype
(
lookup_or_diag
(
"type.runtime.sudog"
));
waitq
=
defgotype
(
lookup_or_diag
(
"type.runtime.waitq"
));
link
=
defgotype
(
lookup_or_diag
(
"type.runtime.link"
));
hchan
=
defgotype
(
lookup_or_diag
(
"type.runtime.hchan"
));
if
(
sudog
==
nil
||
waitq
==
nil
||
link
==
nil
||
hchan
==
nil
)
if
(
sudog
==
nil
||
waitq
==
nil
||
hchan
==
nil
)
return
;
sudogsize
=
getattr
(
sudog
,
DW_AT_byte_size
)
->
value
;
linksize
=
getattr
(
link
,
DW_AT_byte_size
)
->
value
;
for
(;
die
!=
nil
;
die
=
die
->
link
)
{
if
(
die
->
abbrev
!=
DW_ABRV_CHANTYPE
)
...
...
@@ -1422,7 +1420,7 @@ synthesizechantypes(DWDie *die)
copychildren
(
dwh
,
hchan
);
substitutetype
(
dwh
,
"recvq"
,
dww
);
substitutetype
(
dwh
,
"sendq"
,
dww
);
substitutetype
(
dwh
,
"free"
,
d
ws
);
substitutetype
(
dwh
,
"free"
,
d
efptrto
(
dws
)
);
newattr
(
dwh
,
DW_AT_byte_size
,
DW_CLS_CONSTANT
,
getattr
(
hchan
,
DW_AT_byte_size
)
->
value
,
NULL
);
...
...
src/pkg/runtime/chan.c
View file @
dd93df35
...
...
@@ -9,7 +9,6 @@
static
int32
debug
=
0
;
typedef
struct
Link
Link
;
typedef
struct
WaitQ
WaitQ
;
typedef
struct
SudoG
SudoG
;
typedef
struct
Select
Select
;
...
...
@@ -51,12 +50,6 @@ struct Hchan
// chanbuf(c, i) is pointer to the i'th slot in the buffer.
#define chanbuf(c, i) ((byte*)((c)+1)+(uintptr)(c)->elemsize*(i))
struct
Link
{
Link
*
link
;
// asynch queue circular linked list
byte
elem
[
8
];
// asynch queue data element (+ more)
};
enum
{
// Scase.kind
...
...
src/pkg/runtime/runtime-gdb.py
View file @
dd93df35
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment