This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: RedBoot+GDB+application combo question
- From: Stephan Eisvogel <eisvogsn at iis dot fhg dot de>
- To: Savin Zlobec <savin dot zlobec at email dot si>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Fri, 20 Feb 2004 20:43:50 +0100
- Subject: [ECOS] Re: RedBoot+GDB+application combo question
- Organization: FhG-IIS CCNAT
- References: <20040220190214.C40808B746@www.email.si>
Savin Zlobec wrote:
> Is there any reason why 'dbtrap' instruction can't be used for breakpoints ?
It is a 32-bit instruction, which would mean that by putting a break on
the first of two successive 16-bit instructions, the second would get
corrupted by that dbtrap's second 16 bits. If this is the only BP, you
could envision a case where -provided you take no overly excessive read
impossible precautions during runtime- a jump from anywhere could target
this second, now temporarily overwritten, instruction. Oops...
I did a lot of research for this processor looking for ways to make GDB
debugging possible, "br *" and a periodic (10-30 Hz) NMI pulse were the
only option I could come up with that looked promising. Since we do many
many designs for this processor still, we at least have the hardware to
debug this kind of stuff.
> Do you have any thoughts against putting GDB stubs into RedBoot ?
Personally I think what is gained in bytes of code space is weighed up
by the complexity of debugging TWO separate pieces of binaries. Right now
I'm chasing compiler bugs within v850-elf-gcc (3.4-20040128), 5 down and
I keep thinking 10.000 more to go. E.g. -O0 works, everything else (-O,
-Os, -O2...) introduces corrupt register contents somewhere in printf().
I *did* try the stable releases down to around 3.2, same story there.
> If you start the timer which you use for breakpoint support at RedBoot
> startup it will of course bring some overhead also if you don't do any
> debugging - this can be avoided by starting it the first time breakpoint()
> is called (i.e. starting GDB stubs).
No, I only kick off the timer if RedBoot is about to call the trampoline
when GDB is to be started. Everything else results in lost characters in
RedBoot b/c the GDB stub swallows them, checking for valid input.
Had lots of d'ohs this week. ;)
Stephan
--
-------------------------------------------------------------------------
Stephan Eisvogel
Fraunhofer-Institut für Integrierte Schaltungen, Net Access Technology
Nordostpark 93, D-90411 Nürnberg, Germany
Phone: +49 911 5806-211 Fax: -299 E-Mail: eisvogsn@iis.fhg.de
-------------------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss