Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
a596da54
Commit
a596da54
authored
Apr 29, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
May 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedbg: Correctly read register values through dbg_lvalue structure.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1ebccd0f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
16 deletions
+13
-16
debugger.h
programs/winedbg/debugger.h
+2
-2
memory.c
programs/winedbg/memory.c
+2
-2
stack.c
programs/winedbg/stack.c
+6
-5
symbol.c
programs/winedbg/symbol.c
+3
-7
No files found.
programs/winedbg/debugger.h
View file @
a596da54
...
...
@@ -404,7 +404,7 @@ extern BOOL memory_get_current_pc(ADDRESS64* address);
extern
BOOL
memory_get_current_stack
(
ADDRESS64
*
address
);
extern
BOOL
memory_get_string
(
struct
dbg_process
*
pcs
,
void
*
addr
,
BOOL
in_debuggee
,
BOOL
unicode
,
char
*
buffer
,
int
size
);
extern
BOOL
memory_get_string_indirect
(
struct
dbg_process
*
pcs
,
void
*
addr
,
BOOL
unicode
,
WCHAR
*
buffer
,
int
size
);
extern
BOOL
memory_get_register
(
DWORD
regno
,
DWORD_PTR
*
*
value
,
char
*
buffer
,
int
len
);
extern
BOOL
memory_get_register
(
DWORD
regno
,
struct
dbg_lvalue
*
value
,
char
*
buffer
,
int
len
);
extern
void
memory_disassemble
(
const
struct
dbg_lvalue
*
,
const
struct
dbg_lvalue
*
,
int
instruction_count
);
extern
BOOL
memory_disasm_one_insn
(
ADDRESS64
*
addr
);
#define MAX_OFFSET_TO_STR_LEN 19
...
...
@@ -425,7 +425,7 @@ extern void source_free_files(struct dbg_process* p);
extern
void
stack_info
(
int
len
);
extern
void
stack_backtrace
(
DWORD
threadID
);
extern
BOOL
stack_set_frame
(
int
newframe
);
extern
BOOL
stack_get_register_frame
(
const
struct
dbg_internal_var
*
div
,
DWORD_PTR
**
pval
);
extern
BOOL
stack_get_register_frame
(
const
struct
dbg_internal_var
*
div
,
struct
dbg_lvalue
*
lvalue
);
extern
unsigned
stack_fetch_frames
(
const
dbg_ctx_t
*
ctx
);
extern
BOOL
stack_get_current_symbol
(
SYMBOL_INFO
*
sym
);
static
inline
struct
dbg_frame
*
...
...
programs/winedbg/memory.c
View file @
a596da54
...
...
@@ -783,7 +783,7 @@ void memory_disassemble(const struct dbg_lvalue* xstart,
memory_disasm_one_insn
(
&
last
);
}
BOOL
memory_get_register
(
DWORD
regno
,
DWORD_PTR
**
value
,
char
*
buffer
,
int
len
)
BOOL
memory_get_register
(
DWORD
regno
,
struct
dbg_lvalue
*
l
value
,
char
*
buffer
,
int
len
)
{
const
struct
dbg_internal_var
*
div
;
...
...
@@ -813,7 +813,7 @@ BOOL memory_get_register(DWORD regno, DWORD_PTR** value, char* buffer, int len)
{
if
(
div
->
val
==
regno
)
{
if
(
!
stack_get_register_frame
(
div
,
value
))
if
(
!
stack_get_register_frame
(
div
,
l
value
))
{
if
(
buffer
)
snprintf
(
buffer
,
len
,
"<register %s not accessible in this frame>"
,
div
->
name
);
return
FALSE
;
...
...
programs/winedbg/stack.c
View file @
a596da54
...
...
@@ -98,12 +98,13 @@ static BOOL stack_set_frame_internal(int newframe)
return
TRUE
;
}
BOOL
stack_get_register_frame
(
const
struct
dbg_internal_var
*
div
,
DWORD_PTR
**
pval
)
BOOL
stack_get_register_frame
(
const
struct
dbg_internal_var
*
div
,
struct
dbg_lvalue
*
lvalue
)
{
struct
dbg_frame
*
currfrm
=
stack_get_curr_frame
();
if
(
currfrm
==
NULL
)
return
FALSE
;
if
(
currfrm
->
is_ctx_valid
)
*
pval
=
(
DWORD_PTR
*
)((
char
*
)
&
currfrm
->
context
+
(
DWORD_PTR
)
div
->
pval
);
init_lvalue_in_debugger
(
lvalue
,
div
->
typeid
,
(
char
*
)
&
currfrm
->
context
+
(
DWORD_PTR
)
div
->
pval
);
else
{
enum
be_cpu_addr
kind
;
...
...
@@ -114,13 +115,13 @@ BOOL stack_get_register_frame(const struct dbg_internal_var* div, DWORD_PTR** pv
switch
(
kind
)
{
case
be_cpu_addr_pc
:
*
pval
=
&
currfrm
->
linear_pc
;
init_lvalue_in_debugger
(
lvalue
,
dbg_itype_unsigned_long_int
,
&
currfrm
->
linear_pc
)
;
break
;
case
be_cpu_addr_stack
:
*
pval
=
&
currfrm
->
linear_stack
;
init_lvalue_in_debugger
(
lvalue
,
dbg_itype_unsigned_long_int
,
&
currfrm
->
linear_stack
)
;
break
;
case
be_cpu_addr_frame
:
*
pval
=
&
currfrm
->
linear_frame
;
init_lvalue_in_debugger
(
lvalue
,
dbg_itype_unsigned_long_int
,
&
currfrm
->
linear_frame
)
;
break
;
}
}
...
...
programs/winedbg/symbol.c
View file @
a596da54
...
...
@@ -67,24 +67,20 @@ static BOOL fill_sym_lvalue(const SYMBOL_INFO* sym, ULONG_PTR base,
if
(
buffer
)
buffer
[
0
]
=
'\0'
;
if
(
sym
->
Flags
&
SYMFLAG_REGISTER
)
{
DWORD_PTR
*
pval
;
if
(
!
memory_get_register
(
sym
->
Register
,
&
pval
,
buffer
,
sz
))
if
(
!
memory_get_register
(
sym
->
Register
,
lvalue
,
buffer
,
sz
))
return
FALSE
;
init_lvalue
(
lvalue
,
FALSE
,
pval
);
}
else
if
(
sym
->
Flags
&
SYMFLAG_REGREL
)
{
DWORD_PTR
*
pval
;
size_t
l
;
*
buffer
++
=
'['
;
sz
--
;
if
(
!
memory_get_register
(
sym
->
Register
,
&
pval
,
buffer
,
sz
))
if
(
!
memory_get_register
(
sym
->
Register
,
lvalue
,
buffer
,
sz
))
return
FALSE
;
l
=
strlen
(
buffer
);
sz
-=
l
;
buffer
+=
l
;
init_lvalue
(
lvalue
,
TRUE
,
(
void
*
)(
DWORD_PTR
)(
*
pval
+
sym
->
Address
));
init_lvalue
(
lvalue
,
TRUE
,
(
void
*
)(
DWORD_PTR
)(
types_extract_as_integer
(
lvalue
)
+
sym
->
Address
));
if
((
LONG64
)
sym
->
Address
>=
0
)
snprintf
(
buffer
,
sz
,
"+%I64d]"
,
sym
->
Address
);
else
...
...
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