MCPcopy Create free account
hub / github.com/KDE/labplot / DarwinSymbolizer

Class DarwinSymbolizer

admin/asan_symbolize.py:208–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206
207
208class DarwinSymbolizer(Symbolizer):
209 def __init__(self, addr, binary):
210 super(DarwinSymbolizer, self).__init__()
211 self.binary = binary
212 self.arch = guess_arch(addr)
213 self.open_atos()
214
215 def open_atos(self):
216 if DEBUG:
217 print 'atos -o %s -arch %s' % (self.binary, self.arch)
218 cmdline = ['atos', '-o', self.binary, '-arch', self.arch]
219 self.atos = UnbufferedLineConverter(cmdline, close_stderr=True)
220
221 def symbolize(self, addr, binary, offset):
222 """Overrides Symbolizer.symbolize."""
223 if self.binary != binary:
224 return None
225 atos_line = self.atos.convert('0x%x' % int(offset, 16))
226 while "got symbolicator for" in atos_line:
227 atos_line = self.atos.readline()
228 # A well-formed atos response looks like this:
229 # foo(type1, type2) (in object.name) (filename.cc:80)
230 match = re.match('^(.*) \(in (.*)\) \((.*:\d*)\)$', atos_line)
231 if DEBUG:
232 print 'atos_line: ', atos_line
233 if match:
234 function_name = match.group(1)
235 function_name = re.sub('\(.*?\)', '', function_name)
236 file_name = fix_filename(match.group(3))
237 return ['%s in %s %s' % (addr, function_name, file_name)]
238 else:
239 return ['%s in %s' % (addr, atos_line)]
240
241
242# Chain several symbolizers so that if one symbolizer fails, we fall back

Callers 1

SystemSymbolizerFactoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected