grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v4 14/15] gdb: Add ability to turn on shell tracing for gdb helpe


From: Glenn Washburn
Subject: [PATCH v4 14/15] gdb: Add ability to turn on shell tracing for gdb helper script
Date: Thu, 15 Dec 2022 23:29:37 -0600

If envvar GRUB_GDB_TRACE_FILE is set, turn on shell tracing and write
stderr messages, which includes trace messages, to path specified in the
value of the envvar.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 grub-core/gdb_helper.sh.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/grub-core/gdb_helper.sh.in b/grub-core/gdb_helper.sh.in
index 1eaa976fb7..13f79bfb07 100644
--- a/grub-core/gdb_helper.sh.in
+++ b/grub-core/gdb_helper.sh.in
@@ -2,6 +2,11 @@
 ### Helper functions for GRUB's GDB script.
 ###
 
+if [ -n "$GRUB_GDB_TRACE_FILE" ]; then
+  set -x
+  exec 2>"$GRUB_GDB_TRACE_FILE"
+fi
+
 alignup() {
   PAD=1
   if [ "$(($1%$2))" -eq 0 ]; then
-- 
2.34.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]