Python GDB support queries

Dhananjay Balan mb.dhananjay at gmail.com
Sun Apr 21 05:00:59 UTC 2013


Hi,

Thanks for the inputs.

I have solved the problem - the problem was the thread structure definition
was wrong. PFA diff for my edits, also my semaphore listing command works
fine now (With an information flood in gdb window ;))

A sample output is here : https://gist.github.com/5428535

About duplicating a lot of resources - I was trying
to quickly prototype stuff I didn't care about hierarchies much, The
problem was that the code design needs to be tweaked heavily to use as a
general framework to build rtems gdb extensions.




On 17 April 2013 00:05, Joel Sherrill <joel.sherrill at oarcorp.com> wrote:

> On 4/16/2013 1:26 PM, Dhananjay Balan wrote:
>
>> Hi,
>>
>> Was fiddling little bit with code, trying to convert some of the GDB
>> sim-scripts into the python functions.
>>
>> PFA diff of the function I wrote - it tries to print a list of all
>> semaphores. But I could not get past this error (I can print the ids, but
>> error occurs during the printing of semaphore information, something
>> related to task queues I suppose.)
>>
>> Please find the debug information here -> https://gist.github.com/**
>> 5398227 <https://gist.github.com/5398227>
>>
>> Also gdb gave me this https://gist.github.com/**anonymous/5398125<https://gist.github.com/anonymous/5398125>
>>
>> Any thoughts why this function fails?
>>
>>
>> Also just being curious https://gist.github.com/**
>> dhananjaynav/5398261#file-**threads-py-L191<https://gist.github.com/dhananjaynav/5398261#file-threads-py-L191>shouldn't this be indexed at Priority rather than at Fifo?
>>
>>
>>  I can't tell much but I am guessing that this happened because the chain
> is empty and the code around lines 29-31 isn't right.
>
> Assuming pointers are 4 bytes and the chain control is at 0x10000, the
> chain control when empty looks like this:
>
> 0x10000    0x10004
> 0x10004    0
> 0x10008    0x10000
>
> The "empty" check is written this way in C.
>
> bool _Chain_Is_empty( const Chain_Control *the_chain)
> {
>   return _Chain_Immutable_first( the_chain )     == _Chain_Immutable_tail(
> the_chain );
> }
>
> Line 16 needs to change to check that node != chain.immutable_tail().
>
> FYI I am thrilled you are this far!!! If you can mirror the inheritance in
> the code in the Python for gdb, a lot of this is repetitive. The macros
> should give a hint at how to inherit.
>
>  --
>> Regards,
>> Dhananjay M Balan,
>>
>>
>
> --
> Joel Sherrill, Ph.D.             Director of Research & Development
> joel.sherrill at OARcorp.com        On-Line Applications Research
> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
> Support Available                (256) 722-9985
>
>


-- 
Regards,
Dhananjay M Balan,
Department Of Computer Science,
College Of Engineering, Trivandrum.
http://cet.ac.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130421/bbc504be/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtems-python.diff
Type: application/octet-stream
Size: 3170 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20130421/bbc504be/attachment-0001.obj>


More information about the devel mailing list