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
8cf8806d
Commit
8cf8806d
authored
Jul 15, 2011
by
Luuk van Dijk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: some enhancements to printing debug info.
R=rsc CC=golang-dev
https://golang.org/cl/4710046
parent
e1b2e202
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
12 deletions
+48
-12
src/cmd/gc/print.c
src/cmd/gc/print.c
+21
-0
src/cmd/gc/subr.c
src/cmd/gc/subr.c
+27
-12
No files found.
src/cmd/gc/print.c
View file @
8cf8806d
...
...
@@ -404,6 +404,7 @@ exprfmt(Fmt *f, Node *n, int prec)
case
OCONVIFACE
:
case
OCONVNOP
:
case
OARRAYBYTESTR
:
case
OSTRARRAYBYTE
:
case
ORUNESTR
:
if
(
n
->
type
==
T
||
n
->
type
->
sym
==
S
)
fmtprint
(
f
,
"(%T)("
,
n
->
type
);
...
...
@@ -445,8 +446,28 @@ exprfmt(Fmt *f, Node *n, int prec)
break
;
case
OMAKEMAP
:
case
OMAKECHAN
:
fmtprint
(
f
,
"make(%#T)"
,
n
->
type
);
break
;
// Some statements
case
ODCL
:
fmtprint
(
f
,
"var %S %#T"
,
n
->
left
->
sym
,
n
->
left
->
type
);
break
;
case
ORETURN
:
fmtprint
(
f
,
"return "
);
exprlistfmt
(
f
,
n
->
list
);
break
;
case
OPROC
:
fmtprint
(
f
,
"go %#N"
,
n
->
left
);
break
;
case
ODEFER
:
fmtprint
(
f
,
"defer %#N"
,
n
->
left
);
break
;
}
if
(
prec
>
nprec
)
...
...
src/cmd/gc/subr.c
View file @
8cf8806d
...
...
@@ -1049,21 +1049,25 @@ Jconv(Fmt *fp)
{
Node
*
n
;
char
*
s
;
int
c
;
n
=
va_arg
(
fp
->
args
,
Node
*
);
if
(
n
->
ullman
!=
0
)
c
=
fp
->
flags
&
FmtShort
;
if
(
!
c
&&
n
->
ullman
!=
0
)
fmtprint
(
fp
,
" u(%d)"
,
n
->
ullman
);
if
(
n
->
addable
!=
0
)
if
(
!
c
&&
n
->
addable
!=
0
)
fmtprint
(
fp
,
" a(%d)"
,
n
->
addable
);
if
(
n
->
vargen
!=
0
)
if
(
!
c
&&
n
->
vargen
!=
0
)
fmtprint
(
fp
,
" g(%d)"
,
n
->
vargen
);
if
(
n
->
lineno
!=
0
)
fmtprint
(
fp
,
" l(%d)"
,
n
->
lineno
);
if
(
n
->
xoffset
!=
BADWIDTH
)
if
(
!
c
&&
n
->
xoffset
!=
BADWIDTH
)
fmtprint
(
fp
,
" x(%lld%+d)"
,
n
->
xoffset
,
n
->
stkdelta
);
if
(
n
->
class
!=
0
)
{
...
...
@@ -1081,10 +1085,13 @@ Jconv(Fmt *fp)
if
(
n
->
funcdepth
!=
0
)
fmtprint
(
fp
,
" f(%d)"
,
n
->
funcdepth
);
if
(
n
->
typecheck
!=
0
)
if
(
n
->
noescape
!=
0
)
fmtprint
(
fp
,
" ne(%d)"
,
n
->
noescape
);
if
(
!
c
&&
n
->
typecheck
!=
0
)
fmtprint
(
fp
,
" tc(%d)"
,
n
->
typecheck
);
if
(
n
->
dodata
!=
0
)
if
(
!
c
&&
n
->
dodata
!=
0
)
fmtprint
(
fp
,
" dd(%d)"
,
n
->
dodata
);
if
(
n
->
isddd
!=
0
)
...
...
@@ -1093,10 +1100,10 @@ Jconv(Fmt *fp)
if
(
n
->
implicit
!=
0
)
fmtprint
(
fp
,
" implicit(%d)"
,
n
->
implicit
);
if
(
n
->
pun
!=
0
)
if
(
!
c
&&
n
->
pun
!=
0
)
fmtprint
(
fp
,
" pun(%d)"
,
n
->
pun
);
if
(
n
->
used
!=
0
)
if
(
!
c
&&
n
->
used
!=
0
)
fmtprint
(
fp
,
" used(%d)"
,
n
->
used
);
return
0
;
}
...
...
@@ -1494,17 +1501,25 @@ Nconv(Fmt *fp)
switch
(
n
->
op
)
{
default:
fmtprint
(
fp
,
"%O%J"
,
n
->
op
,
n
);
if
(
fp
->
flags
&
FmtShort
)
fmtprint
(
fp
,
"%O%hJ"
,
n
->
op
,
n
);
else
fmtprint
(
fp
,
"%O%J"
,
n
->
op
,
n
);
break
;
case
ONAME
:
case
ONONAME
:
if
(
n
->
sym
==
S
)
{
fmtprint
(
fp
,
"%O%J"
,
n
->
op
,
n
);
if
(
fp
->
flags
&
FmtShort
)
fmtprint
(
fp
,
"%O%hJ"
,
n
->
op
,
n
);
else
fmtprint
(
fp
,
"%O%J"
,
n
->
op
,
n
);
break
;
}
fmtprint
(
fp
,
"%O-%S G%d%J"
,
n
->
op
,
n
->
sym
,
n
->
vargen
,
n
);
if
(
fp
->
flags
&
FmtShort
)
fmtprint
(
fp
,
"%O-%S%hJ"
,
n
->
op
,
n
->
sym
,
n
);
else
fmtprint
(
fp
,
"%O-%S%J"
,
n
->
op
,
n
->
sym
,
n
);
goto
ptyp
;
case
OREGISTER
:
...
...
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