Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
6fff0efd
Commit
6fff0efd
authored
Nov 01, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sprint changed to snprint
R=r OCL=18316 CL=18316
parent
db27d309
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
30 deletions
+30
-30
list.c
src/cmd/6l/list.c
+30
-30
No files found.
src/cmd/6l/list.c
View file @
6fff0efd
...
@@ -52,27 +52,27 @@ Pconv(Fmt *fp)
...
@@ -52,27 +52,27 @@ Pconv(Fmt *fp)
p
=
va_arg
(
fp
->
args
,
Prog
*
);
p
=
va_arg
(
fp
->
args
,
Prog
*
);
bigP
=
p
;
bigP
=
p
;
s
print
(
str1
,
"(%ld)"
,
p
->
line
);
s
nprint
(
str1
,
sizeof
(
str1
)
,
"(%ld)"
,
p
->
line
);
switch
(
p
->
as
)
{
switch
(
p
->
as
)
{
case
ATEXT
:
case
ATEXT
:
if
(
p
->
from
.
scale
)
{
if
(
p
->
from
.
scale
)
{
s
print
(
str
,
"%-7s %-7A %D,%d,%lD"
,
s
nprint
(
str
,
sizeof
(
str
)
,
"%-7s %-7A %D,%d,%lD"
,
str1
,
p
->
as
,
&
p
->
from
,
p
->
from
.
scale
,
&
p
->
to
);
str1
,
p
->
as
,
&
p
->
from
,
p
->
from
.
scale
,
&
p
->
to
);
break
;
break
;
}
}
s
print
(
str
,
"%-7s %-7A %D,%lD"
,
s
nprint
(
str
,
sizeof
(
str
)
,
"%-7s %-7A %D,%lD"
,
str1
,
p
->
as
,
&
p
->
from
,
&
p
->
to
);
str1
,
p
->
as
,
&
p
->
from
,
&
p
->
to
);
break
;
break
;
default:
default:
s
print
(
str
,
"%-7s %-7A %D,%D"
,
s
nprint
(
str
,
sizeof
(
str
)
,
"%-7s %-7A %D,%D"
,
str1
,
p
->
as
,
&
p
->
from
,
&
p
->
to
);
str1
,
p
->
as
,
&
p
->
from
,
&
p
->
to
);
break
;
break
;
case
ADATA
:
case
ADATA
:
case
AINIT
:
case
AINIT
:
case
ADYNT
:
case
ADYNT
:
s
print
(
str
,
"%-7s %-7A %D/%d,%D"
,
s
nprint
(
str
,
sizeof
(
str
)
,
"%-7s %-7A %D/%d,%D"
,
str1
,
p
->
as
,
&
p
->
from
,
p
->
from
.
scale
,
&
p
->
to
);
str1
,
p
->
as
,
&
p
->
from
,
p
->
from
.
scale
,
&
p
->
to
);
break
;
break
;
}
}
...
@@ -102,32 +102,32 @@ Dconv(Fmt *fp)
...
@@ -102,32 +102,32 @@ Dconv(Fmt *fp)
if
(
fp
->
flags
&
FmtLong
)
{
if
(
fp
->
flags
&
FmtLong
)
{
if
(
i
!=
D_CONST
)
{
if
(
i
!=
D_CONST
)
{
// ATEXT dst is not constant
// ATEXT dst is not constant
s
print
(
str
,
"!!%D"
,
a
);
s
nprint
(
str
,
sizeof
(
str
)
,
"!!%D"
,
a
);
goto
brk
;
goto
brk
;
}
}
parsetextconst
(
a
->
offset
);
parsetextconst
(
a
->
offset
);
if
(
textarg
==
0
)
{
if
(
textarg
==
0
)
{
s
print
(
str
,
"$%lld"
,
textstksiz
);
s
nprint
(
str
,
sizeof
(
str
)
,
"$%lld"
,
textstksiz
);
goto
brk
;
goto
brk
;
}
}
s
print
(
str
,
"$%lld-%lld"
,
textstksiz
,
textarg
);
s
nprint
(
str
,
sizeof
(
str
)
,
"$%lld-%lld"
,
textstksiz
,
textarg
);
goto
brk
;
goto
brk
;
}
}
if
(
i
>=
D_INDIR
)
{
if
(
i
>=
D_INDIR
)
{
if
(
a
->
offset
)
if
(
a
->
offset
)
s
print
(
str
,
"%lld(%R)"
,
a
->
offset
,
i
-
D_INDIR
);
s
nprint
(
str
,
sizeof
(
str
)
,
"%lld(%R)"
,
a
->
offset
,
i
-
D_INDIR
);
else
else
s
print
(
str
,
"(%R)"
,
i
-
D_INDIR
);
s
nprint
(
str
,
sizeof
(
str
)
,
"(%R)"
,
i
-
D_INDIR
);
goto
brk
;
goto
brk
;
}
}
switch
(
i
)
{
switch
(
i
)
{
default:
default:
if
(
a
->
offset
)
if
(
a
->
offset
)
s
print
(
str
,
"$%lld,%R"
,
a
->
offset
,
i
);
s
nprint
(
str
,
sizeof
(
str
)
,
"$%lld,%R"
,
a
->
offset
,
i
);
else
else
s
print
(
str
,
"%R"
,
i
);
s
nprint
(
str
,
sizeof
(
str
)
,
"%R"
,
i
);
break
;
break
;
case
D_NONE
:
case
D_NONE
:
...
@@ -137,70 +137,70 @@ Dconv(Fmt *fp)
...
@@ -137,70 +137,70 @@ Dconv(Fmt *fp)
case
D_BRANCH
:
case
D_BRANCH
:
if
(
bigP
!=
P
&&
bigP
->
pcond
!=
P
)
if
(
bigP
!=
P
&&
bigP
->
pcond
!=
P
)
if
(
a
->
sym
!=
S
)
if
(
a
->
sym
!=
S
)
s
print
(
str
,
"%llux+%s"
,
bigP
->
pcond
->
pc
,
s
nprint
(
str
,
sizeof
(
str
)
,
"%llux+%s"
,
bigP
->
pcond
->
pc
,
a
->
sym
->
name
);
a
->
sym
->
name
);
else
else
s
print
(
str
,
"%llux"
,
bigP
->
pcond
->
pc
);
s
nprint
(
str
,
sizeof
(
str
)
,
"%llux"
,
bigP
->
pcond
->
pc
);
else
else
s
print
(
str
,
"%lld(PC)"
,
a
->
offset
);
s
nprint
(
str
,
sizeof
(
str
)
,
"%lld(PC)"
,
a
->
offset
);
break
;
break
;
case
D_EXTERN
:
case
D_EXTERN
:
if
(
a
->
sym
)
{
if
(
a
->
sym
)
{
s
print
(
str
,
"%s+%lld(SB)"
,
a
->
sym
->
name
,
a
->
offset
);
s
nprint
(
str
,
sizeof
(
str
)
,
"%s+%lld(SB)"
,
a
->
sym
->
name
,
a
->
offset
);
break
;
break
;
}
}
s
print
(
str
,
"!!noname!!+%lld(SB)"
,
a
->
offset
);
s
nprint
(
str
,
sizeof
(
str
)
,
"!!noname!!+%lld(SB)"
,
a
->
offset
);
break
;
break
;
case
D_STATIC
:
case
D_STATIC
:
if
(
a
->
sym
)
{
if
(
a
->
sym
)
{
s
print
(
str
,
"%s<%d>+%lld(SB)"
,
a
->
sym
->
name
,
s
nprint
(
str
,
sizeof
(
str
)
,
"%s<%d>+%lld(SB)"
,
a
->
sym
->
name
,
a
->
sym
->
version
,
a
->
offset
);
a
->
sym
->
version
,
a
->
offset
);
break
;
break
;
}
}
s
print
(
str
,
"!!noname!!<999>+%lld(SB)"
,
a
->
offset
);
s
nprint
(
str
,
sizeof
(
str
)
,
"!!noname!!<999>+%lld(SB)"
,
a
->
offset
);
break
;
break
;
case
D_AUTO
:
case
D_AUTO
:
if
(
a
->
sym
)
{
if
(
a
->
sym
)
{
s
print
(
str
,
"%s+%lld(SP)"
,
a
->
sym
->
name
,
a
->
offset
);
s
nprint
(
str
,
sizeof
(
str
)
,
"%s+%lld(SP)"
,
a
->
sym
->
name
,
a
->
offset
);
break
;
break
;
}
}
s
print
(
str
,
"!!noname!!+%lld(SP)"
,
a
->
offset
);
s
nprint
(
str
,
sizeof
(
str
)
,
"!!noname!!+%lld(SP)"
,
a
->
offset
);
break
;
break
;
case
D_PARAM
:
case
D_PARAM
:
if
(
a
->
sym
)
{
if
(
a
->
sym
)
{
s
print
(
str
,
"%s+%lld(%s)"
,
a
->
sym
->
name
,
a
->
offset
,
paramspace
);
s
nprint
(
str
,
sizeof
(
str
)
,
"%s+%lld(%s)"
,
a
->
sym
->
name
,
a
->
offset
,
paramspace
);
break
;
break
;
}
}
s
print
(
str
,
"!!noname!!+%lld(%s)"
,
a
->
offset
,
paramspace
);
s
nprint
(
str
,
sizeof
(
str
)
,
"!!noname!!+%lld(%s)"
,
a
->
offset
,
paramspace
);
break
;
break
;
case
D_CONST
:
case
D_CONST
:
s
print
(
str
,
"$%lld"
,
a
->
offset
);
s
nprint
(
str
,
sizeof
(
str
)
,
"$%lld"
,
a
->
offset
);
break
;
break
;
case
D_FCONST
:
case
D_FCONST
:
s
print
(
str
,
"$(%.8lux,%.8lux)"
,
a
->
ieee
.
h
,
a
->
ieee
.
l
);
s
nprint
(
str
,
sizeof
(
str
)
,
"$(%.8lux,%.8lux)"
,
a
->
ieee
.
h
,
a
->
ieee
.
l
);
break
;
break
;
case
D_SCONST
:
case
D_SCONST
:
s
print
(
str
,
"$
\"
%S
\"
"
,
a
->
scon
);
s
nprint
(
str
,
sizeof
(
str
)
,
"$
\"
%S
\"
"
,
a
->
scon
);
break
;
break
;
case
D_ADDR
:
case
D_ADDR
:
a
->
type
=
a
->
index
;
a
->
type
=
a
->
index
;
a
->
index
=
D_NONE
;
a
->
index
=
D_NONE
;
s
print
(
str
,
"$%D"
,
a
);
s
nprint
(
str
,
sizeof
(
str
)
,
"$%D"
,
a
);
a
->
index
=
a
->
type
;
a
->
index
=
a
->
type
;
a
->
type
=
D_ADDR
;
a
->
type
=
D_ADDR
;
goto
conv
;
goto
conv
;
}
}
brk:
brk:
if
(
a
->
index
!=
D_NONE
)
{
if
(
a
->
index
!=
D_NONE
)
{
s
print
(
s
,
"(%R*%d)"
,
a
->
index
,
a
->
scale
);
s
nprint
(
s
,
sizeof
(
s
)
,
"(%R*%d)"
,
a
->
index
,
a
->
scale
);
strcat
(
str
,
s
);
strcat
(
str
,
s
);
}
}
conv:
conv:
...
@@ -342,9 +342,9 @@ Rconv(Fmt *fp)
...
@@ -342,9 +342,9 @@ Rconv(Fmt *fp)
r
=
va_arg
(
fp
->
args
,
int
);
r
=
va_arg
(
fp
->
args
,
int
);
if
(
r
>=
D_AL
&&
r
<=
D_NONE
)
if
(
r
>=
D_AL
&&
r
<=
D_NONE
)
s
print
(
str
,
"%s"
,
regstr
[
r
-
D_AL
]);
s
nprint
(
str
,
sizeof
(
str
)
,
"%s"
,
regstr
[
r
-
D_AL
]);
else
else
s
print
(
str
,
"gok(%d)"
,
r
);
s
nprint
(
str
,
sizeof
(
str
)
,
"gok(%d)"
,
r
);
return
fmtstrcpy
(
fp
,
str
);
return
fmtstrcpy
(
fp
,
str
);
}
}
...
...
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