This is the mail archive of the ecos-devel@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]

Thread awareness with eCos problem


Hi everybody,

I'm afraid the current method of thread awareness for eCos
cannot reliably work as implemented.

The eCos_params_list in src/rtos/eCos.c contains fixed
offsets for a few fields.

const struct eCos_params eCos_params_list[] = {
{
  "cortex_m3",  /* target_name */
  4,            /* pointer_width; */
  0x0c,         /* thread_stack_offset; */
  0x9c,         /* thread_name_offset; */
  0x3c,         /* thread_state_offset; */
  0xa0,         /* thread_next_offset */
  0x4c,         /* thread_uniqueid_offset */
  &rtos_eCos_Cortex_M3_stacking /* stacking_info */
  }
};

However, eCos is extensively configurable and the definition
of the thread structure has quite a few of #ifdefs that enable
or disable various structure members.

I am not really an expert in OpenOCD internals - I just
looked into the source trying to find why it does not work for me.
I am not sure the following proposal is possible (it depends
on what symbols the OpenOCD has an access to), but
I'd say the correct way to implement the thread awareness
would be to dynamically determine the offsets. I.e.
to make an equivalent of

(gdb) p /x
  (char *) &(Cyg_Scheduler_Base::current_thread[0]->unique_id) -
  (char *)   Cyg_Scheduler_Base::current_thread[0]
$21 = 0x58

In case this is not possible there has to be a way to specify
the offsets from a configuration file.

Best regards and thanks for a great software

-- 
                                       Stano


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