This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [i386 PC platform] Problem with external GDB interrupt


Fabrice Gautier <Fabrice_Gautier@sdesigns.com> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]