]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
gdb: Prevent wrapping when writing to .segments.tmp
authorGlenn Washburn <development@efficientek.com>
Tue, 21 Feb 2023 18:28:47 +0000 (12:28 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 28 Feb 2023 12:41:57 +0000 (13:41 +0100)
GDB logging is redirected to write .segments.tmp, which means that GDB
will wrap lines longer than what it thinks is the screen width
(typically 80 characters). When wrapping does occur it causes gmodule.pl
to misbehave. So disable line wrapping by using GDB's "with" command so
that its guaranteed to return the width to the previous value upon
command completion.

Also disable command tracing when dumping the module sections because that
output will go to .segments.tmp and thus cause gmodule.pl to misbehave.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/gdb_grub.in

index 4e45ad56228b074edb9e533634a69febc7c04375..edb5a8872c7c06b46e3156bc00789113d6bce45e 100644 (file)
@@ -22,6 +22,10 @@ define dump_module_sections_helper
 end
 
 define dump_module_sections
+       # Set unlimited width so that lines don't get wrapped writing
+       # to .segments.tmp
+       with width 0 -- \
+       with trace-commands off -- \
        pipe dump_module_sections_helper $arg0 | sh -c 'cat >>.segments.tmp'
 end
 document dump_module_sections