parameters: (self, addr, binary, offset)
return_statement: return ['%s in %s %s' % (addr, function, fix_filename(file)) for (function, file) in lines]
docstring: Overrides Symbolizer.symbolize.
docstring_summary: Overrides Symbolizer.symbolize.
docstring_tokens: Overrides Symbolizer . symbolize .
function: def symbolize(self, addr, binary, offset):
      """Overrides Symbolizer.symbolize."""
      if self.binary != binary:
        return None
      lines = []
      try:
        self.pipe.stdin.write("%s\n" % offset)
        self.pipe.stdin.write("%s\n" % self.output_terminator)
        is_first_frame = True
        while True:
          function_name = self.pipe.stdout.readline().rstrip()
          logging.debug("read function_name='%s' from addr2line" % function_name)
          # If llvm-symbolizer is installed as addr2line, older versions of
          # llvm-symbolizer will print -1 when presented with -1 and not print
          # a second line. In that case we will block for ever trying to read the
          # file name. This also happens for non-existent files, in which case GNU
          # addr2line exits immediate, but llvm-symbolizer does not (see
          # https://llvm.org/PR42754).
          if function_name == '-1':
            logging.debug("got function '-1' -> no more input")
            break
          file_name = self.pipe.stdout.readline().rstrip()
          logging.debug("read file_name='%s' from addr2line" % file_name)
          if is_first_frame:
            is_first_frame = False
          elif function_name == '??':
            assert file_name == '??:0', file_name
            logging.debug("got function '??' -> no more input")
            break
          elif not function_name:
            assert not file_name, file_name
            logging.debug("got empty function name -> no more input")
            break
          if not function_name and not file_name:
            logging.debug("got empty function and file name -> unknown function")
            function_name = '??'
            file_name = '??:0'
          lines.append((function_name, file_name))
      except IOError as e:
        # EPIPE happens if addr2line exits early (which some implementations do
        # if an invalid file is passed).
        if e.errno == errno.EPIPE:
          logging.debug("addr2line exited early (broken pipe), returncode=%d" % self.pipe.poll())
        else:
          logging.debug("unexpected I/O exception communicating with addr2line", exc_info=e)
        lines.append(('??', '??:0'))
      except Exception as e:
        logging.debug("got unknown exception communicating with addr2line", exc_info=e)
        lines.append(('??', '??:0'))
      return ['%s in %s %s' % (addr, function, fix_filename(file)) for (function, file) in lines]
function_tokens: def symbolize ( self , addr , binary , offset ) : if self . binary != binary : return None lines = [ ] try : self . pipe . stdin . write ( "%s\n" % offset ) self . pipe . stdin . write ( "%s\n" % self . output_terminator ) is_first_frame = True while True : function_name = self . pipe . stdout . readline ( ) . rstrip ( ) logging . debug ( "read function_name='%s' from addr2line" % function_name ) # If llvm-symbolizer is installed as addr2line, older versions of # llvm-symbolizer will print -1 when presented with -1 and not print # a second line. In that case we will block for ever trying to read the # file name. This also happens for non-existent files, in which case GNU # addr2line exits immediate, but llvm-symbolizer does not (see # https://llvm.org/PR42754). if function_name == '-1' : logging . debug ( "got function '-1' -> no more input" ) break file_name = self . pipe . stdout . readline ( ) . rstrip ( ) logging . debug ( "read file_name='%s' from addr2line" % file_name ) if is_first_frame : is_first_frame = False elif function_name == '??' : assert file_name == '??:0' , file_name logging . debug ( "got function '??' -> no more input" ) break elif not function_name : assert not file_name , file_name logging . debug ( "got empty function name -> no more input" ) break if not function_name and not file_name : logging . debug ( "got empty function and file name -> unknown function" ) function_name = '??' file_name = '??:0' lines . append ( ( function_name , file_name ) ) except IOError as e : # EPIPE happens if addr2line exits early (which some implementations do # if an invalid file is passed). if e . errno == errno . EPIPE : logging . debug ( "addr2line exited early (broken pipe), returncode=%d" % self . pipe . poll ( ) ) else : logging . debug ( "unexpected I/O exception communicating with addr2line" , exc_info = e ) lines . append ( ( '??' , '??:0' ) ) except Exception as e : logging . debug ( "got unknown exception communicating with addr2line" , exc_info = e ) lines . append ( ( '??' , '??:0' ) ) return [ '%s in %s %s' % ( addr , function , fix_filename ( file ) ) for ( function , file ) in lines ]