This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Error modifiying Cyg_Thread class...
- To: ecos-discuss at sourceware dot cygnus dot com
- Subject: [ECOS] Error modifiying Cyg_Thread class...
- From: Cristiano Ligieri Pereira <cpereira at ics dot uci dot edu>
- Date: Sat, 7 Jul 2001 09:26:36 -0700 (PDT)
Hi all,
I was trying to add an extra field to the class Cyg_Thread (file
thread.cxx) and was getting a strange behavior. The field is a cyg_uint16
and I was adding it to the end of the class definition, right after the
get_unique_id() method. In addition to the variable itself, I was also
adding two accessing functions, one to set and another to get the value of
this variable (something very simple :-)).
After recompiling the code and testing I've noticed that the value I was
setting wasn't being held and when issuing the "get" I was getting a
different value. After struggling for a few hours I changed the variable
definition to the beginning of the class, right after the definition of
the variable unique_id, and everything started working fine.
Can someone explain me why is that?
Sounds like some alignment problem, but it is not clear to me why exactly
it wasn't working...
Thanks,
Cristiano.
------------------------------------------------------------
Cristiano Ligieri Pereira - http://www.ics.uci.edu/~cpereira