Update the stack script for apk handling.

The dlopen of a shared library within an apk is not handled by
the stack tool. Modify to understand and search through the apk to
find the shared library associated with the offset. Then unzip
that shared library to use as the target of addr2line.

Change-Id: I404302f68dff45c35a1dc2a55547f42ea04f02bf
This commit is contained in:
Christopher Ferris
2015-08-20 20:09:09 -07:00
parent 8ae499e1d3
commit ece64c4bd5
2 changed files with 114 additions and 11 deletions

View File

@@ -185,7 +185,9 @@ def CallAddr2LineForSet(lib, unique_addrs):
symbols = SYMBOLS_DIR + lib
if not os.path.exists(symbols):
return None
symbols = lib
if not os.path.exists(symbols):
return None
cmd = [ToolPath("addr2line"), "--functions", "--inlines",
"--demangle", "--exe=" + symbols]
@@ -203,7 +205,7 @@ def CallAddr2LineForSet(lib, unique_addrs):
if symbol == "??":
symbol = None
location = child.stdout.readline().strip()
if location == "??:0":
if location == "??:0" or location == "??:?":
location = None
if symbol is None and location is None:
break
@@ -250,11 +252,9 @@ def CallObjdumpForSet(lib, unique_addrs):
symbols = SYMBOLS_DIR + lib
if not os.path.exists(symbols):
return None
symbols = SYMBOLS_DIR + lib
if not os.path.exists(symbols):
return None
symbols = lib
if not os.path.exists(symbols):
return None
addrs = sorted(unique_addrs)
start_addr_dec = str(StripPC(int(addrs[0], 16)))