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
eaa2a364
Commit
eaa2a364
authored
Dec 19, 2008
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libmach: always print 0x on hex numbers
R=r DELTA=3 (0 added, 0 deleted, 3 changed) OCL=21558 CL=21558
parent
83348f95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
8db.c
src/libmach_amd64/8db.c
+6
-6
machdata.c
src/libmach_amd64/machdata.c
+2
-2
No files found.
src/libmach_amd64/8db.c
View file @
eaa2a364
...
@@ -301,7 +301,7 @@ enum{
...
@@ -301,7 +301,7 @@ enum{
REXX
=
1
<<
1
,
/* extend sib index */
REXX
=
1
<<
1
,
/* extend sib index */
REXB
=
1
<<
0
/* extend modrm r/m, sib base, or opcode reg */
REXB
=
1
<<
0
/* extend modrm r/m, sib base, or opcode reg */
};
};
/* Operand Format codes */
/* Operand Format codes */
/*
/*
%A - address size register modifier (!asize -> 'E')
%A - address size register modifier (!asize -> 'E')
...
@@ -361,7 +361,7 @@ enum {
...
@@ -361,7 +361,7 @@ enum {
OPOVER
,
/* Operand size override */
OPOVER
,
/* Operand size override */
ADDOVER
,
/* Address size override */
ADDOVER
,
/* Address size override */
};
};
static
Optable
optab0F00
[
8
]
=
static
Optable
optab0F00
[
8
]
=
{
{
[
0x00
]
0
,
0
,
"MOVW LDT,%e"
,
[
0x00
]
0
,
0
,
"MOVW LDT,%e"
,
...
@@ -859,7 +859,7 @@ static Optable optabD8[8+8] =
...
@@ -859,7 +859,7 @@ static Optable optabD8[8+8] =
[
0x0f
]
0
,
0
,
"FDIVRD %f,F0"
,
[
0x0f
]
0
,
0
,
"FDIVRD %f,F0"
,
};
};
/*
/*
* optabD9 and optabDB use the following encoding:
* optabD9 and optabDB use the following encoding:
* if (0 <= modrm <= 2) instruction = optabDx[modrm&0x07];
* if (0 <= modrm <= 2) instruction = optabDx[modrm&0x07];
* else instruction = optabDx[(modrm&0x3f)+8];
* else instruction = optabDx[(modrm&0x3f)+8];
*
*
...
@@ -1931,7 +1931,7 @@ immediate(Instr *ip, vlong val)
...
@@ -1931,7 +1931,7 @@ immediate(Instr *ip, vlong val)
w
=
-
w
;
w
=
-
w
;
if
(
issymref
(
ip
,
&
s
,
w
,
val
))
{
if
(
issymref
(
ip
,
&
s
,
w
,
val
))
{
if
(
w
)
if
(
w
)
bprint
(
ip
,
"%s+%lux(SB)"
,
s
.
name
,
w
);
bprint
(
ip
,
"%s+%
#
lux(SB)"
,
s
.
name
,
w
);
else
else
bprint
(
ip
,
"%s(SB)"
,
s
.
name
);
bprint
(
ip
,
"%s(SB)"
,
s
.
name
);
return
;
return
;
...
@@ -1942,7 +1942,7 @@ immediate(Instr *ip, vlong val)
...
@@ -1942,7 +1942,7 @@ immediate(Instr *ip, vlong val)
if (w < 0)
if (w < 0)
w = -w;
w = -w;
if (w < 4096) {
if (w < 4096) {
bprint(ip, "%s-%lux(SB)", s.name, w);
bprint(ip, "%s-%
#
lux(SB)", s.name, w);
return;
return;
}
}
}
}
...
@@ -2250,7 +2250,7 @@ i386foll(Map *map, uvlong pc, Rgetter rget, uvlong *foll)
...
@@ -2250,7 +2250,7 @@ i386foll(Map *map, uvlong pc, Rgetter rget, uvlong *foll)
return
1
;
return
1
;
default:
default:
break
;
break
;
}
}
if
(
strncmp
(
op
->
proto
,
"JMP"
,
3
)
==
0
||
strncmp
(
op
->
proto
,
"CALL"
,
4
)
==
0
)
if
(
strncmp
(
op
->
proto
,
"JMP"
,
3
)
==
0
||
strncmp
(
op
->
proto
,
"CALL"
,
4
)
==
0
)
return
1
;
return
1
;
foll
[
n
++
]
=
pc
+
i
.
n
;
foll
[
n
++
]
=
pc
+
i
.
n
;
...
...
src/libmach_amd64/machdata.c
View file @
eaa2a364
...
@@ -113,7 +113,7 @@ symoff(char *buf, int n, uvlong v, int space)
...
@@ -113,7 +113,7 @@ symoff(char *buf, int n, uvlong v, int space)
if
(
s
.
type
!=
't'
&&
s
.
type
!=
'T'
&&
delta
>=
4096
)
if
(
s
.
type
!=
't'
&&
s
.
type
!=
'T'
&&
delta
>=
4096
)
return
snprint
(
buf
,
n
,
"%llux"
,
v
);
return
snprint
(
buf
,
n
,
"%llux"
,
v
);
else
if
(
delta
)
else
if
(
delta
)
return
snprint
(
buf
,
n
,
"%s+%lux"
,
s
.
name
,
delta
);
return
snprint
(
buf
,
n
,
"%s+%
#
lux"
,
s
.
name
,
delta
);
else
else
return
snprint
(
buf
,
n
,
"%s"
,
s
.
name
);
return
snprint
(
buf
,
n
,
"%s"
,
s
.
name
);
}
}
...
@@ -150,7 +150,7 @@ fpformat(Map *map, Reglist *rp, char *buf, int n, int modif)
...
@@ -150,7 +150,7 @@ fpformat(Map *map, Reglist *rp, char *buf, int n, int modif)
if
(
rp
->
rformat
==
'F'
)
if
(
rp
->
rformat
==
'F'
)
return
1
;
return
1
;
return
2
;
return
2
;
}
}
/* treat it like 'f' */
/* treat it like 'f' */
if
(
get1
(
map
,
rp
->
roffs
,
(
uchar
*
)
reg
,
4
)
<
0
)
if
(
get1
(
map
,
rp
->
roffs
,
(
uchar
*
)
reg
,
4
)
<
0
)
return
-
1
;
return
-
1
;
...
...
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