def find_goroutine(goid):
 vp = gdb.lookup_type('void').pointer()
 for ptr in linked_list(gdb.parse_and_eval("'runtime.allg'"), 'alllink'):
  if (ptr['status'] == 6):
   continue
  if (ptr['goid'] == goid):
   return (ptr['sched'][x].cast(vp) for x in ('pc', 'sp'))
 return (None, None)

def find_goroutine ( goid ) : vp = gdb . lookup_type ( 'void' ) . pointer ( ) for ptr in linked_list ( gdb . parse_and_eval ( "'runtime.allg'" ) , 'alllink' ) : if ( ptr [ 'status' ] == 6 ) : continue if ( ptr [ 'goid' ] == goid ) : return ( ptr [ 'sched' ] [ x ] . cast ( vp ) for x in ( 'pc' , 'sp' ) ) return ( None , None )
find_goroutine attempts to find the goroutine identified by goid .