From 636d0c374554bbe5c45f347b38a347ffdee994d6 Mon Sep 17 00:00:00 2001 From: Yu-hsin Wang Date: Thu, 29 Jul 2021 16:07:27 +0800 Subject: [PATCH] base: improve gdb exception information Even it is an unknow exception for GDB, we still can try to cast it to std::exception and print some information from `what()`. Change-Id: Ie0cdc978eb1b3e130bc2153eae99025dcd0109f7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48825 Reviewed-by: Gabe Black Maintainer: Gabe Black Tested-by: kokoro --- src/base/remote_gdb.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc index f04b18a255..ad950464a0 100644 --- a/src/base/remote_gdb.cc +++ b/src/base/remote_gdb.cc @@ -557,6 +557,8 @@ BaseRemoteGDB::trap(ContextID id, int signum) send(""); } catch (CmdError &e) { send(e.error); + } catch (std::exception &e) { + panic("Unrecognzied GDB exception: %s", e.what()); } catch (...) { panic("Unrecognzied GDB exception."); }