eCos Product
RedBoot Product
Supported Hardware |
![]() TODOThis is a list of things that should eventually be covered by the porting guide. Constructorstypedef void (*pfunc) (void) extern pfunc __CTOR_LIST__[]; extern pfunc __CTOR_END__[]; void cyg_invoque_constructors(void) { pfunc *p; for (p=&__CTOR_END__[-1];p >= __CTOR_LIST__;p--) (*p) (); } The two symbols are the limits of an array of pointers to constructors. The pointers in this array get sorted (see linker script) according to their priority. We add the brackets in the C code to make the compiler treat the symbols as array references -- type information only exists in the compiler; in the linker a symbols is just named entity associated with an address. The code above iterates through the array from the top to the bottom (end-1 to start), calling each constructor in turn. > How do I tell gcc which constructor priority to use? There's a compiler attribute for that: #if defined(__cplusplus) && defined(__GNUC__) # define CYGBLD_ATTRIB_INIT_PRI( _pri_ ) __attribute__((init_priority(_pri_))) #else // FIXME: should maybe just bomb out if this is attempted anywhere else? // Not sure # define CYGBLD_ATTRIB_INIT_PRI( _pri_ ) #endif This is used a few places in the eCos code to control in which order various constructors get run. Grep for CYGBLD_ATTRIB_INIT_PRI in the sources. Using ser_filter for serial IO monitoringGary> On 19-Feb-2001 Rafael Rodríguez Velilla wrote: >> Has anyone got a program to spy the serial device transparently in >> order to see the dialog of GDB and my target's stub. I just want to >> see what's traveling along my serial conecction. >> Gary> You can get this information from GDB itself. (gdb) set Gary> remotedebug 1 Unfortunately that doesn't always work. Any non-protocol data gets binned by some GDBs - it's not consistent in this regard across architectures. Instead I suggest using the ser_filter for which sources are available from the CVS repository in the host directory. You should be able to rebuild it for Linux by invoking make in the host/tools/ecostest/unix directory. For Windows I believe there are some MSVC build files somewhere. When you have ser_filter built you can do something like: $ ser_filter -m 9999 /dev/ttyS0 38400 And then connect to the target like this: (gdb) ta re localhost:9999 When you do, the ser_filter should dump all the traffic out on the console. |