[ECOS] Re: Help enquiring thread info in ecos
rich
rich@navosha.com
Thu Oct 9 15:28:00 GMT 2003
On Thursday 09 October 2003 07:41, Gary Thomas wrote:
> Note: please copy replies to the eCos mailing list so that
> all may benefit. Private email is only available with a
> support contract.
We ran into a similar need. We wrote a very small document on the C++
interface which is what eCos is written in.
http://www.navosha.com/e_reference.html
We never got any feedback any nobody expressed any interest in this document
so it's unsupported. The C++ documentation for the interface, for the thread
especially, is NOT COMPLETE. It's also not guarenteed to remain the same.
It will give you a starting point however, but I suggest that you actually
look at the code.
kapi.cxx will give you an idea how C is used to interface C++. If you modify
the C++ classes to include new member variables you will have modify the
corresponding C structure since the two are unconnected at the code level.
For example a C++ class might look like:
class A
{
int i,
int j,
int k;
A ();
~A();
};
and a *completely seperate C struct* is used to access this, which would look
like
typedef struct
{
int i;
int j;
int k;
} class_A;
if you added a new member variable to "class A" you must add the same variable
in the same relative location in the C structure "class_A". If you don't do
this, (if memory serves) your OS will crash.
Hope that helps. If it doesn't, read the source.
> On Thu, 2003-10-09 at 08:30, Hadi Dewan wrote:
> > Hi Gary,
> > Thanks for an quick response. Right now I am just
> > using "configtool" and "ecosconfig" to create an
> > configuration file. I dont think RedBoot is hooked
> > into those tools. Following are the steps I do to
> > create ecos library and an application program.
> >
> > 1. mkdir /tmp/ecos_work
> > 2. cd ecos_work
> > 3. ecosconfig new leon
> > 4. ecosconfig tree
> > 5. make
> >
> > I have attached the configuration file with this
> > email. As you can see the GDB_STUB is faded out.
> > To compile an application. I do the following
> > sparc-elf-gcc twoThread.c -o twoThread.out
> > -L./install/lib -I./install/include -Ttarget.ld
> > -nostdlib
> >
> >
> > Using insight software I can connect to the target and
> > set breakpoint/single step. Only with "info thread" I
> > get error. If gdb is disable nothing will work. But it
> > doesnt look at way.
> >
> >
> > Please let me know if I need to compile redboot to go
> > around it. And also have a quick look at the attached
> > file using "configtool".
> > Thanks you
> > Hadi
>
> More importantly, how was the debug environment on your
> processor built? In other words, the device has something
> in FLASH/ROM - this may be RedBoot or simply GDB stubs.
> This is what has to be built with the thread support present
> since when Insight (or GDB) is talking to the target, it's
> talking to the GDB support (in RedBoot or stubs) and not
> directly to your application.
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss
mailing list