From 5f4ee6ad9d10312131fb1a1f0173961d235adb19 Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Mon, 23 Nov 2015 20:16:51 -0800 Subject: [PATCH] Fixed decode_backtrace.py to return proper index The algorithm was returning the function after the desired function Signed-off-by: Mark Charlebois --- Tools/decode_backtrace.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tools/decode_backtrace.py b/Tools/decode_backtrace.py index 469e891110..479e0f305a 100755 --- a/Tools/decode_backtrace.py +++ b/Tools/decode_backtrace.py @@ -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()