This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: GDB Source Listing
- To: <tadams at extremeeng dot com>
- Subject: RE: [ECOS] GDB Source Listing
- From: rob dot wj dot jansen at philips dot com
- Date: Wed, 13 Jun 2001 09:28:23 +0200
- Cc: <ecos-discuss at sourceware dot cygnus dot com>, <jlarmour at redhat dot com>
Trenton,
> But I've never had this problem with GDB before! I used GDB a fair bit
> while in school, and it always displayed my source code perfectly. Is
> it just happening with the GDB compiled for each embedded system?
The serial.c program you compiled does not contain a main() but a cyg_start() function instead.
The "System start-up" section in the eCos Reference Manual explains more about cyg_start(),
cyg_prestart() and cyg_user_start().
The main() function you see in GDB is the default one from language/c/libc/startup/current/src/main.cxx
and it is defined with the "__attribute__((weak))" defined. If you define your own main() it will replace the
weak bound one defined in libc.
Per default GDB will break (and show) the main() function, you could replace this with cyg_user_start()
instead. I defined in the .gdbinit file a macro that loads my program, sets a breakpoint on my
cyg_user_start() and then runs it.
Again, try to debug the eCos startup code. I really learned a lot from that excercise :-)
Regards,
Rob Jansen
Software Engineer
Competence Center Platforms
BU Mobile Communications
Meijhorst 60-10, 6537 KT Nijmegen, The Netherlands
Tel: +31-24-353-6329
Fax: +31-24-353-3613
mailto:Rob.WJ.Jansen@philips.com