mirror of
https://git.rtems.org/rtems-tools/
synced 2025-10-18 08:19:15 +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:
|
||||
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()
|
||||
|
Reference in New Issue
Block a user