Fixed decode_backtrace.py to return proper index

The algorithm was returning the function after the desired function

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-11-23 20:16:51 -08:00
parent 92e47eba76
commit 5f4ee6ad9d
+4 -2
View File
@@ -85,12 +85,14 @@ def load_symbol_map():
# Find the function for the specified call stack address
def lookup(addr):
i=0
i=1
while i < len(funcaddr) and addr > funcaddr[i]:
i=i+1
if i >= len(funcaddr):
return -1
return i
# return the function before this one
return i-1
if len(os.sys.argv) != 2:
usage()