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
3507615f
Commit
3507615f
authored
Jul 31, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp/dwarf: Allow get_context_reg() to handle different register sizes.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9ae588a9
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
18 deletions
+20
-18
cpu_arm.c
dlls/dbghelp/cpu_arm.c
+1
-1
cpu_arm64.c
dlls/dbghelp/cpu_arm64.c
+1
-1
cpu_i386.c
dlls/dbghelp/cpu_i386.c
+1
-1
cpu_x86_64.c
dlls/dbghelp/cpu_x86_64.c
+1
-1
dbghelp_private.h
dlls/dbghelp/dbghelp_private.h
+1
-1
dwarf.c
dlls/dbghelp/dwarf.c
+15
-13
No files found.
dlls/dbghelp/cpu_arm.c
View file @
3507615f
...
@@ -66,7 +66,7 @@ enum st_mode {stm_start, stm_arm, stm_done};
...
@@ -66,7 +66,7 @@ enum st_mode {stm_start, stm_arm, stm_done};
static
BOOL
fetch_next_frame
(
struct
cpu_stack_walk
*
csw
,
union
ctx
*
pcontext
,
static
BOOL
fetch_next_frame
(
struct
cpu_stack_walk
*
csw
,
union
ctx
*
pcontext
,
DWORD_PTR
curr_pc
)
DWORD_PTR
curr_pc
)
{
{
DWORD
_PTR
xframe
;
DWORD
64
xframe
;
CONTEXT
*
context
=
&
pcontext
->
ctx
;
CONTEXT
*
context
=
&
pcontext
->
ctx
;
DWORD
oldReturn
=
context
->
Lr
;
DWORD
oldReturn
=
context
->
Lr
;
...
...
dlls/dbghelp/cpu_arm64.c
View file @
3507615f
...
@@ -68,7 +68,7 @@ enum st_mode {stm_start, stm_arm64, stm_done};
...
@@ -68,7 +68,7 @@ enum st_mode {stm_start, stm_arm64, stm_done};
static
BOOL
fetch_next_frame
(
struct
cpu_stack_walk
*
csw
,
union
ctx
*
pcontext
,
static
BOOL
fetch_next_frame
(
struct
cpu_stack_walk
*
csw
,
union
ctx
*
pcontext
,
DWORD_PTR
curr_pc
)
DWORD_PTR
curr_pc
)
{
{
DWORD
_PTR
xframe
;
DWORD
64
xframe
;
CONTEXT
*
context
=
&
pcontext
->
ctx
;
CONTEXT
*
context
=
&
pcontext
->
ctx
;
DWORD_PTR
oldReturn
=
context
->
u
.
s
.
Lr
;
DWORD_PTR
oldReturn
=
context
->
u
.
s
.
Lr
;
...
...
dlls/dbghelp/cpu_i386.c
View file @
3507615f
...
@@ -94,7 +94,7 @@ static BOOL i386_get_addr(HANDLE hThread, const CONTEXT* ctx,
...
@@ -94,7 +94,7 @@ static BOOL i386_get_addr(HANDLE hThread, const CONTEXT* ctx,
static
BOOL
fetch_next_frame32
(
struct
cpu_stack_walk
*
csw
,
static
BOOL
fetch_next_frame32
(
struct
cpu_stack_walk
*
csw
,
union
ctx
*
pcontext
,
DWORD_PTR
curr_pc
)
union
ctx
*
pcontext
,
DWORD_PTR
curr_pc
)
{
{
DWORD
_PTR
xframe
;
DWORD
64
xframe
;
struct
pdb_cmd_pair
cpair
[
4
];
struct
pdb_cmd_pair
cpair
[
4
];
DWORD
val32
;
DWORD
val32
;
WOW64_CONTEXT
*
context
=
&
pcontext
->
x86
;
WOW64_CONTEXT
*
context
=
&
pcontext
->
x86
;
...
...
dlls/dbghelp/cpu_x86_64.c
View file @
3507615f
...
@@ -579,7 +579,7 @@ static BOOL interpret_function_table_entry(struct cpu_stack_walk* csw,
...
@@ -579,7 +579,7 @@ static BOOL interpret_function_table_entry(struct cpu_stack_walk* csw,
static
BOOL
fetch_next_frame
(
struct
cpu_stack_walk
*
csw
,
union
ctx
*
pcontext
,
static
BOOL
fetch_next_frame
(
struct
cpu_stack_walk
*
csw
,
union
ctx
*
pcontext
,
DWORD_PTR
curr_pc
,
void
**
prtf
)
DWORD_PTR
curr_pc
,
void
**
prtf
)
{
{
DWORD
_PTR
cfa
;
DWORD
64
cfa
;
RUNTIME_FUNCTION
*
rtf
;
RUNTIME_FUNCTION
*
rtf
;
DWORD64
base
;
DWORD64
base
;
CONTEXT
*
context
=
&
pcontext
->
ctx
;
CONTEXT
*
context
=
&
pcontext
->
ctx
;
...
...
dlls/dbghelp/dbghelp_private.h
View file @
3507615f
...
@@ -693,7 +693,7 @@ extern BOOL dwarf2_parse(struct module* module, unsigned long load_offse
...
@@ -693,7 +693,7 @@ extern BOOL dwarf2_parse(struct module* module, unsigned long load_offse
const
struct
elf_thunk_area
*
thunks
,
const
struct
elf_thunk_area
*
thunks
,
struct
image_file_map
*
fmap
)
DECLSPEC_HIDDEN
;
struct
image_file_map
*
fmap
)
DECLSPEC_HIDDEN
;
extern
BOOL
dwarf2_virtual_unwind
(
struct
cpu_stack_walk
*
csw
,
DWORD_PTR
ip
,
extern
BOOL
dwarf2_virtual_unwind
(
struct
cpu_stack_walk
*
csw
,
DWORD_PTR
ip
,
union
ctx
*
ctx
,
ULONG_PTR
*
cfa
)
DECLSPEC_HIDDEN
;
union
ctx
*
ctx
,
DWORD64
*
cfa
)
DECLSPEC_HIDDEN
;
/* stack.c */
/* stack.c */
extern
BOOL
sw_read_mem
(
struct
cpu_stack_walk
*
csw
,
DWORD64
addr
,
void
*
ptr
,
DWORD
sz
)
DECLSPEC_HIDDEN
;
extern
BOOL
sw_read_mem
(
struct
cpu_stack_walk
*
csw
,
DWORD64
addr
,
void
*
ptr
,
DWORD
sz
)
DECLSPEC_HIDDEN
;
...
...
dlls/dbghelp/dwarf.c
View file @
3507615f
...
@@ -3008,18 +3008,19 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx,
...
@@ -3008,18 +3008,19 @@ static void execute_cfa_instructions(dwarf2_traverse_context_t* ctx,
}
}
/* retrieve a context register from its dwarf number */
/* retrieve a context register from its dwarf number */
static
ULONG_PTR
get_context_reg
(
struct
cpu_stack_walk
*
csw
,
union
ctx
*
context
,
static
DWORD64
get_context_reg
(
struct
cpu_stack_walk
*
csw
,
union
ctx
*
context
,
ULONG_PTR
dw_reg
)
ULONG_PTR
dw_reg
)
{
{
unsigned
regno
=
csw
->
cpu
->
map_dwarf_register
(
dw_reg
,
TRUE
),
sz
;
unsigned
regno
=
csw
->
cpu
->
map_dwarf_register
(
dw_reg
,
TRUE
),
sz
;
ULONG_PTR
*
ptr
=
csw
->
cpu
->
fetch_context_reg
(
context
,
regno
,
&
sz
);
void
*
ptr
=
csw
->
cpu
->
fetch_context_reg
(
context
,
regno
,
&
sz
);
if
(
sz
!=
sizeof
(
ULONG_PTR
))
if
(
sz
==
8
)
{
return
*
(
DWORD64
*
)
ptr
;
FIXME
(
"reading register %lu/%u of wrong size %u
\n
"
,
dw_reg
,
regno
,
sz
);
else
if
(
sz
==
4
)
return
*
(
DWORD
*
)
ptr
;
FIXME
(
"unhandled size %d
\n
"
,
sz
);
return
0
;
return
0
;
}
return
*
ptr
;
}
}
/* set a context register from its dwarf number */
/* set a context register from its dwarf number */
...
@@ -3079,7 +3080,8 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w
...
@@ -3079,7 +3080,8 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w
const
unsigned
char
*
zp
,
union
ctx
*
context
)
const
unsigned
char
*
zp
,
union
ctx
*
context
)
{
{
dwarf2_traverse_context_t
ctx
;
dwarf2_traverse_context_t
ctx
;
ULONG_PTR
reg
,
sz
,
tmp
,
stack
[
64
];
ULONG_PTR
reg
,
sz
,
tmp
;
DWORD64
stack
[
64
];
int
sp
=
-
1
;
int
sp
=
-
1
;
ULONG_PTR
len
;
ULONG_PTR
len
;
...
@@ -3117,7 +3119,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w
...
@@ -3117,7 +3119,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w
case
DW_OP_deref
:
case
DW_OP_deref
:
if
(
!
sw_read_mem
(
csw
,
stack
[
sp
],
&
tmp
,
sizeof
(
tmp
)))
if
(
!
sw_read_mem
(
csw
,
stack
[
sp
],
&
tmp
,
sizeof
(
tmp
)))
{
{
ERR
(
"Couldn't read memory at %
lx
\n
"
,
stack
[
sp
]
);
ERR
(
"Couldn't read memory at %
s
\n
"
,
wine_dbgstr_longlong
(
stack
[
sp
])
);
tmp
=
0
;
tmp
=
0
;
}
}
stack
[
sp
]
=
tmp
;
stack
[
sp
]
=
tmp
;
...
@@ -3167,7 +3169,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w
...
@@ -3167,7 +3169,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w
sz
=
dwarf2_parse_byte
(
&
ctx
);
sz
=
dwarf2_parse_byte
(
&
ctx
);
if
(
!
sw_read_mem
(
csw
,
stack
[
sp
],
&
tmp
,
sz
))
if
(
!
sw_read_mem
(
csw
,
stack
[
sp
],
&
tmp
,
sz
))
{
{
ERR
(
"Couldn't read memory at %
lx
\n
"
,
stack
[
sp
]
);
ERR
(
"Couldn't read memory at %
s
\n
"
,
wine_dbgstr_longlong
(
stack
[
sp
])
);
tmp
=
0
;
tmp
=
0
;
}
}
/* do integral promotion */
/* do integral promotion */
...
@@ -3188,7 +3190,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w
...
@@ -3188,7 +3190,7 @@ static ULONG_PTR eval_expression(const struct module* module, struct cpu_stack_w
}
}
static
void
apply_frame_state
(
const
struct
module
*
module
,
struct
cpu_stack_walk
*
csw
,
static
void
apply_frame_state
(
const
struct
module
*
module
,
struct
cpu_stack_walk
*
csw
,
union
ctx
*
context
,
struct
frame_state
*
state
,
ULONG_PTR
*
cfa
)
union
ctx
*
context
,
struct
frame_state
*
state
,
DWORD64
*
cfa
)
{
{
unsigned
int
i
;
unsigned
int
i
;
ULONG_PTR
value
;
ULONG_PTR
value
;
...
@@ -3200,7 +3202,7 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk
...
@@ -3200,7 +3202,7 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk
*
cfa
=
eval_expression
(
module
,
csw
,
(
const
unsigned
char
*
)
state
->
cfa_offset
,
context
);
*
cfa
=
eval_expression
(
module
,
csw
,
(
const
unsigned
char
*
)
state
->
cfa_offset
,
context
);
if
(
!
sw_read_mem
(
csw
,
*
cfa
,
cfa
,
sizeof
(
*
cfa
)))
if
(
!
sw_read_mem
(
csw
,
*
cfa
,
cfa
,
sizeof
(
*
cfa
)))
{
{
WARN
(
"Couldn't read memory at %
p
\n
"
,
(
void
*
)
*
cfa
);
WARN
(
"Couldn't read memory at %
s
\n
"
,
wine_dbgstr_longlong
(
*
cfa
)
);
return
;
return
;
}
}
break
;
break
;
...
@@ -3245,7 +3247,7 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk
...
@@ -3245,7 +3247,7 @@ static void apply_frame_state(const struct module* module, struct cpu_stack_walk
*
*
*/
*/
BOOL
dwarf2_virtual_unwind
(
struct
cpu_stack_walk
*
csw
,
ULONG_PTR
ip
,
BOOL
dwarf2_virtual_unwind
(
struct
cpu_stack_walk
*
csw
,
ULONG_PTR
ip
,
union
ctx
*
context
,
ULONG_PTR
*
cfa
)
union
ctx
*
context
,
DWORD64
*
cfa
)
{
{
struct
module_pair
pair
;
struct
module_pair
pair
;
struct
frame_info
info
;
struct
frame_info
info
;
...
...
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