#2391 assigned defect

'python import rtems' fails in gdb

Reported by: Ric Claus Owned by: Needs Funding
Priority: normal Milestone: Indefinite
Component: tool Version: 4.11
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

When following https://devel.rtems.org/wiki/Developer/Tools/RTEMS_GDB_Python I got:

(gdb) python import rtems
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/claus/development/rtems/4.11/share/gdb/python/rtems/__init__.py", line 31, in <module>
  File "/home/claus/development/rtems/4.11/share/gdb/python/rtems/rtems.py", line 38, in <module>
  File "/home/claus/development/rtems/4.11/share/gdb/python/rtems/threads.py", line 39, in <module>
ImportError: No module named rbtrees
Error while executing Python code.
(gdb)

rbtrees.py is in the tree, so I modified the rtems-source-builder/rtems/sources/git/rtems-tools.git/tools/gdb/python/wscript to include this and two other missing .py files (mutex.py and time.py). I didn't figure out how to apply my change as the file just reverted when I tried. Attached is an untested patch.

Attachments (1)

0001-Added-mutex-rbtrees-and-time.patch (978 bytes) - added by Ric Claus on Aug 17, 2015 at 2:56:18 PM.

Download all attachments as: .zip

Change History (7)

comment:1 Changed on Jan 20, 2016 at 5:37:08 AM by Nick Withers

Any chance we could get this in RSB 4.11.0-rc2, Chris?

comment:2 Changed on Jan 20, 2016 at 6:11:27 AM by Chris Johns

It should be made to work.

comment:3 Changed on Jan 20, 2016 at 6:15:48 AM by Nick Withers

Tested successfully here (at least insofar as the python import rtems works):

GNU gdb (GDB) 7.9
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-freebsd10.2 --target=powerpc-rtems4.11".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from sem_isr.debug...done.
(gdb) target remote bdi:2159
Remote debugging using bdi:2159
_Thread_Idle_body (ignored=0) at /home/nick/rtems/rtems-4.11/powerpc-rtems4.11/mvme3100/lib/include/rtems/confdefs.h:1004
1004	        for( ; ; ) ;
(gdb) python import rtems
RTEMS GDB Support
(gdb) rtems task
----------------------------------------------------------------------
 classic/tasks: 10 [0a010001 -> 0a01000a]
----------------------------------------------------------------------
         Id: 0x0a010001 (@ 0x0004af70)
       Name: UI1 
 Active CPU: not executing
      State: waiting-for-semaphore
    Current: 1
       Real: 1
    Preempt: false
   T Budget: 0
       Time: 0 nsec
  Resources: 0
  Regsters:
Python Exception <class 'gdb.error'> Cannot convert value to int.: 
Error occurred in Python command: Cannot convert value to int.
(gdb) q

comment:4 Changed on Jan 26, 2017 at 7:16:00 AM by Sebastian Huber

Milestone: 4.11.14.11.2

comment:5 Changed on Feb 15, 2017 at 1:37:51 PM by Sebastian Huber

Milestone: 4.11.2Indefinite
Owner: changed from Chris Johns to Needs Funding
Status: newassigned

comment:6 Changed on Feb 6, 2018 at 12:52:52 AM by Chris Johns

Component: tool/rsbtool
Note: See TracTickets for help on using tickets.