diff options
author | Alexander Potapenko <glider@google.com> | 2012-10-02 15:42:24 +0000 |
---|---|---|
committer | Alexander Potapenko <glider@google.com> | 2012-10-02 15:42:24 +0000 |
commit | 8bf8b7943848973398be0c3ad99855e20da6d6fa (patch) | |
tree | 0dd8f1afb67fceecc3f4ad704c4138e8302224f3 /lib/asan/scripts/asan_symbolize.py | |
parent | 73ed35f0b6cdc8ce8c23e839a3973212f448ef8d (diff) | |
download | compiler-rt-8bf8b7943848973398be0c3ad99855e20da6d6fa.tar.gz |
Do not patch the instruction address when symbolizing the reports.
Instead, print the correct address at runtime.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@165018 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/scripts/asan_symbolize.py')
-rwxr-xr-x | lib/asan/scripts/asan_symbolize.py | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/lib/asan/scripts/asan_symbolize.py b/lib/asan/scripts/asan_symbolize.py index a4f91c8a0..789104195 100755 --- a/lib/asan/scripts/asan_symbolize.py +++ b/lib/asan/scripts/asan_symbolize.py @@ -146,39 +146,8 @@ class DarwinSymbolizer(Symbolizer): self.vmaddr = None self.pipe = None - def get_binary_vmaddr(self): - """Get the slide value to be added to the address. - - We're looking for the following piece in otool -l output: - Load command 0 - cmd LC_SEGMENT - cmdsize 736 - segname __TEXT - vmaddr 0x00000000 - """ - if self.vmaddr: - return self.vmaddr - cmdline = ['otool', '-l', self.binary] - pipe = subprocess.Popen(cmdline, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE) - is_text = False - vmaddr = 0 - for line in pipe.stdout: - line = line.strip() - if line.startswith('segname'): - is_text = (line == 'segname __TEXT') - continue - if line.startswith('vmaddr') and is_text: - sv = line.split(' ') - vmaddr = int(sv[-1], 16) - break - self.vmaddr = vmaddr - return self.vmaddr - def write_addr_to_pipe(self, offset): - slide = self.get_binary_vmaddr() - print >> self.pipe.stdin, '0x%x' % (int(offset, 16) + slide) + print >> self.pipe.stdin, '0x%x' % int(offset, 16) def open_atos(self): if DEBUG: |