This is the mail archive of the ecos-discuss@sourceware.org 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]
Other format: [Raw text]

Re: Static constructors List


On Mon, Jan 22, 2007 at 06:05:17AM +0000, tejas pawaskar wrote:
> Hello 
> 
> I am building redboot for an intel's xscale pxa270
> based  board. I am using pxa270's FFUART for serial
> output configured at 115200-8-N-1. 
> 
> My problem is that the code gets stuck at the point
> where from vector.s calls function
> cyg_hal_invoke_constructors.
> 
> The function is in hal/arm/arch/current/src/hal_misc.c
> void
> cyg_hal_invoke_constructors (void)
> {
> #ifdef CYGSEM_HAL_STOP_CONSTRUCTORS_ON_FLAG
>     static pfunc *p = &__CTOR_END__[-1];
>     
>     cyg_hal_stop_constructors = 0;
>     for (; p >= __CTOR_LIST__; p--) {
>         (*p) ();
>         if (cyg_hal_stop_constructors) {
>             p--;
>             break;
>         }
>     }
> #else
>     pfunc *p;
> 
>     for (p = &__CTOR_END__[-1]; p >= __CTOR_LIST__;
> p--)
>         (*p) ();
> #endif
> }
> 
> >From the above code i can understand that it is
> calling various functions starting from __CTOR_END[-1]
> upto __CTOR_LIST__, and my code gets stuck in one of
> the fucntions called.
> 
> How do i find out in which function it is getting
> stucked? Where is the __CTOR_LIST__ located so that i
> can come to know about the functions it is supposed to
> call?

Do you have the elf for the redboot you are currently running?  You
can use gdb to analyse the image statically, ie when not actually
running on the target.

So you can do things like

print __CTOR_END__[-1]
x &__CTOR_END__[-1]

etc, so you can see the address of the first function called. 
You can then do

x 0x1234421 

and it will tell you what symbol, is function is at address 0x1234421
etc.

You can then go backwards through the list and find out which is
suspect. Maybe one is NULL?
 
> Also what are the necessary configuration settings
> need to be done using the  configtool to run redboot?

There is documentation about how to build redboot in the redboot
manual. Take a look at ecos.sourceware.org.

        Andrew

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


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