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
4202a49b
Commit
4202a49b
authored
Nov 24, 2006
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: Add support for deref operation in location computation.
parent
e48a46b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
6 deletions
+35
-6
dwarf.c
dlls/dbghelp/dwarf.c
+35
-6
No files found.
dlls/dbghelp/dwarf.c
View file @
4202a49b
...
...
@@ -626,7 +626,7 @@ reg: fop 31
static
enum
location_error
compute_location
(
dwarf2_traverse_context_t
*
ctx
,
struct
location
*
loc
,
const
struct
location
*
frame
)
HANDLE
hproc
,
const
struct
location
*
frame
)
{
unsigned
long
stack
[
64
];
unsigned
stk
;
...
...
@@ -720,6 +720,34 @@ compute_location(dwarf2_traverse_context_t* ctx, struct location* loc,
piece_found
=
TRUE
;
}
break
;
case
DW_OP_deref
:
if
(
!
stk
)
{
FIXME
(
"Unexpected empty stack
\n
"
);
return
loc_err_internal
;
}
if
(
loc
->
reg
!=
Wine_DW_no_register
)
{
WARN
(
"Too complex expression for deref
\n
"
);
return
loc_err_too_complex
;
}
if
(
hproc
)
{
DWORD
addr
=
stack
[
stk
--
];
DWORD
deref
;
if
(
!
ReadProcessMemory
(
hproc
,
(
void
*
)
addr
,
&
deref
,
sizeof
(
deref
),
NULL
))
{
WARN
(
"Couldn't read memory at %lx
\n
"
,
addr
);
return
loc_err_cant_read
;
}
stack
[
++
stk
]
=
deref
;
}
else
{
loc
->
kind
=
loc_dwarf2_block
;
}
break
;
default:
FIXME
(
"Unhandled attr op: %x
\n
"
,
op
);
return
loc_err_internal
;
...
...
@@ -765,7 +793,7 @@ static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx,
lctx
.
end_data
=
xloc
.
u
.
block
.
ptr
+
xloc
.
u
.
block
.
size
;
lctx
.
word_size
=
ctx
->
word_size
;
err
=
compute_location
(
&
lctx
,
loc
,
frame
);
err
=
compute_location
(
&
lctx
,
loc
,
NULL
,
frame
);
if
(
err
<
0
)
{
loc
->
kind
=
loc_error
;
...
...
@@ -1932,7 +1960,8 @@ static BOOL dwarf2_lookup_loclist(const struct module* module, const BYTE* start
return
FALSE
;
}
static
enum
location_error
loc_compute_frame
(
const
struct
module
*
module
,
static
enum
location_error
loc_compute_frame
(
struct
process
*
pcs
,
const
struct
module
*
module
,
const
struct
symt_function
*
func
,
DWORD
ip
,
struct
location
*
frame
)
{
...
...
@@ -1960,7 +1989,7 @@ static enum location_error loc_compute_frame(const struct module* module,
module
->
dwarf2_info
->
debug_loc
.
address
+
pframe
->
offset
,
ip
,
&
lctx
))
return
loc_err_out_of_scope
;
if
((
err
=
compute_location
(
&
lctx
,
frame
,
NULL
))
<
0
)
return
err
;
if
((
err
=
compute_location
(
&
lctx
,
frame
,
pcs
->
handle
,
NULL
))
<
0
)
return
err
;
if
(
frame
->
kind
>=
loc_user
)
{
WARN
(
"Couldn't compute runtime frame location
\n
"
);
...
...
@@ -1998,7 +2027,7 @@ static void dwarf2_location_compute(struct process* pcs,
/* instruction pointer relative to compiland's start */
ip
=
pcs
->
ctx_frame
.
InstructionOffset
-
((
struct
symt_compiland
*
)
func
->
container
)
->
address
;
if
((
err
=
loc_compute_frame
(
module
,
func
,
ip
,
&
frame
))
==
0
)
if
((
err
=
loc_compute_frame
(
pcs
,
module
,
func
,
ip
,
&
frame
))
==
0
)
{
switch
(
loc
->
kind
)
{
...
...
@@ -2021,7 +2050,7 @@ static void dwarf2_location_compute(struct process* pcs,
}
do_compute:
/* now get the variable */
err
=
compute_location
(
&
lctx
,
loc
,
&
frame
);
err
=
compute_location
(
&
lctx
,
loc
,
pcs
->
handle
,
&
frame
);
break
;
case
loc_register
:
case
loc_regrel
:
...
...
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