<rdar://problem/13477795>
crashlog.py was always subtracting 1 to point to the previous instruction when symbolicating ARM backtraces. Many times the backtraces will include bit zero set to 1 to indicate thumb, so we need to make sure we mask the address and then backup one for non frame zero frames.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178812 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/examples/python/symbolication.py b/examples/python/symbolication.py
index f363961..e4c79b6 100755
--- a/examples/python/symbolication.py
+++ b/examples/python/symbolication.py
@@ -211,6 +211,7 @@
self.module = None
self.symfile = None
self.slide = None
+
def dump(self, prefix):
print "%s%s" % (prefix, self)
@@ -377,7 +378,7 @@
"""A class the represents the information needed to symbolicate addresses in a program"""
self.target = None
self.images = list() # a list of images to be used when symbolicating
-
+ self.addr_mask = 0xffffffffffffffff
def __str__(self):
s = "Symbolicator:\n"
@@ -412,6 +413,12 @@
for image in self.images:
self.target = image.create_target ()
if self.target:
+ if self.target.GetAddressByteSize() == 4:
+ triple = self.target.triple
+ if triple:
+ arch = triple.split('-')[0]
+ if "arm" in arch:
+ self.addr_mask = 0xfffffffffffffffe
return self.target
return None