aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/gdb-utils.exp
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-09-25 16:28:05 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-04-15 10:34:09 +0100
commit92e4e97a9f569bf23b0f74479f32280c1f24cc6b (patch)
treec3c32649c4dd701fef2406701e243be12a27b726 /gdb/testsuite/lib/gdb-utils.exp
parent54b4dcc530f0a907d9121aba1a2631d7e3333a8f (diff)
downloadbinutils-92e4e97a9f569bf23b0f74479f32280c1f24cc6b.zip
binutils-92e4e97a9f569bf23b0f74479f32280c1f24cc6b.tar.gz
binutils-92e4e97a9f569bf23b0f74479f32280c1f24cc6b.tar.bz2
gdb: process early initialization files and command line options
Adds the ability to process commands at a new phase during GDB's startup. This phase is earlier than the current initialisation file processing, before GDB has produced any output. The number of commands that can be processed at this early stage will be limited, and it is expected that the only commands that would be processed at this stage will relate to some of the fundamentals of how GDB starts up. Currently the only commands that it makes sense to add to this early initialization file are those like 'set style version ....' as the version string is displayed during startup before the standard initialization files are parsed. As such this commit fully resolved bug cli/25956. This commit adds a mechanism to execute these early initialization files from a users HOME directory, as well as some corresponding command line flags for GDB. The early initialization files that GDB will currently check for are ~/.config/gdb/gdbearlyinit (on Linux like systems) or ~/.gdbearlyinit if the former is not found. The output of 'gdb --help' has been extended to include a list of the early initialization files being processed. gdb/ChangeLog: PR cli/25956 * NEWS: Mention new early init files and command line options. * config.in: Regenerate. * configure: Regenerate. * configure.ac: Define GDBEARLYINIT. * main.c (get_earlyinit_files): New function. (enum cmdarg_kind): Add CMDARG_EARLYINIT_FILE and CMDARG_EARLYINIT_COMMAND. (captured_main_1): Add support for new command line flags, and for processing startup files. (print_gdb_help): Include startup files in the output. gdb/doc/ChangeLog: PR cli/25956 * gdb.texinfo (File Options): Mention new command line options. (Startup): Discuss when early init files are processed. (Initialization Files): Add description of early init files. (Output Styling): Update description of 'version' style. (gdb man): Mention early init files. gdb/testsuite/ChangeLog: PR cli/25956 * gdb.base/early-init-file.c: New file. * gdb.base/early-init-file.exp: New file. * lib/gdb-utils.exp (style): Handle style 'none'.
Diffstat (limited to 'gdb/testsuite/lib/gdb-utils.exp')
-rw-r--r--gdb/testsuite/lib/gdb-utils.exp1
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb-utils.exp b/gdb/testsuite/lib/gdb-utils.exp
index ad7d288..cec1571 100644
--- a/gdb/testsuite/lib/gdb-utils.exp
+++ b/gdb/testsuite/lib/gdb-utils.exp
@@ -56,6 +56,7 @@ proc style {str style} {
address { set style 34 }
metadata { set style 2 }
version { set style "35;1" }
+ none { return $str }
}
return "\033\\\[${style}m${str}\033\\\[m"
}