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
11384aa5
Commit
11384aa5
authored
Apr 18, 2012
by
André Hentschel
Committed by
Alexandre Julliard
Apr 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Disassemble more Thumb instructions.
parent
83761d20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
1 deletion
+62
-1
be_arm.c
programs/winedbg/be_arm.c
+62
-1
No files found.
programs/winedbg/be_arm.c
View file @
11384aa5
...
...
@@ -70,6 +70,11 @@ static char const tbl_hiops_t[][4] = {
"add"
,
"cmp"
,
"mov"
,
"bx"
};
static
char
const
tbl_aluops_t
[][
4
]
=
{
"and"
,
"eor"
,
"lsl"
,
"lsr"
,
"asr"
,
"adc"
,
"sbc"
,
"ror"
,
"tst"
,
"neg"
,
"cmp"
,
"cmn"
,
"orr"
,
"mul"
,
"bic"
,
"mvn"
};
static
char
const
tbl_immops_t
[][
4
]
=
{
"mov"
,
"cmp"
,
"add"
,
"sub"
};
...
...
@@ -335,6 +340,17 @@ static WORD thumb_disasm_hireg(WORD inst, ADDRESS64 *addr)
return
0
;
}
static
WORD
thumb_disasm_aluop
(
WORD
inst
,
ADDRESS64
*
addr
)
{
short
dst
=
inst
&
0x07
;
short
src
=
(
inst
>>
3
)
&
0x07
;
short
op
=
(
inst
>>
6
)
&
0x0f
;
dbg_printf
(
"
\n\t
%s
\t
%s, %s"
,
tbl_aluops_t
[
op
],
tbl_regs
[
dst
],
tbl_regs
[
src
]);
return
0
;
}
static
WORD
thumb_disasm_blocktrans
(
WORD
inst
,
ADDRESS64
*
addr
)
{
short
lrpc
=
(
inst
>>
8
)
&
0x01
;
...
...
@@ -371,7 +387,14 @@ static WORD thumb_disasm_longbl(WORD inst, ADDRESS64 *addr)
if
(
!
((
inst2
&
0xf800
)
==
0xf800
))
return
inst
;
offset
+=
(
inst2
&
0x07ff
)
<<
1
;
dbg_printf
(
"
\t
bl
\t
%08x"
,
offset
);
dbg_printf
(
"
\n\t
bl
\t
%08x"
,
offset
);
return
0
;
}
static
WORD
thumb_disasm_condbranch
(
WORD
inst
,
ADDRESS64
*
addr
)
{
WORD
offset
=
inst
&
0x00ff
;
dbg_printf
(
"
\n\t
b%s
\t
%04x"
,
tbl_cond
[(
inst
>>
8
)
&
0x0f
],
offset
);
return
0
;
}
...
...
@@ -402,6 +425,16 @@ static WORD thumb_disasm_ldrsprel(WORD inst, ADDRESS64 *addr)
return
0
;
}
static
WORD
thumb_disasm_addsprel
(
WORD
inst
,
ADDRESS64
*
addr
)
{
WORD
offset
=
(
inst
&
0x7f
)
<<
2
;
if
((
inst
>>
7
)
&
0x01
)
dbg_printf
(
"
\n\t
sub
\t
sp, sp, #%u"
,
offset
);
else
dbg_printf
(
"
\n\t
add
\t
sp, sp, #%u"
,
offset
);
return
0
;
}
static
WORD
thumb_disasm_ldrimm
(
WORD
inst
,
ADDRESS64
*
addr
)
{
WORD
offset
=
(
inst
&
0x07c0
)
>>
6
;
...
...
@@ -417,6 +450,28 @@ static WORD thumb_disasm_immop(WORD inst, ADDRESS64 *addr)
return
0
;
}
static
WORD
thumb_disasm_addsub
(
WORD
inst
,
ADDRESS64
*
addr
)
{
WORD
op
=
(
inst
>>
9
)
&
0x01
;
WORD
immediate
=
(
inst
>>
10
)
&
0x01
;
dbg_printf
(
"
\n\t
%s
\t
%s, %s, "
,
op
?
"sub"
:
"add"
,
tbl_regs
[
inst
&
0x07
],
tbl_regs
[(
inst
>>
3
)
&
0x07
]);
if
(
immediate
)
dbg_printf
(
"#%d"
,
(
inst
>>
6
)
&
0x07
);
else
dbg_printf
(
"%s"
,
tbl_regs
[(
inst
>>
6
)
&
0x07
]);
return
0
;
}
static
WORD
thumb_disasm_movshift
(
WORD
inst
,
ADDRESS64
*
addr
)
{
WORD
op
=
(
inst
>>
11
)
&
0x03
;
dbg_printf
(
"
\n\t
%s
\t
%s, %s, #%u"
,
tbl_shifts
[
op
],
tbl_regs
[
inst
&
0x07
],
tbl_regs
[(
inst
>>
3
)
&
0x07
],
(
inst
>>
6
)
&
0x1f
);
return
0
;
}
struct
inst_arm
{
UINT
mask
;
...
...
@@ -447,14 +502,20 @@ struct inst_thumb16
static
const
struct
inst_thumb16
tbl_thumb16
[]
=
{
{
0xfc00
,
0x4400
,
thumb_disasm_hireg
},
{
0xfc00
,
0x4000
,
thumb_disasm_aluop
},
{
0xf600
,
0xb400
,
thumb_disasm_blocktrans
},
{
0xf800
,
0xf000
,
thumb_disasm_longbl
},
{
0xf000
,
0xd000
,
thumb_disasm_condbranch
},
{
0xf800
,
0x4800
,
thumb_disasm_ldrpcrel
},
{
0xf000
,
0x9000
,
thumb_disasm_ldrsprel
},
{
0xff00
,
0xb000
,
thumb_disasm_addsprel
},
{
0xe000
,
0x6000
,
thumb_disasm_ldrimm
},
{
0xe000
,
0x2000
,
thumb_disasm_immop
},
{
0xf000
,
0xd000
,
thumb_disasm_condbranch
},
{
0xff00
,
0xdf00
,
thumb_disasm_swi
},
{
0xff00
,
0xbf00
,
thumb_disasm_nop
},
{
0xfc00
,
0x1c00
,
thumb_disasm_addsub
},
{
0xe000
,
0x0000
,
thumb_disasm_movshift
},
{
0x0000
,
0x0000
,
NULL
}
};
...
...
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