From 410510eed2402f58c87f4889a74725a4f32c7e75 Mon Sep 17 00:00:00 2001 From: Thomas Abraham Date: Mon, 25 Mar 2024 13:07:09 -0400 Subject: [PATCH] crash.session: handle crash.target.setup_target() exception gracefully crash.target.setup_target() will raise an IncorrectTargetError exception, if the target implementation for this kernel cannot be found. Handle this gracefully. --- crash/session.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crash/session.py b/crash/session.py index e47a8cd7a0..9cc8240120 100644 --- a/crash/session.py +++ b/crash/session.py @@ -36,7 +36,13 @@ def __init__(self, roots: PathSpecifier = None, self.debug = debug self.verbose = verbose - target = crash.target.setup_target() + try: + target = crash.target.setup_target() + except crash.target.IncorrectTargetError as e: + print(str(e)) + print("Further debugging may not be possible.") + return + from crash.kernel import CrashKernel, CrashKernelError self.kernel = CrashKernel(roots, vmlinux_debuginfo, module_path,