mirror of
https://git.rtems.org/rtems-tools/
synced 2025-10-20 05:40:41 +08:00
Catch nonvalid indexes.
Catch IndexErrors generated while referancing non existant indexes.
This commit is contained in:

committed by
Chris Johns

parent
a71368892a
commit
b743d63fde
@@ -130,10 +130,14 @@ class rtems_semaphore(gdb.Command):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
print "error: %s is not an index" % (val)
|
print "error: %s is not an index" % (val)
|
||||||
return
|
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 = classic.semaphore(obj)
|
||||||
instance.show(from_tty)
|
instance.show(from_tty)
|
||||||
objects.information.invalidate()
|
objects.information.invalidate()
|
||||||
|
Reference in New Issue
Block a user