From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Garnett To: ecos-discuss@sourceware.cygnus.com Subject: Re: [ECOS] [i386 PC platform] Problem with external GDB interrupt Date: Thu, 31 Aug 2000 04:30:00 -0000 Message-id: References: <8AE4B526B977D411841F00A0CC334020052C36@cuz-exchange.sdesigns.net> X-SW-Source: 2000-08/msg00373.html Fabrice Gautier writes: > Hi, > > When I do a external interrupt with gdb the PC is always one byte too far, > so if i do not set $pc=$pc-1 the prgram crash when restarting. > > Does the HAL_STUB_PLATFORM_STUBS_FIXUP macro is suposed to do something to > do about this ? > Yes. I suspect that this macro was added after the PC HAL was done, and it was not updated. It probably needs to look something like this: // We have to rewind the PC in case of a breakpoint. #define HAL_STUB_PLATFORM_STUBS_FIXUP() \ CYG_MACRO_START \ if (CYGNUM_HAL_VECTOR_BREAKPOINT == __get_trap_number()) \ put_register(PC, get_register(PC) - 1); \ CYG_MACRO_END Define it in i386_stub.h, since, despite its name, it is architecture rather than platform specific. -- Nick Garnett, eCos Kernel Architect Red Hat, Cambridge, UK