[ECOS] Re: Evaluator 7T: using syscalls with RedBoot

Pierre Habraken Pierre.Habraken@imag.fr
Fri Mar 7 13:07:00 GMT 2003


I apologize for my previous groundless questions to both newlib and ecos
lists: just before I received Mark's last reply I discovered by reading
eCos sources that SIGTRAP is the normal way to notify gdb that the
remote program has finished its execution.

In fact, my silly questions come mainly from both facts that (1) I do
not have yet enough knowledge of gdb behavior (especially as regards
interaction between host part and remote target), (2) my goal is not to
build a true embedded application (why would an embedded program
terminate ?!), but to set up a (Gnu/open source) teaching
tool/environment (for first level undergraduate students) as easy to use
as possible...

Thanks again to everybody for your help and your patience.

Pierre


Mark Salter wrote:
> 
> >>>>> Pierre Habraken writes:
> 
> > Hello,
> > I have some trouble in getting a newlib based program working together
> > with redboot on an Arm Evaluator7T board.
> > I am using newlib 1.11.0 on a linux box running RH 7.3.
> > I re-built redboot (from eCos cvs repository) configured according to
> > Mark Salter's advice (added CYGSEM_REDBOOT_BSP_SYSCALLS to
> > redboot_ROM.ecm).
> > The program I am working on is compiled with arm-elf-gcc 3.2.2. It is
> > linked with option -specs=redboot.specs. It can be uploaded to the board
> > by gdb and then started by issuing a cont command.
> > The program does its job as expected, and afterwards, at some point, its
> > main function terminates, making crt0.S to call exit(). But then a
> > sigtrap is raised:
> > ==================================================================
> > Program received signal SIGTRAP, Trace/breakpoint trap.
> > 0x000101bc in _exit (stat=1)
> >     at ../../../../../newlib-1.11.0/libgloss/arm/redboot-syscalls.c:54
> > 54              __syscall(SYS_exit, stat);
> > ==================================================================
> > Could it be a newlib configuration problem ?
> 
> No. This is expected behavior.
> 
> > How can I have the execution control to be given back smoothly to gdb ?
> 
> Does GDB not have control at this point? The decision was made to trap
> on exit because that usually indicates a problem for an embedded app.
> In any case, when the program stops at exit, you can use the gdb 'kill'
> command to release the target and get back to RedBoot. You could also
> reissue the 'load' command and restart the program.
> 
> > What about other syscalls ?
> 
> What about them? For the definitive list of syscalls, look in
> libgloss/arm/redboot-syscalls.c.
> 
> --Mark

-- 
________________________________________________________________________
Pierre HABRAKEN - mailto:Pierre.Habraken@imag.fr
Tél: 04 76 82 72 83 - Fax: 04 76 82 72 87
IMAG-LSR BP72 38402 SAINT MARTIN D'HERES Cedex
________________________________________________________________________

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



More information about the Ecos-discuss mailing list