Skip to content
Snippets Groups Projects
Commit 1a5e22f5 authored by Alexandre Julliard's avatar Alexandre Julliard
Browse files

Set debugging option based on NO_TRACE_MSGS define. Only output 32-bit

relay stubs if debugging is on.
parent c77cbbcd
Branches
Tags
No related merge requests found
......@@ -418,6 +418,7 @@ void RELAY_SetupDLL( const char *module )
int on = 1;
if (!debug->call) continue; /* not a normal function */
if (debug->call != 0xe8 && debug->call != 0xe9) break; /* not a debug thunk at all */
if ((name = find_exported_name( module, exports, i + exports->Base )))
{
......
......@@ -28,10 +28,16 @@ int DLLHeapSize = 0;
int UsePIC = 0;
int nb_entry_points = 0;
int nb_names = 0;
int debugging = 1;
int nb_debug_channels = 0;
int nb_lib_paths = 0;
/* we only support relay debugging on i386 */
#if defined(__i386__) && !defined(NO_TRACE_MSGS)
int debugging = 1;
#else
int debugging = 0;
#endif
char DLLName[80];
char DLLFileName[80];
char DLLInitFunc[80];
......
......@@ -136,16 +136,17 @@ static void output_exports( FILE *outfile, int nr_exports, int fwd_size )
}
fprintf( outfile, " } exp;\n" );
#ifdef __i386__
fprintf( outfile, " struct {\n" );
fprintf( outfile, " unsigned char jmp;\n" );
fprintf( outfile, " unsigned char addr[4];\n" );
fprintf( outfile, " unsigned char ret;\n" );
fprintf( outfile, " unsigned short args;\n" );
fprintf( outfile, " func_ptr orig;\n" );
fprintf( outfile, " unsigned int argtypes;\n" );
fprintf( outfile, " } relay[%d];\n", nr_exports );
#endif /* __i386__ */
if (debugging)
{
fprintf( outfile, " struct {\n" );
fprintf( outfile, " unsigned char jmp;\n" );
fprintf( outfile, " unsigned char addr[4];\n" );
fprintf( outfile, " unsigned char ret;\n" );
fprintf( outfile, " unsigned short args;\n" );
fprintf( outfile, " func_ptr orig;\n" );
fprintf( outfile, " unsigned int argtypes;\n" );
fprintf( outfile, " } relay[%d];\n", nr_exports );
}
fprintf( outfile, "} exports = {\n {\n" );
fprintf( outfile, " 0,\n" ); /* Characteristics */
......@@ -248,57 +249,58 @@ static void output_exports( FILE *outfile, int nr_exports, int fwd_size )
/* output relays */
#ifdef __i386__
fprintf( outfile, " },\n {\n" );
for (i = Base; i <= Limit; i++)
if (debugging)
{
ORDDEF *odp = Ordinals[i];
unsigned int j, mask = 0;
/* skip non-existent entry points */
if (!odp) goto ignore;
/* skip non-functions */
if ((odp->type != TYPE_STDCALL) &&
(odp->type != TYPE_CDECL) &&
(odp->type != TYPE_REGISTER)) goto ignore;
/* skip norelay entry points */
if (odp->flags & FLAG_NORELAY) goto ignore;
for (j = 0; odp->u.func.arg_types[j]; j++)
fprintf( outfile, " },\n {\n" );
for (i = Base; i <= Limit; i++)
{
if (odp->u.func.arg_types[j] == 't') mask |= 1<< (j*2);
if (odp->u.func.arg_types[j] == 'W') mask |= 2<< (j*2);
}
if ((odp->flags & FLAG_RET64) && (j < 16)) mask |= 0x80000000;
ORDDEF *odp = Ordinals[i];
unsigned int j, mask = 0;
/* skip non-existent entry points */
if (!odp) goto ignore;
/* skip non-functions */
if ((odp->type != TYPE_STDCALL) &&
(odp->type != TYPE_CDECL) &&
(odp->type != TYPE_REGISTER)) goto ignore;
/* skip norelay entry points */
if (odp->flags & FLAG_NORELAY) goto ignore;
for (j = 0; odp->u.func.arg_types[j]; j++)
{
if (odp->u.func.arg_types[j] == 't') mask |= 1<< (j*2);
if (odp->u.func.arg_types[j] == 'W') mask |= 2<< (j*2);
}
if ((odp->flags & FLAG_RET64) && (j < 16)) mask |= 0x80000000;
switch(odp->type)
{
case TYPE_STDCALL:
fprintf( outfile, " { 0xe9, { 0,0,0,0 }, 0xc2, 0x%04x, %s, 0x%08x }",
strlen(odp->u.func.arg_types) * sizeof(int),
odp->u.func.link_name, mask );
break;
case TYPE_CDECL:
fprintf( outfile, " { 0xe9, { 0,0,0,0 }, 0xc3, 0x%04x, %s, 0x%08x }",
strlen(odp->u.func.arg_types) * sizeof(int),
odp->u.func.link_name, mask );
break;
case TYPE_REGISTER:
fprintf( outfile, " { 0xe9, { 0,0,0,0 }, 0xc3, 0x%04x, %s, 0x%08x }",
0x8000 | (strlen(odp->u.func.arg_types) * sizeof(int)),
make_internal_name( odp, "regs" ), mask );
break;
default:
assert(0);
}
goto done;
switch(odp->type)
{
case TYPE_STDCALL:
fprintf( outfile, " { 0xe9, { 0,0,0,0 }, 0xc2, 0x%04x, %s, 0x%08x }",
strlen(odp->u.func.arg_types) * sizeof(int),
odp->u.func.link_name, mask );
break;
case TYPE_CDECL:
fprintf( outfile, " { 0xe9, { 0,0,0,0 }, 0xc3, 0x%04x, %s, 0x%08x }",
strlen(odp->u.func.arg_types) * sizeof(int),
odp->u.func.link_name, mask );
break;
case TYPE_REGISTER:
fprintf( outfile, " { 0xe9, { 0,0,0,0 }, 0xc3, 0x%04x, %s, 0x%08x }",
0x8000 | (strlen(odp->u.func.arg_types) * sizeof(int)),
make_internal_name( odp, "regs" ), mask );
break;
default:
assert(0);
}
goto done;
ignore:
fprintf( outfile, " { 0, { 0,0,0,0 }, 0, 0, 0, 0 }" );
done:
if (i < Limit) fprintf( outfile, ",\n" );
ignore:
fprintf( outfile, " { 0, { 0,0,0,0 }, 0, 0, 0, 0 }" );
done:
if (i < Limit) fprintf( outfile, ",\n" );
}
}
#endif /* __i386__ */
fprintf( outfile, " }\n};\n\n" );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment