This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: twothreads.c-error
- From: Scott Dattalo <scott at dattalo dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Thu, 18 Jul 2002 06:33:51 -0700 (PDT)
- Subject: Re: [ECOS] twothreads.c-error
On Thu, 18 Jul 2002, arun%anwsi.com@mail3.srivari.net wrote:
> hello friends
>
> when i was executing the example program hello.c and twothreads.c
> there was some errors
What does the gdb trace look like?
I've come across several seg faults in eCos (not because of eCos, but
because of the way I'm mis-using eCos) and always have managed to catch
them with the debugger. I suggest you run the code in the debugger. When
the fault occurs, examine the call stack:
gdb> bt
bt = backtrace
This will show the sequence of calls leading up to the point of failure.
You'll probably recognize one of those calls :).
---
BTW, I'm not sure which processor you're targetting, but you may be able
to use the simulator. If you're using arm-elf-*, then the Insight debugger
can simulate the ARM processor for you. Start the debugger:
$ arm-elf-gdb your-executable
>From within Insight, select File->Target Settings. A window will pop up.
In the connection box, you'll see "Target". Click on the pulldown arrow
and select simulator.
After you've done that, you'll need to connect to the "target" and load
the code. Do this from the main Insight menu by clicking on the "Run" menu
and selecting "Connect to Target". Then "down load" the code through the
same menu.
Now you should be able to debug your code as though if it is running on a
real processor.
I've been using this simulator and the one with SID and have found them
invaluable. At this stage of my project, I'm still trying to sort out the
software so that I can make decisions about the hardware (like how much
RAM and ROM I'll need).
I hope this helps.
Scott
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss