public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
* Thread awareness with eCos problem
@ 2012-05-19 12:51 Stanislav Meduna
  2012-05-19 14:49 ` [OpenOCD-devel] " Paul Fertser
  0 siblings, 1 reply; 4+ messages in thread
From: Stanislav Meduna @ 2012-05-19 12:51 UTC (permalink / raw)
  To: openocd-devel; +Cc: ecos-devel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-28 15:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-19 12:51 Thread awareness with eCos problem Stanislav Meduna
2012-05-19 14:49 ` [OpenOCD-devel] " Paul Fertser
2012-05-28 15:05   ` Stanislav Meduna
2012-05-28 15:55     ` Paul Fertser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).