This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: GDB Source Listing


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]