Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tobias Decking
GHC
Commits
94abbcb6
Commit
94abbcb6
authored
Oct 09, 2006
by
Ian Lynagh
Browse files
Tweaks and missing case in disassembler
parent
e4137764
Changes
1
Hide whitespace changes
Inline
Side-by-side
rts/Disassembler.c
View file @
94abbcb6
...
@@ -31,6 +31,7 @@ int
...
@@ -31,6 +31,7 @@ int
disInstr
(
StgBCO
*
bco
,
int
pc
)
disInstr
(
StgBCO
*
bco
,
int
pc
)
{
{
int
i
;
int
i
;
StgWord16
instr
;
StgWord16
*
instrs
=
(
StgWord16
*
)(
bco
->
instrs
->
payload
);
StgWord16
*
instrs
=
(
StgWord16
*
)(
bco
->
instrs
->
payload
);
...
@@ -43,7 +44,8 @@ disInstr ( StgBCO *bco, int pc )
...
@@ -43,7 +44,8 @@ disInstr ( StgBCO *bco, int pc )
StgArrWords
*
itbls_arr
=
bco
->
itbls
;
StgArrWords
*
itbls_arr
=
bco
->
itbls
;
StgInfoTable
**
itbls
=
(
StgInfoTable
**
)(
&
itbls_arr
->
payload
[
0
]);
StgInfoTable
**
itbls
=
(
StgInfoTable
**
)(
&
itbls_arr
->
payload
[
0
]);
switch
(
instrs
[
pc
++
])
{
instr
=
instrs
[
pc
++
];
switch
(
instr
)
{
case
bci_SWIZZLE
:
case
bci_SWIZZLE
:
debugBelch
(
"SWIZZLE stkoff %d by %d
\n
"
,
debugBelch
(
"SWIZZLE stkoff %d by %d
\n
"
,
instrs
[
pc
],
(
signed
int
)
instrs
[
pc
+
1
]);
instrs
[
pc
],
(
signed
int
)
instrs
[
pc
+
1
]);
...
@@ -145,13 +147,17 @@ disInstr ( StgBCO *bco, int pc )
...
@@ -145,13 +147,17 @@ disInstr ( StgBCO *bco, int pc )
debugBelch
(
"ALLOC_AP %d words
\n
"
,
instrs
[
pc
]
);
debugBelch
(
"ALLOC_AP %d words
\n
"
,
instrs
[
pc
]
);
pc
+=
1
;
break
;
pc
+=
1
;
break
;
case
bci_ALLOC_PAP
:
case
bci_ALLOC_PAP
:
debugBelch
(
"ALLOC_PAP %d
words, %d arity
\n
"
,
debugBelch
(
"ALLOC_PAP %d
arity, %d words
\n
"
,
instrs
[
pc
],
instrs
[
pc
+
1
]
);
instrs
[
pc
],
instrs
[
pc
+
1
]
);
pc
+=
2
;
break
;
pc
+=
2
;
break
;
case
bci_MKAP
:
case
bci_MKAP
:
debugBelch
(
"MKAP %d words, %d stkoff
\n
"
,
instrs
[
pc
+
1
],
debugBelch
(
"MKAP %d words, %d stkoff
\n
"
,
instrs
[
pc
+
1
],
instrs
[
pc
]
);
instrs
[
pc
]
);
pc
+=
2
;
break
;
pc
+=
2
;
break
;
case
bci_MKPAP
:
debugBelch
(
"MKPAP %d words, %d stkoff
\n
"
,
instrs
[
pc
+
1
],
instrs
[
pc
]
);
pc
+=
2
;
break
;
case
bci_UNPACK
:
case
bci_UNPACK
:
debugBelch
(
"UNPACK %d
\n
"
,
instrs
[
pc
]
);
debugBelch
(
"UNPACK %d
\n
"
,
instrs
[
pc
]
);
pc
+=
1
;
break
;
pc
+=
1
;
break
;
...
@@ -230,7 +236,7 @@ disInstr ( StgBCO *bco, int pc )
...
@@ -230,7 +236,7 @@ disInstr ( StgBCO *bco, int pc )
break
;
break
;
default:
default:
barf
(
"disInstr: unknown opcode
"
);
barf
(
"disInstr: unknown opcode
%u"
,
(
unsigned
int
)
instr
);
}
}
return
pc
;
return
pc
;
}
}
...
...
Write
Preview
Supports
Markdown
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