summaryrefslogtreecommitdiffstats
path: root/tools/gdb/python/rtems.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gdb/python/rtems.py')
-rw-r--r--tools/gdb/python/rtems.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/gdb/python/rtems.py b/tools/gdb/python/rtems.py
index 8eb49c9..dbfd7c7 100644
--- a/tools/gdb/python/rtems.py
+++ b/tools/gdb/python/rtems.py
@@ -130,10 +130,14 @@ class rtems_semaphore(gdb.Command):
except ValueError:
print "error: %s is not an index" % (val)
return
+ try:
+ obj = objects.information.object_return( self.api,
+ self._class,
+ index ).dereference()
+ except IndexError:
+ print "error: index %s is invalid" % (index)
+ return
- obj = objects.information.object_return( self.api,
- self._class,
- int(index)).dereference()
instance = classic.semaphore(obj)
instance.show(from_tty)
objects.information.invalidate()