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
07f736bc
Commit
07f736bc
authored
Nov 04, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hack to detect register functions automatically so that relay debug
also works for functions using the DEFINE_REGS_ENTRY_POINT macros.
parent
d427f731
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
relay386.c
relay32/relay386.c
+22
-2
spec32.c
tools/winebuild/spec32.c
+3
-7
No files found.
relay32/relay386.c
View file @
07f736bc
...
...
@@ -463,7 +463,7 @@ void WINAPI RELAY_DoCallFrom32Regs( CONTEXT86 *context )
BYTE
*
relay_addr
=
*
((
BYTE
**
)
context
->
Esp
-
1
);
DEBUG_ENTRY_POINT
*
relay
=
(
DEBUG_ENTRY_POINT
*
)(
relay_addr
-
5
);
WORD
nb_args
=
(
relay
->
args
&
~
0x8000
)
/
sizeof
(
int
);
WORD
nb_args
=
relay
->
args
/
sizeof
(
int
);
/* remove extra stuff from the stack */
context
->
Eip
=
stack32_pop
(
context
);
...
...
@@ -523,6 +523,26 @@ __ASM_GLOBAL_FUNC( RELAY_CallFrom32Regs,
"call "
__ASM_NAME
(
"__wine_call_from_32_regs"
)
"
\n\t
"
".long "
__ASM_NAME
(
"RELAY_DoCallFrom32Regs"
)
",0"
);
/* check whether the function at addr starts with a call to __wine_call_from_32_regs */
static
BOOL
is_register_entry_point
(
const
BYTE
*
addr
)
{
extern
void
__wine_call_from_32_regs
();
int
*
offset
;
void
*
ptr
;
if
(
*
addr
!=
0xe8
)
return
FALSE
;
/* not a call */
/* check if call target is __wine_call_from_32_regs */
offset
=
(
int
*
)(
addr
+
1
);
if
(
*
offset
==
(
char
*
)
__wine_call_from_32_regs
-
(
char
*
)(
offset
+
1
))
return
TRUE
;
/* now check if call target is an import table jump to __wine_call_from_32_regs */
addr
=
(
BYTE
*
)(
offset
+
1
)
+
*
offset
;
if
(
addr
[
0
]
!=
0xff
||
addr
[
1
]
!=
0x25
)
return
FALSE
;
/* not an indirect jmp */
ptr
=
*
(
void
**
)(
addr
+
2
);
/* get indirect jmp target address */
return
(
*
(
char
**
)
ptr
==
(
char
*
)
__wine_call_from_32_regs
);
}
/***********************************************************************
* RELAY_SetupDLL
*
...
...
@@ -560,7 +580,7 @@ void RELAY_SetupDLL( const char *module )
if
(
on
)
{
debug
->
call
=
0xe8
;
/* call relative */
if
(
debug
->
args
&
0x8000
)
/* register func */
if
(
is_register_entry_point
(
debug
->
orig
))
debug
->
callfrom32
=
(
char
*
)
RELAY_CallFrom32Regs
-
(
char
*
)
&
debug
->
ret
;
else
debug
->
callfrom32
=
(
char
*
)
RELAY_CallFrom32
-
(
char
*
)
&
debug
->
ret
;
...
...
tools/winebuild/spec32.c
View file @
07f736bc
...
...
@@ -271,23 +271,19 @@ static int output_exports( FILE *outfile, int nr_exports )
name
=
odp
->
link_name
;
args
=
strlen
(
odp
->
u
.
func
.
arg_types
)
*
sizeof
(
int
);
if
(
odp
->
flags
&
FLAG_REGISTER
)
{
name
=
make_internal_name
(
odp
,
"regs"
);
args
|=
0x8000
;
}
if
(
odp
->
flags
&
FLAG_REGISTER
)
name
=
make_internal_name
(
odp
,
"regs"
);
switch
(
odp
->
type
)
{
case
TYPE_STDCALL
:
fprintf
(
outfile
,
"
\"\\
tjmp "
__ASM_NAME
(
"%s"
)
"
\\
n
\"\n
"
,
name
);
fprintf
(
outfile
,
"
\"\\
tret $
0x%04x
\\
n
\"\n
"
,
args
);
fprintf
(
outfile
,
"
\"\\
tret $
%d
\\
n
\"\n
"
,
args
);
fprintf
(
outfile
,
"
\"\\
t.long "
__ASM_NAME
(
"%s"
)
",0x%08x
\\
n
\"\n
"
,
name
,
mask
);
break
;
case
TYPE_CDECL
:
fprintf
(
outfile
,
"
\"\\
tjmp "
__ASM_NAME
(
"%s"
)
"
\\
n
\"\n
"
,
name
);
fprintf
(
outfile
,
"
\"\\
tret
\\
n
\"\n
"
);
fprintf
(
outfile
,
"
\"\\
t.short
0x%04x
\\
n
\"\n
"
,
args
);
fprintf
(
outfile
,
"
\"\\
t.short
%d
\\
n
\"\n
"
,
args
);
fprintf
(
outfile
,
"
\"\\
t.long "
__ASM_NAME
(
"%s"
)
",0x%08x
\\
n
\"\n
"
,
name
,
mask
);
break
;
default:
...
...
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