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
c5f329e6
Commit
c5f329e6
authored
Mar 13, 2011
by
Eric Pouech
Committed by
Alexandre Julliard
Mar 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbghelp: In i386 stack unwinder, ensure we always return decent 64bit values.
parent
a74c29e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
cpu_i386.c
dlls/dbghelp/cpu_i386.c
+23
-18
No files found.
dlls/dbghelp/cpu_i386.c
View file @
c5f329e6
...
...
@@ -105,7 +105,8 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO
char
ch
;
ADDRESS64
tmp
;
DWORD
p
;
WORD
val
;
WORD
val16
;
DWORD
val32
;
BOOL
do_switch
;
unsigned
deltapc
=
1
;
#ifdef __i386__
...
...
@@ -360,9 +361,9 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO
frame
->
AddrStack
.
Offset
=
frame
->
AddrFrame
.
Offset
+
2
*
sizeof
(
WORD
);
/* "pop up" previous BP value */
if
(
!
sw_read_mem
(
csw
,
sw_xlat_addr
(
csw
,
&
frame
->
AddrFrame
),
&
val
,
sizeof
(
WORD
)))
&
val
16
,
sizeof
(
WORD
)))
goto
done_err
;
frame
->
AddrFrame
.
Offset
=
val
;
frame
->
AddrFrame
.
Offset
=
val
16
;
}
else
{
...
...
@@ -394,9 +395,9 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO
#endif
frame
->
AddrStack
.
Offset
=
frame
->
AddrFrame
.
Offset
+
2
*
sizeof
(
DWORD
);
/* "pop up" previous EBP value */
if
(
!
sw_read_mem
(
csw
,
frame
->
AddrFrame
.
Offset
,
&
frame
->
AddrFrame
.
Offset
,
sizeof
(
DWORD
)))
if
(
!
sw_read_mem
(
csw
,
frame
->
AddrFrame
.
Offset
,
&
val32
,
sizeof
(
DWORD
)))
goto
done_err
;
frame
->
AddrFrame
.
Offset
=
val32
;
}
}
}
...
...
@@ -406,30 +407,30 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO
unsigned
int
i
;
p
=
sw_xlat_addr
(
csw
,
&
frame
->
AddrFrame
);
if
(
!
sw_read_mem
(
csw
,
p
+
sizeof
(
WORD
),
&
val
,
sizeof
(
WORD
)))
if
(
!
sw_read_mem
(
csw
,
p
+
sizeof
(
WORD
),
&
val
16
,
sizeof
(
WORD
)))
goto
done_err
;
frame
->
AddrReturn
.
Offset
=
val
;
frame
->
AddrReturn
.
Offset
=
val
16
;
/* get potential cs if a far call was used */
if
(
!
sw_read_mem
(
csw
,
p
+
2
*
sizeof
(
WORD
),
&
val
,
sizeof
(
WORD
)))
if
(
!
sw_read_mem
(
csw
,
p
+
2
*
sizeof
(
WORD
),
&
val
16
,
sizeof
(
WORD
)))
goto
done_err
;
if
(
frame
->
AddrFrame
.
Offset
&
1
)
frame
->
AddrReturn
.
Segment
=
val
;
/* far call assumed */
frame
->
AddrReturn
.
Segment
=
val
16
;
/* far call assumed */
else
{
/* not explicitly marked as far call,
* but check whether it could be anyway
*/
if
((
val
&
7
)
==
7
&&
val
!=
frame
->
AddrReturn
.
Segment
)
if
((
val
16
&
7
)
==
7
&&
val16
!=
frame
->
AddrReturn
.
Segment
)
{
LDT_ENTRY
le
;
if
(
GetThreadSelectorEntry
(
csw
->
hThread
,
val
,
&
le
)
&&
if
(
GetThreadSelectorEntry
(
csw
->
hThread
,
val
16
,
&
le
)
&&
(
le
.
HighWord
.
Bits
.
Type
&
0x08
))
/* code segment */
{
/* it is very uncommon to push a code segment cs as
* a parameter, so this should work in most cases
*/
frame
->
AddrReturn
.
Segment
=
val
;
frame
->
AddrReturn
.
Segment
=
val
16
;
}
}
}
...
...
@@ -440,21 +441,25 @@ static BOOL i386_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CO
*/
for
(
i
=
0
;
i
<
sizeof
(
frame
->
Params
)
/
sizeof
(
frame
->
Params
[
0
]);
i
++
)
{
sw_read_mem
(
csw
,
p
+
(
2
+
i
)
*
sizeof
(
WORD
),
&
val
,
sizeof
(
val
));
frame
->
Params
[
i
]
=
val
;
sw_read_mem
(
csw
,
p
+
(
2
+
i
)
*
sizeof
(
WORD
),
&
val
16
,
sizeof
(
val16
));
frame
->
Params
[
i
]
=
val
16
;
}
}
else
{
if
(
!
sw_read_mem
(
csw
,
frame
->
AddrFrame
.
Offset
+
sizeof
(
DWORD
),
&
frame
->
AddrReturn
.
Offset
,
sizeof
(
DWORD
)))
unsigned
int
i
;
if
(
!
sw_read_mem
(
csw
,
frame
->
AddrFrame
.
Offset
+
sizeof
(
DWORD
),
&
val32
,
sizeof
(
DWORD
)))
{
WARN
(
"Cannot read new frame offset %p
\n
"
,
(
void
*
)(
DWORD_PTR
)(
frame
->
AddrFrame
.
Offset
+
(
int
)
sizeof
(
DWORD
)));
goto
done_err
;
}
sw_read_mem
(
csw
,
frame
->
AddrFrame
.
Offset
+
2
*
sizeof
(
DWORD
),
frame
->
Params
,
sizeof
(
frame
->
Params
));
frame
->
AddrReturn
.
Offset
=
val32
;
for
(
i
=
0
;
i
<
sizeof
(
frame
->
Params
)
/
sizeof
(
frame
->
Params
[
0
]);
i
++
)
{
sw_read_mem
(
csw
,
frame
->
AddrFrame
.
Offset
+
(
2
+
i
)
*
sizeof
(
DWORD
),
&
val32
,
sizeof
(
val32
));
frame
->
Params
[
i
]
=
val32
;
}
}
#ifdef __i386__
if
(
context
)
...
...
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