Unix in a Nutshell, Fourth Edition
< Day Day Up > |
The set command accepts a large number of different parameters that control GDB's behavior. Many of the accepted parameters are rather esoteric. The show command displays the values of the same parameters as set accepts. This section summarizes the parameters and how they affect GDB. For most of the options, set option and set option on are equivalent; they enable the option. Use set option off to disable the option.
set annotate level show annotate
Set the annotation_level variable to level. GUI programs that call GDB as a subsidiary process use this variable.
set architecture architecture show architecture
Set the architecture of target to architecture. Primarily used in cross-debugging.
set args show args
Give the debuggee the argument list when you start it. The run command uses this list when it isn't given any arguments. See the entry for run in the later section "Alphabetical Summary of GDB Commands."
set auto-solib-add show auto-solib-add
Automatically load symbols from shared libraries as needed. When set to off, symbols must be loaded manually with the sharedlibrary command.
set auto-solib-limit megs show auto-solib-limit
Limit the size of symbols from shared libraries that will be automatically loaded to megs megabytes. Not available on all systems.
set backtrace limit count show backtrace limit set backtrace past-main show backtrace past-main
The first syntax limits the number of stack frames shown in a backtrace to count. The default is unlimited. The second syntax controls whether GDB shows information about frames that precede the main( ) function. Such startup code is usually not of interest, thus the default is off.
set breakpoint pending val show breakpoint pending How GDB should handle breakpoint locations that can't be found (for example, if a shared library has yet to be loaded). Values are on, off, or auto. When val is on, GDB automatically creates a pending breakpoint. For auto, it asks you. For off, pending breakpoints are not created.
set can-use-hw-watchpoints value show can-use-hw-watchpoints If nonzero, GDB uses hardware support for watchpoints, if the system has such support. Otherwise, it doesn't.
set case-sensitive show case-sensitive
Set whether GDB should ignore case when searching for symbols. This variable can be set to on, off, or auto. For auto the case sensitivity depends upon the language.
set coerce-float-to-double show coerce-float-to-double When calling a function that is not prototyped, if this variable is on, GDB coerces values of type float to type double. If the variable is off, floats are not coerced to double and prototyped functions receive float values as is.
show commands [cmdnum] show commands +
By default, show the last 10 commands in the command history. With a numeric cmdnum, show the 10 commands centered around cmdnum. The second syntax shows the 10 commands following those just printed.
set complaints limit show complaints When GDB encounters problems reading in symbol tables, it normally does not complain. By setting this variable, GDB produces up to limit complaints about each kind of problem it finds. The default is 0, which creates no complaints. Use a large number to mean "unlimited."
set confirm show confirm GDB normally asks for confirmation before certain operations, such as deleting breakpoints. Set this value to off to disable confirmation. Do this only if you're really sure that you know what you're doing.
show convenience
Print a list of convenience variables used so far, along with their values. Can be abbreviated show conv.
show copying
Display the GNU General Public License (GPL).
set cp-abi show cp-abi
The Application Binary Interface (ABI) used for inspecting C++ objects. The default is auto, where GDB determines the ABI on its own. Other acceptable values are gnu-v2 for g++ versions before 3.0, gnu-v3 for g++ versions 3.0 and later, and hpaCC for the HP ANSI C++ compiler.
set debug-file-directory dir show debug-file-directory Look in dir for separate debugging information files. For use on systems where debugging information is not included in executable files.
set demangle-style style show demangle-style Choose the scheme used to convert a "mangled" name back into the original Objective C or C++ name. Available values for style are:
show directories Print the current search path of directories that contain source files.
set disassembly-flavor flavor show disassembly-flavor The current instruction set for printing machine-level instructions. This command is currently defined only for the Intel x86 architecture. The flavor is either intel or att; the default is att.
set editing show editing
Enable editing of command lines as they are typed.
set environment variable[=value] show environment [variable]
Set environment variable variable to optional value or to the empty string. With no variable, show the entire environment. Otherwise, show the value of the given variable.
set exec-done-display show exec-done-display
Enable notification of completion for asynchronous execution commands.
set extension-language .ext lang show extension-language Associate filename extension .ext with programming language lang.
set follow-fork-mode mode show follow-fork-mode
Choose which process GDB should continue to debug when the debuggee creates a new process. The value of mode is parent if GDB should follow the parent, or child if GDB should follow the child.
set gnutarget format show gnutarget The current file format of the debuggee (core file, executable, .o file). The default is auto, and is probably best left that way.
set height count show height
The number of lines GDB thinks are in a page. Use 0 to keep GDB from pausing.
set history feature show history feature
Control different aspects of GDB's command history. Values and meanings for feature are as follows:
set input-radix base show input-radix
The default input radix for entering numbers. Acceptable values for base are 8, 10, and 16. The value must be entered unambiguously (leading 0 for octal, leading 0x or 0X for hexadecimal), or in the current input radix.
set language lang show language
Set the source language to lang. Normally, GDB is able to determine the source language from information in the executable file.
set listsize count show listsize
The number of source lines GDB lists with the list command.
set logging set logging option value show logging
With the usual on and off values, set logging enables and disables logging of GDB command output . With an option and value, the particular logging option is set to value. Logging Options
set max-user-call-depth limit show max-user-call-depth
Set the maximum number of recursive calls to a user-defined command to limit. When the limit is exceeded, GDB assumes that the command has gone into infinite recursion and aborts with an error.
set opaque-type-resolution show opaque-type-resolution
Resolve opaque struct/class/union types when loading symbols. That is, if one file uses a type opaquely (struct foo *), find the definition for that type in the file that defines it.
set osabi os-abi-type show osabi
The Operating System/Application Binary Interface of the debuggee. The default is auto, which means GDB figures it out automatically. Use this if you need to override GDB's guess.
set output-radix base show output-radix
The default output radix for displaying numbers. Acceptable values for base are 8, 10, and 16. The value must be entered unambiguously (leading 0 for octal, leading 0x or 0X for hexadecimal), or in the current input radix.
set overload-resolution show overload-resolution
When calling an overloaded function from GDB, search for a function whose signature matches the types of the arguments.
set pagination show pagination
Enable/disable pagination of output. Default is on.
show paths Display the current search path for executable programs (the PATH environment variable). This path is also used to find object files. set print print-opt show print print-opt
GDB lets you control the printing of many different aspects of the debuggee. Many of these options are enabled by typing either set print option-name or set print option-name on. Using off instead of on disables the particular printing option. You can use show print option-name to see if the option's printing setting is on or off. The values for print-opt, and descriptions of GDB's behavior when a particular print-opt is on, are presented in the following list.
set prompt string show prompt
Set GDB 's prompt to string, or show the prompt string. The default prompt is (gdb).
set radix base show radix Set the input and output radixes to the same number. Acceptable values for base are 8, 10, and 16. The value must be entered unambiguously (leading 0 for octal, leading 0x or 0X for hexadecimal), or in the current input radix. See also input-radix and output-radix.
set scheduler-locking show scheduler-locking
On some operating systems, control the scheduling of other threads (those not being traced) in the debuggee. The value is one of on, off, or step. If set to off, all threads run, with the chance that a different thread could pre-empt the debugger (hit a breakpoint, catch a signal, etc.). When set to on, GDB only allows the current thread to run. When set to step, the scheduler locks only during single-stepping operations.
set solib-absolute-prefix path show solib-absolute-prefix
Use path as the prefix for any absolute paths to shared libraries. This is mainly useful for cross-debugging, to find the target's shared libraries when debugging on a host.
set solib-search-path path show solib-search-path
Search the colon separated list of directories in path to find a shared library. GDB searches this path after trying solib-absolute-prefix. This too is mainly useful for cross-debugging.
set step-mode show step-mode
Set the mode of the step command. By default, step does not enter functions that lack debugging information. Setting this variable to on causes GDB to enter such functions, allowing you to examine the machine-level instructions.
set stop-on-solib-events show stop-on-solib-events Stop when a shared library event occurs. The most common such events are the loading and unloading of a shared library.
set symbol-reloading show symbol-reloading On systems that support automatic relinking (such as VxWorks), reload the symbol table when an object file has changed.
set trust-readonly-sections show trust-readonly-sections
Believe that read-only sections will remain read-only. This allows GDB to fetch the contents from the object file, instead of from a possibly remote debuggee. This is useful primarily for remote debugging.
set tui feature value show tui feature
Set the TUI feature feature to value. TUI Features
show values [valnum] show values + With no arguments, print the last 10 values in the value history (see the earlier section "The Value History"). With valnum, print 10 values centered around that value history item number. With +, print 10 more saved values following the one most recently printed.
set variable assignment Ensure that assignment actually affects a program variable instead of a GDB variable.
set verbose show verbose
Enable display of informative messages during long operations. This reassures you that GDB is still alive.
show version Show the current version of GDB.
show warranty Display the "no warranty" provisions from the GNU General Public License (GPL).
set watchdog seconds show watchdog
Wait no more than seconds seconds for a remote target to finish a low-level stepping or continuation operation. If the timeout expires, GDB reports an error.
set width numchars show width
Set the number of characters allowed in a line. Use a value of 0 to keep GDB from wrapping long lines.
set write show write
Allow GDB to write into the executable and core files. The default is off. |
< Day Day Up > |