diff options
author | Boris Mittelberg <bmbm@google.com> | 2022-11-23 14:32:03 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-11-28 23:01:38 +0000 |
commit | 7fdbe139cc58304b0ed4531847ea8dafc553f7d3 (patch) | |
tree | ae93180bf15657488a21f884d86371456a517a05 | |
parent | 6dd12ddff735adb9cb1c6ec2528724c87b23e76e (diff) | |
download | chrome-ec-7fdbe139cc58304b0ed4531847ea8dafc553f7d3.tar.gz |
crash_analyzer: improve the assert case
Detecting PC in case of assert (cause 3) from r3
BRANCH=none
BUG=none
TEST=manually on redrix crash reports
Signed-off-by: Boris Mittelberg <bmbm@google.com>
Change-Id: Ifab41cfd081dd61a18db9cee2cd83b5e58fa06ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4053343
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Reviewed-by: Ricardo Quesada <ricardoq@chromium.org>
-rwxr-xr-x | util/crash_analyzer.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/util/crash_analyzer.py b/util/crash_analyzer.py index 552ed9c46c..88592f800a 100755 --- a/util/crash_analyzer.py +++ b/util/crash_analyzer.py @@ -124,18 +124,23 @@ def cm0_parse(match) -> dict: regs["ipsr"] = values[22] regs["cause"] = get_crash_cause(values[6]) # r4 - # Heuristics: try link register, then PC, then what is believed to be PC. - # When analyzing watchdogs, we try to be as close as possible to the caller - # function that caused the watchdog. - # That's why we prioritize LR (return address) over PC. - if regs["lr"] != -1: - regs["symbol"] = get_symbol(regs["lr"]) - elif regs["pc"] != -1: - regs["symbol"] = get_symbol(regs["pc"]) + + # based on crash reports in case of asserrt the PC is in R3 + if regs["cause"] == "assert": + regs["symbol"] = get_symbol(values[5]) # r3 else: - # Otherwise, if both LR and PC are empty, most probably - # PC is in R5. - regs["symbol"] = get_symbol(values[7]) # r5 + # Heuristics: try link register, then PC, then what is believed to be PC. + # When analyzing watchdogs, we try to be as close as possible to the caller + # function that caused the watchdog. + # That's why we prioritize LR (return address) over PC. + if regs["lr"] != -1: + regs["symbol"] = get_symbol(regs["lr"]) + elif regs["pc"] != -1: + regs["symbol"] = get_symbol(regs["pc"]) + else: + # Otherwise, if both LR and PC are empty, most probably + # PC is in R5. + regs["symbol"] = get_symbol(values[7]) # r5 return regs |