From 280ae8af4923450e2979deaa8ba53443ef1a810a Mon Sep 17 00:00:00 2001 From: Laura Abbott <lauraa@codeaurora.org> Date: Tue, 11 Mar 2014 15:28:56 -0700 Subject: [PATCH] linux-ramdump-parser-v2: Properly support unwinding without tables unwind tables may not be used on all dumps. Support unwinding the old fashioned way with framepointers. Change-Id: I978c604dc0974eb6930249e47a205e3d9d37c249 --- linux-ramdump-parser-v2/ramdump.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/linux-ramdump-parser-v2/ramdump.py b/linux-ramdump-parser-v2/ramdump.py index aa69be8..bbe2a37 100644 --- a/linux-ramdump-parser-v2/ramdump.py +++ b/linux-ramdump-parser-v2/ramdump.py @@ -67,14 +67,15 @@ class RamDump(): def __init__(self, ramdump): start = ramdump.addr_lookup('__start_unwind_idx') end = ramdump.addr_lookup('__stop_unwind_idx') + self.ramdump = ramdump if (start is None) or (end is None): - print_out_str('!!! Could not lookup unwinding information') + self.unwind_frame = self.unwind_frame_generic return None # addresses + self.unwind_frame = self.unwind_frame_tables self.start_idx = start self.stop_idx = end self.unwind_table = [] - self.ramdump = ramdump i = 0 for addr in range(start, end, 8): r = ramdump.read_string(addr, '<II') @@ -325,7 +326,7 @@ class RamDump(): temp = addr + offset return (temp & 0xffffffff) + ((temp >> 32) & 0xffffffff) - def unwind_frame(self, frame, trace=False): + def unwind_frame_tables(self, frame, trace=False): low = frame.sp high = ((low + (THREAD_SIZE - 1)) & ~(THREAD_SIZE - 1)) + \ THREAD_SIZE -- GitLab