<div dir="ltr">Hi,<div><br></div><div>It looks like the context has already changed by the time the thread_exitted extension is called, so RTEMS_SELF does not get what you want.</div><div><br></div><div>The rtems_tcb structure however contains 'Object->id' and 'Object->name' which show the previous task running.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 2 March 2018 at 06:39, Christian Mauderer <span dir="ltr"><<a href="mailto:christian.mauderer@embedded-brains.de" target="_blank">christian.mauderer@embedded-brains.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Am 02.03.2018 um 02:59 schrieb Joel Sherrill:<br>
><br>
><br>
> On Mar 1, 2018 11:03 AM, "Matthew J Fletcher" <<a href="mailto:amimjf@gmail.com">amimjf@gmail.com</a><br>
</span><span class="">> <mailto:<a href="mailto:amimjf@gmail.com">amimjf@gmail.com</a>>> wrote:<br>
><br>
>     Hi,<br>
><br>
>     So if a thread returns without deleting itself you get the following<br>
>     error,.. but may i make the observation that it might be more<br>
>     helpful print the rtems_name of said thread ?<br>
><br>
>     *** FATAL ***<br>
>     fatal source: 0 (INTERNAL_ERROR_CORE)<br>
>     fatal code: 5 (INTERNAL_ERROR_THREAD_<wbr>EXITTED)<br>
>     RTEMS version: 5.0.0<br>
>     RTEMS tools: 7.2.1 20171120 [gcc-7-branch revision<br>
>     9785e4dda79:9e029c9094e:<wbr>b2ec65b6e88dcbf61ac59114605113<wbr>e1136f2ac5]<br>
><br>
><br>
> Please file a ticket. There may be more cases where an id and name are<br>
> useful. <br>
><br>
><br>
<br>
</span>Hello Matthew,<br>
<br>
if you need some quick solution: This should be possible with a user<br>
thread extension. Without testing, it should be something like the<br>
following:<br>
<br>
----<br>
static void thread_exitted_print_info(<wbr>rtems_tcb *tcb)<br>
{<br>
  char name[5];<br>
  char *rv;<br>
<br>
  rv = rtems_object_get_name(RTEMS_<wbr>SELF, sizeof(name), name);<br>
<br>
  if (rv) {<br>
    printk("Thread exited: %s\n", rv);<br>
  } else {<br>
    printk("Thread exited but couldn't get name.\n");<br>
  }<br>
}<br>
<br>
/* In your configuration: */<br>
#define CONFIGURE_INITIAL_EXTENSIONS \<br>
  { .thread_exited = thread_exitted_print_info }<br>
----<br>
<br>
Regards<br>
<br>
Christian<br>
<br>
--<br>
------------------------------<wbr>--------------<br>
embedded brains GmbH<br>
Herr Christian Mauderer<br>
Dornierstr. 4<br>
D-82178 Puchheim<br>
Germany<br>
email: <a href="mailto:christian.mauderer@embedded-brains.de">christian.mauderer@embedded-<wbr>brains.de</a><br>
Phone: <a href="tel:%2B49-89-18%2094%20741%20-%2018" value="+4989189474118">+49-89-18 94 741 - 18</a><br>
Fax:   <a href="tel:%2B49-89-18%2094%20741%20-%2008" value="+4989189474108">+49-89-18 94 741 - 08</a><br>
PGP: Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div><br>regards</div><div>---</div><div>Matthew J Fletcher</div><br></div>
</div>