mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 14:47:44 +08:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user