Python GDB support queries
joel.sherrill at OARcorp.com
Tue Apr 16 18:35:42 UTC 2013
On 4/16/2013 1:26 PM, Dhananjay Balan wrote:
> 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
> Also gdb gave me this 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 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:
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.
> 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
More information about the devel