summaryrefslogtreecommitdiff
path: root/Meta
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2023-04-07 17:01:29 +0200
committerTim Flynn <trflynn89@pm.me>2023-04-11 06:44:13 -0400
commit5ca1bd55a00590f0c19afb37f00bd8fe13288dfb (patch)
tree4988be83e9a73ec01eeb00424cb2b29cd7d6bc53 /Meta
parent550635164d7c1cb6b9d7b8c402dd0ec330d91d63 (diff)
downloadserenity-5ca1bd55a00590f0c19afb37f00bd8fe13288dfb.zip
Toolchain: Move GDB build to a separate script
Target GDB is only used for debugging the kernel, which is not relevant to most people. Starting with 924758c6f8bcf, GDB would always be built as part of the toolchain if the user didn't have it installed. This is unnecessary. This commit adds a separate script for building GDB, which the user needs to explicitly invoke. A message is added to Meta/debug-kernel.sh which alerts the user to this fact.
Diffstat (limited to 'Meta')
-rwxr-xr-xMeta/debug-kernel.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/Meta/debug-kernel.sh b/Meta/debug-kernel.sh
index 04afa992b0..4e902155b6 100755
--- a/Meta/debug-kernel.sh
+++ b/Meta/debug-kernel.sh
@@ -9,7 +9,9 @@ fi
# Set this environment variable to override the default debugger.
#
if [ -z "$SERENITY_KERNEL_DEBUGGER" ]; then
- # Prepend the toolchain bin directory so we pick up GDB from there
+ # Prepend the toolchain's GDB bin directory so we pick up GDB from there
+ PATH="$SCRIPT_DIR/../Toolchain/Local/$SERENITY_ARCH-gdb/bin:$PATH"
+ # GDB used to be installed directly inside the toolchain bin directory
PATH="$SCRIPT_DIR/../Toolchain/Local/$SERENITY_ARCH/bin:$PATH"
if command -v "$SERENITY_ARCH-pc-serenity-gdb" >/dev/null; then
@@ -20,6 +22,9 @@ if [ -z "$SERENITY_KERNEL_DEBUGGER" ]; then
SERENITY_KERNEL_DEBUGGER="gdb"
else
echo "Error: No suitable GDB installation found." >&2
+ echo "Please install $SERENITY_ARCH-elf-gdb or build it with Toolchain/BuildGDB.sh $SERENITY_ARCH" >&2
+ # Prevent tmux from dying instantly by waiting for user input
+ read -rp "Press Enter to exit"
exit 1
fi
fi