def get_selected_inferior():
 return gdb.inferiors()[0]
 selected_thread = gdb.selected_thread()
 for inferior in gdb.inferiors():
  for thread in inferior.threads():
   if (thread == selected_thread):
    return inferior

def get_selected_inferior ( ) : return gdb . inferiors ( ) [ 0 ] selected_thread = gdb . selected_thread ( ) for inferior in gdb . inferiors ( ) : for thread in inferior . threads ( ) : if ( thread == selected_thread ) : return inferior
return the selected inferior in gdb .