def testReadSymsHeaderGoodBuffer(self): """Make sure ReadSymsHeader can parse sym file handles""" result = cros_generate_breakpad_symbols.ReadSymsHeader( StringIO.StringIO('MODULE Linux arm MY-ID-HERE blkid')) self.assertEquals(result.cpu, 'arm') self.assertEquals(result.id, 'MY-ID-HERE') self.assertEquals(result.name, 'blkid') self.assertEquals(result.os, 'Linux')
def testReadSymsHeaderGoodFile(self): """Make sure ReadSymsHeader can parse sym files""" sym_file = os.path.join(self.tempdir, 'sym') osutils.WriteFile(sym_file, 'MODULE Linux x86 s0m31D chrooome') result = cros_generate_breakpad_symbols.ReadSymsHeader(sym_file) self.assertEquals(result.cpu, 'x86') self.assertEquals(result.id, 's0m31D') self.assertEquals(result.name, 'chrooome') self.assertEquals(result.os, 'Linux')
def __init__(self, display_path, file_name): """An instance of this class represents a symbol file over time. Args: display_path: A unique/persistent between builds name to present to the crash server. It is the file name, relative to where it came from (tarball, breakpad dir, etc). file_name: A the current location of the symbol file. """ self.display_path = display_path self.file_name = file_name self.header = cros_generate_breakpad_symbols.ReadSymsHeader(file_name) self.status = SymbolFile.INITIAL
def __init__(self, sym_file): sym_header = cros_generate_breakpad_symbols.ReadSymsHeader(sym_file) super(SymbolItem, self).__init__(str(sym_header), self.ALGO) self.sym_header = sym_header self.sym_file = sym_file