Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
2b9555fb
Commit
2b9555fb
authored
Jan 06, 2013
by
André Hentschel
Committed by
Alexandre Julliard
Jan 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Add shifted register dataprocessing operators to Thumb2 disassembler.
parent
da817d8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
0 deletions
+95
-0
be_arm.c
programs/winedbg/be_arm.c
+95
-0
No files found.
programs/winedbg/be_arm.c
View file @
2b9555fb
...
@@ -1206,6 +1206,100 @@ static UINT thumb2_disasm_dataprocessingmod(UINT inst, ADDRESS64 *addr)
...
@@ -1206,6 +1206,100 @@ static UINT thumb2_disasm_dataprocessingmod(UINT inst, ADDRESS64 *addr)
}
}
}
}
static
UINT
thumb2_disasm_dataprocessingshift
(
UINT
inst
,
ADDRESS64
*
addr
)
{
WORD
op
=
(
inst
>>
21
)
&
0x0f
;
WORD
sf
=
(
inst
>>
20
)
&
0x01
;
WORD
imm5
=
((
inst
>>
10
)
&
0x1c
)
+
((
inst
>>
6
)
&
0x03
);
WORD
type
=
(
inst
>>
4
)
&
0x03
;
if
(
!
imm5
&&
(
type
==
1
||
type
==
2
))
imm5
=
32
;
else
if
(
!
imm5
&&
type
==
3
)
type
=
4
;
switch
(
op
)
{
case
0
:
if
(
get_nibble
(
inst
,
2
)
==
15
)
dbg_printf
(
"
\n\t
tst
\t
%s, %s"
,
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
else
dbg_printf
(
"
\n\t
and%s
\t
%s, %s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
break
;
case
1
:
dbg_printf
(
"
\n\t
bic%s
\t
%s, %s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
break
;
case
2
:
if
(
get_nibble
(
inst
,
4
)
==
15
)
{
if
(
type
==
4
)
dbg_printf
(
"
\n\t
rrx%s
\t
%s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
else
if
(
!
type
&&
!
imm5
)
dbg_printf
(
"
\n\t
mov%s
\t
%s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
else
dbg_printf
(
"
\n\t
%s%s
\t
%s, %s, #%u"
,
tbl_shifts
[
type
],
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
0
)],
imm5
);
return
0
;
}
else
dbg_printf
(
"
\n\t
orr%s
\t
%s, %s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
break
;
case
3
:
if
(
get_nibble
(
inst
,
4
)
==
15
)
dbg_printf
(
"
\n\t
mvn%s
\t
%s, %s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
else
dbg_printf
(
"
\n\t
orn%s
\t
%s, %s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
break
;
case
4
:
if
(
get_nibble
(
inst
,
2
)
==
15
)
dbg_printf
(
"
\n\t
teq
\t
%s, %s"
,
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
else
dbg_printf
(
"
\n\t
eor%s
\t
%s, %s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
break
;
case
8
:
if
(
get_nibble
(
inst
,
2
)
==
15
)
dbg_printf
(
"
\n\t
cmn
\t
%s, %s"
,
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
else
dbg_printf
(
"
\n\t
add%s
\t
%s, %s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
break
;
case
10
:
dbg_printf
(
"
\n\t
adc%s
\t
%s, %s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
break
;
case
11
:
dbg_printf
(
"
\n\t
sbc%s
\t
%s, %s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
break
;
case
13
:
if
(
get_nibble
(
inst
,
2
)
==
15
)
dbg_printf
(
"
\n\t
cmp
\t
%s, %s"
,
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
else
dbg_printf
(
"
\n\t
sub%s
\t
%s, %s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
break
;
case
14
:
dbg_printf
(
"
\n\t
rsb%s
\t
%s, %s, %s"
,
sf
?
"s"
:
""
,
tbl_regs
[
get_nibble
(
inst
,
2
)],
tbl_regs
[
get_nibble
(
inst
,
4
)],
tbl_regs
[
get_nibble
(
inst
,
0
)]);
break
;
default:
return
inst
;
}
if
(
type
==
4
)
dbg_printf
(
", rrx"
);
else
if
(
type
||
imm5
)
dbg_printf
(
", %s #%u"
,
tbl_shifts
[
type
],
imm5
);
return
0
;
}
static
UINT
thumb2_disasm_coprocdat
(
UINT
inst
,
ADDRESS64
*
addr
)
static
UINT
thumb2_disasm_coprocdat
(
UINT
inst
,
ADDRESS64
*
addr
)
{
{
WORD
opc2
=
(
inst
>>
5
)
&
0x07
;
WORD
opc2
=
(
inst
>>
5
)
&
0x07
;
...
@@ -1444,6 +1538,7 @@ static const struct inst_arm tbl_thumb32[] = {
...
@@ -1444,6 +1538,7 @@ static const struct inst_arm tbl_thumb32[] = {
{
0xfe500000
,
0xf8100000
,
thumb2_disasm_ldrnonword
},
{
0xfe500000
,
0xf8100000
,
thumb2_disasm_ldrnonword
},
{
0xfa008000
,
0xf2000000
,
thumb2_disasm_dataprocessing
},
{
0xfa008000
,
0xf2000000
,
thumb2_disasm_dataprocessing
},
{
0xfa008000
,
0xf0000000
,
thumb2_disasm_dataprocessingmod
},
{
0xfa008000
,
0xf0000000
,
thumb2_disasm_dataprocessingmod
},
{
0xfe008000
,
0xea000000
,
thumb2_disasm_dataprocessingshift
},
{
0xef000010
,
0xee000000
,
thumb2_disasm_coprocdat
},
{
0xef000010
,
0xee000000
,
thumb2_disasm_coprocdat
},
{
0xef000010
,
0xee000010
,
thumb2_disasm_coprocmov1
},
{
0xef000010
,
0xee000010
,
thumb2_disasm_coprocmov1
},
{
0xefe00000
,
0xec400000
,
thumb2_disasm_coprocmov2
},
{
0xefe00000
,
0xec400000
,
thumb2_disasm_coprocmov2
},
...
...
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