[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/igc ab35741d43a 1/2: Better GDB support for MPS builds
From: |
Pip Cet |
Subject: |
scratch/igc ab35741d43a 1/2: Better GDB support for MPS builds |
Date: |
Sat, 24 Aug 2024 13:30:05 -0400 (EDT) |
branch: scratch/igc
commit ab35741d43a6652a1c5c961b3b8001830a74f277
Author: Pip Cet <pipcet@protonmail.com>
Commit: Pip Cet <pipcet@protonmail.com>
Better GDB support for MPS builds
* src/.gdbinit: Add MPS-specific signal handlers.
* src/alloc.c (gdb_make_enums_visible): Add 'defined_HAVE-MPS'.
---
src/.gdbinit | 9 +++++++--
src/alloc.c | 7 +++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/.gdbinit b/src/.gdbinit
index 512e90f8aef..e18ad1c3e66 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -51,8 +51,13 @@ if defined_HAVE_PGTK
end
# Pass on signals used by MPS to suspend threads.
-handle SIGXFSZ nostop noprint pass
-handle SIGXCPU nostop noprint pass
+if defined_HAVE_MPS
+ # Print SIGSEGV for now, since it makes the logs more useful. Don't
+ # stop, though.
+ handle SIGSEGV nostop print pass
+ handle SIGXFSZ nostop noprint pass
+ handle SIGXCPU nostop noprint pass
+end
# Use $bugfix so that the value isn't a constant.
# Using a constant runs into GDB bugs sometimes.
diff --git a/src/alloc.c b/src/alloc.c
index d9423a1b444..f41cef9516a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -8630,6 +8630,12 @@ enum defined_HAVE_PGTK { defined_HAVE_PGTK = true };
enum defined_HAVE_PGTK { defined_HAVE_PGTK = false };
#endif
+#ifdef HAVE_MPS
+enum defined_HAVE_MPS { defined_HAVE_MPS = true };
+#else
+enum defined_HAVE_MPS { defined_HAVE_MPS = false };
+#endif
+
/* When compiled with GCC, GDB might say "No enum type named
pvec_type" if we don't have at least one symbol with that type, and
then xbacktrace could fail. Similarly for the other enums and
@@ -8650,6 +8656,7 @@ extern union enums_for_gdb
enum pvec_type pvec_type;
enum defined_HAVE_X_WINDOWS defined_HAVE_X_WINDOWS;
enum defined_HAVE_PGTK defined_HAVE_PGTK;
+ enum defined_HAVE_MPS defined_HAVE_MPS;
} const gdb_make_enums_visible;
union enums_for_gdb const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0};
#endif /* __GNUC__ */