parameters: ()
return_statement: return thread_dict
docstring: Get threads info.
docstring_summary: Get threads info.
docstring_tokens: Get threads info .
function: def get_threads_info():
      """Get threads info."""
      thread_dict = {}
      for thread in gdb.selected_inferior().threads():
          try:
              if not thread.is_valid():
                  continue
              thread.switch()
              # PTID is a tuple: Process ID (PID), Lightweight Process ID (LWPID), Thread ID (TID)
              (_, lwpid, _) = thread.ptid
              thread_num = thread.num
              thread_name = get_current_thread_name()  # pylint: disable=undefined-variable
              thread_id = get_thread_id()  # pylint: disable=undefined-variable
              if not thread_id:
                  print("Unable to retrieve thread_info for thread %d" % thread_num)
                  continue
              thread_dict[lwpid] = Thread(thread_id, lwpid, thread_name)
          except gdb.error as err:
              print("Ignoring GDB error '%s' in get_threads_info" % str(err))
  
      return thread_dict
function_tokens: def get_threads_info ( ) : thread_dict = { } for thread in gdb . selected_inferior ( ) . threads ( ) : try : if not thread . is_valid ( ) : continue thread . switch ( ) # PTID is a tuple: Process ID (PID), Lightweight Process ID (LWPID), Thread ID (TID) ( _ , lwpid , _ ) = thread . ptid thread_num = thread . num thread_name = get_current_thread_name ( ) # pylint: disable=undefined-variable thread_id = get_thread_id ( ) # pylint: disable=undefined-variable if not thread_id : print ( "Unable to retrieve thread_info for thread %d" % thread_num ) continue thread_dict [ lwpid ] = Thread ( thread_id , lwpid , thread_name ) except gdb . error as err : print ( "Ignoring GDB error '%s' in get_threads_info" % str ( err ) ) return thread_dict