Debugging an RTEMS Application, show threads in gdb possible

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Nov 15 10:10:17 UTC 2012


On 11/14/2012 11:27 AM, Matthias Goldhoorn wrote:
> On 12.11.2012 12:29, Sebastian Huber wrote:
>> Hello,
>>
>> I cannot say much to the GDB support since I mainly use the Lauterbach
>> debugger, but there is some GDB support mentioned here:
>>
>> http://www.rtems.org/wiki/index.php/GDB_Python
>>
>> You can also start the RTEMS shell and use the "task", "sema", "cpuuse", etc.
>> commands to figure out the system state.
>>
> Hi Again,
> i got these scripts running.
> I got output like:
>
> (gdb) rtems_posix_threads
> =====================================================================
> # | Name | ID | Pri | Nsecs | State
> ---+------+----------+-----+--------------+------------------------------
> 1 | | 0b010001 | 253 | 921902273 | DELAY
> 2 | | 0b010002 | 253 | 23244932 | DORM Wbuf
> 3 | | 0b010003 | 253 | 848975 | Wcvar
> 4 | | 0b010004 | 253 | 475098 | Wsem
> 5 | | 0b010005 | 253 | 10752105 | DELAY
> 6 | | 0b010006 | 253 | 717069 | Wsem
> 7 | | 0b010007 | 254 | 768276 | Wcvar
> 8 | | 0b010008 | 253 | 44815995 | SUSP TRANS
>
>
> the detailed function seems not to work:
> (gdb) rtems_posix_thread 2
> =====================================================================
> # | Name | ID | Pri | Nsecs | State
> ---+------+----------+-----+--------------+------------------------------
> 2 | | 0b010002 | 253 | 23244932 | DORM Wbuf
> BACKTRACE
>
> I don't see any Backtrace here, only the word "BACKTRACE" there is one
> additional helper funtion:
> rtems_task_backtrack

It seems that the rtems_task_backtrack function is currently only implemented 
for i386.  Which architecture are you using?

>
> which requires arg0 = pointer to the Thread_Control_struct of the task. which i
> don't have.

You can get this pointer from the _Object_Get() function.

>
> The standard console gives me similar output (and for reasons i currently don’t
> understand stop's my program, but whatever).
> How are you guys debugging thinks like this. My Application simply hangs i need
> the backtrace of the current threads to get into this...
> One Thread is anywhere blocked, don't know if i get an deadlock or something
> else, is there no way to get the backtraces of all running threads in rtems?

It would be nice to have this feature in the GDB support for RTEMS.

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.





More information about the users mailing list