[ECOS] Redboot GDB stubs for non-ecos application

Mark Salter msalter@redhat.com
Tue May 18 17:03:00 GMT 2004


>>>>> John Newlin writes:

> I'm working on getting GDB stubs working for a non-ecos application, and
> trying to figure out how to make this work.

> It looks as if the applicaiton needs to enable interrupts, at least for
> the serial port, so that control-c work.  Possibly for Ethernet for same
> reason, but I'll deal with that later.

RedBoot should have the necessary interrupts setup for ctl-C to work
except that the architecture's global interrupt mask will be set. The
non-ecos application will only need to unmask the top-level interrupt.
i.e. on arm, this is done in the crt0.o:

	/* Enable interrupts for gdb debugging.  */
	mrs    r0, cpsr
	bic    r0, r0, #0xC0
	msr    cpsr, r0
   
> Does Redboot put breakpoint instructions at the vectors, so the
> application can load it's own vectors, or does the application need to use
> the same VSR table that redboot/ecos use?

> If Redboot puts the break instructions on the vectors, when the
> application exits, does redboot rewrite those vectors, or I guess it
> doesn't really need them since it's running with interrupts off?

The RedBoot stubs rely on having control of the vectors so that it
can take control when, say, an illegal insn is encountered. Generally,
the application can take over any vector it wants, but it may take
away some gdb-stub functionality if it does so.

> If someone has an example of how another Architecture does this and I
> could look at that.

You can look at newlib+libgloss to see how RedBoot is supported. 
ARM would be just one example architecture.

--Mark




-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list