parameters: (lwp_to_thread_id, thread_lwp)
docstring: If the thread is waiting on a write-locked pthread_rwlock_t, this will
      return the pair of:
          (lwp of thread that is write-owning the mutex, mutex address)
      or (None, None) if not found, or if the mutex is read-locked.
docstring_summary: If the thread is waiting on a write-locked pthread_rwlock_t, this will
      return the pair of:
          (lwp of thread that is write-owning the mutex, mutex address)
      or (None, None) if not found, or if the mutex is read-locked.
docstring_tokens: If the thread is waiting on a write - locked pthread_rwlock_t this will return the pair of : ( lwp of thread that is write - owning the mutex mutex address ) or ( None None ) if not found or if the mutex is read - locked .
function: def get_pthread_rwlock_t_owner_and_address(lwp_to_thread_id, thread_lwp):
      '''
      If the thread is waiting on a write-locked pthread_rwlock_t, this will
      return the pair of:
          (lwp of thread that is write-owning the mutex, mutex address)
      or (None, None) if not found, or if the mutex is read-locked.
      '''
      # Go up the stack to the pthread_rwlock_{rd|wr}lock frame
      gdb.execute(
          'thread %d' % lwp_to_thread_id[thread_lwp],
          from_tty=False,
          to_string=True
      )
      gdb.execute('frame 2', from_tty=False, to_string=True)
  
      # Get the owner of the mutex by inspecting the internal
      # fields of the mutex.
      try:
          rwlock_info = gdb.parse_and_eval('rwlock').dereference()
          rwlock_owner_lwp = int(rwlock_info['__data']['__writer'])
          # We can only track the owner if it is currently write-locked.
          # If it is not write-locked or if it is currently read-locked,
          # possibly by multiple threads, we cannot find the owner.
          if rwlock_owner_lwp != 0:
              return (rwlock_owner_lwp, int(rwlock_info.address))
          else:
              return (None, None)
      except gdb.error:
          return (None, None)
function_tokens: def get_pthread_rwlock_t_owner_and_address ( lwp_to_thread_id , thread_lwp ) : # Go up the stack to the pthread_rwlock_{rd|wr}lock frame gdb . execute ( 'thread %d' % lwp_to_thread_id [ thread_lwp ] , from_tty = False , to_string = True ) gdb . execute ( 'frame 2' , from_tty = False , to_string = True ) # Get the owner of the mutex by inspecting the internal # fields of the mutex. try : rwlock_info = gdb . parse_and_eval ( 'rwlock' ) . dereference ( ) rwlock_owner_lwp = int ( rwlock_info [ '__data' ] [ '__writer' ] ) # We can only track the owner if it is currently write-locked. # If it is not write-locked or if it is currently read-locked, # possibly by multiple threads, we cannot find the owner. if rwlock_owner_lwp != 0 : return ( rwlock_owner_lwp , int ( rwlock_info . address ) ) else : return ( None , None ) except gdb . error : return ( None , None )