Mail Archives: djgpp-workers/2004/10/28/14:15:10
On Wednesday 27 October 2004 19:43, DJ Delorie wrote:
> Can we put it as an input operand of that big asm? We don't have to
> use it, just add it.
>
> asm("
> ...
> " : "g" (forced_test));
Unfortunatelly it doesn't work. Both gcc-3.4.2 and gcc-4.0.0 20041014 rejects
extended inline assembler outside the procedures.
> Of course, it's starting to look like a big chunk of dbgcom.c should
> be moved to a separate assembler file.
Maybe.
So at this moment I suggest the following fix:
renaming forced_test to __dj_forced_test
and making it external
Andris
Index: djgpp/src/debug/common/dbgcom.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/debug/common/dbgcom.c,v
retrieving revision 1.25
diff -p -3 -r1.25 dbgcom.c
*** djgpp/src/debug/common/dbgcom.c 27 Oct 2004 15:47:23 -0000 1.25
--- djgpp/src/debug/common/dbgcom.c 28 Oct 2004 18:10:28 -0000
*************** static void hook_dpmi(void)
*** 340,346 ****
__djgpp_app_DS = app_ds;
}
! /* The instructions in forced_test[] MUST MATCH the expansion of:
EXCEPTION_ENTRY($13)
EXCEPTION_ENTRY($14)
--- 340,346 ----
__djgpp_app_DS = app_ds;
}
! /* The instructions in __dj_forced_test[] MUST MATCH the expansion of:
EXCEPTION_ENTRY($13)
EXCEPTION_ENTRY($14)
*************** static void hook_dpmi(void)
*** 362,368 ****
the time. So most DPMI servers don't support it, and our code will
never be called if we tie it to exception 17. In contrast, exception
13 is GPF, and *any* DPMI server will support that! */
! static unsigned char forced_test[] = {
0x6a,0x0d, /* pushl $0x0d */
0xeb,0x10, /* jmp relative +0x10 */
0x6a,0x0e, /* pushl $0x0e */
--- 362,368 ----
the time. So most DPMI servers don't support it, and our code will
never be called if we tie it to exception 17. In contrast, exception
13 is GPF, and *any* DPMI server will support that! */
! unsigned char __dj_forced_test[] = {
0x6a,0x0d, /* pushl $0x0d */
0xeb,0x10, /* jmp relative +0x10 */
0x6a,0x0e, /* pushl $0x0e */
*************** static unsigned char forced_test[] = {
*** 378,384 ****
0x2e,0x80,0x3d /* (beginning of) %cs:cmpb $0,forced */
}; /* four next bytes contain the address of the `forced' variable */
! static int forced_test_size = sizeof (forced_test);
static int forced_address_known = 0;
static unsigned int forced_address = 0;
--- 378,384 ----
0x2e,0x80,0x3d /* (beginning of) %cs:cmpb $0,forced */
}; /* four next bytes contain the address of the `forced' variable */
! static int forced_test_size = sizeof (__dj_forced_test);
static int forced_address_known = 0;
static unsigned int forced_address = 0;
*************** _change_exception_handler:
*** 417,423 ****
cld \n\
movw %cx,%es \n\
movl %edx,%edi \n\
! movl $_forced_test,%esi \n\
movl _forced_test_size,%ecx \n\
repe \n\
cmpsb \n\
--- 417,423 ----
cld \n\
movw %cx,%es \n\
movl %edx,%edi \n\
! movl $___dj_forced_test,%esi \n\
movl _forced_test_size,%ecx \n\
repe \n\
cmpsb \n\
*************** void cleanup_client(void)
*** 1492,1498 ****
/* Invalidate the info about the `forced' variable. */
forced_address_known = 0;
forced_address = 0;
! forced_test_size = sizeof (forced_test); /* pacify the compiler */
/* Set the flag, that the user interrupt vectors are no longer valid */
user_int_set = 0;
--- 1492,1498 ----
/* Invalidate the info about the `forced' variable. */
forced_address_known = 0;
forced_address = 0;
! forced_test_size = sizeof (__dj_forced_test); /* pacify the compiler */
/* Set the flag, that the user interrupt vectors are no longer valid */
user_int_set = 0;
- Raw text -