This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: cyg_hal_gdb_interrupt
> John Newlin <jnewlin@rawbw.com> writes:
>
> > In file:
> > packages/hal/common/current/src/hal_stub.c
> >
> > There is this wonderful function: cyg_hal_gdb_interrupt
> >
> > This function saves the current instruction, and installs a break
> > instruction. Generally this is safe, but on the Xtensa architecture
> > instructions can be on any address alignment, which will cause the load of
> > the old instruction and store of the new instruction to generate an
> > exception.
> >
> > Is there a general way to override this function, or if I made a change to
> > do a memcpy instead of load/store would you accept that back into the
> > tree?
>
> The ususal approach here is for the HAL to supply a substitute
> routine. The ARM HAL does this since it has to deal with 32 bit ARM
> breakpoints and 16 bit Thumb breakpoints, and has to decide which to
> plant at runtime.
That means anytime an architecture wants to override those functions,
there has to be a change to the common code in order to support an
architecture.
Would it be better to just put in something more generic, like:
#ifndef CYGARG_HAS_HAL_GDB_INTERRUPT
...
#endif
Instead of:
#ifndef CYGARC_HAL_ARM (or whatever it was)
#endif
Or just mark the function as a weak symbol, and let the linker sort it
out. :)
Anyhow, I submitted a patch that changed direct load/store to use the
appropriate memread/memwrite functions, which seems better anyhow
(especially since my gdb stub works now).
-john
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss