17.7. Summary of set and show Commands

 < 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.

annotate

 set annotate level show annotate

Set the annotation_level variable to level. GUI programs that call GDB as a subsidiary process use this variable.

architecture

 set architecture architecture show architecture

Set the architecture of target to architecture. Primarily used in cross-debugging.

args

 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."

auto-solib-add

 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.

auto-solib-limit

 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.

backtrace

 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.

breakpoint

 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.

can-use-hw-watchpoints

 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.

case-sensitive

 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.

coerce-float-to-double

 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.

commands

 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.

complaints

 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."

confirm

 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.

convenience

 show convenience

Print a list of convenience variables used so far, along with their values. Can be abbreviated show conv.

copying

 show copying

Display the GNU General Public License (GPL).

cp-abi

 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.

debug-file-directory

 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.

demangle-style

 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:

arm

Use the algorithm given in The Annotated C++ Reference Manual (see the Bibliography). The GDB documentation warns that this setting alone does not allow debugging of code produced by cfront.

auto

GDB attempts to figure out the demangling style.

gnu

Use the same scheme as that of the GNU C++ compiler (g++). This is the default.

hp

Use the scheme of HP's ANSI C++ compiler, aCC.

lucid

Use the scheme from Lucid's C++ compiler, lcc.

a In practice this isn't likely to be an issue; cfront-based C++ compilers are no longer common.


directories

 show directories

Print the current search path of directories that contain source files.

disassembly-flavor

 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.

editing

 set editing show editing

Enable editing of command lines as they are typed.

environment

 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.

exec-done-display

 set exec-done-display show exec-done-display

Enable notification of completion for asynchronous execution commands.

extension-language

 set extension-language .ext lang show extension-language

Associate filename extension .ext with programming language lang.

follow-fork-mode

 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.

gnutarget

 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.

height

 set height count show height

The number of lines GDB thinks are in a page. Use 0 to keep GDB from pausing.

history

 set history feature show history feature

Control different aspects of GDB's command history. Values and meanings for feature are as follows:


set history expansion, show history expansion

Use csh-style ! commands for history operations. The default is off.


set history filename file, show history filename

Save the command history to file, and restore it from there upon startup. This overrides the default filename, which is taken from the value of the environment variable GDBHISTFILE if it is set. Otherwise, the default filename is ./.gdb_history.


set history save, show history save

Enable saving/restoring of the command history.


set history size amount, show history size

Limit the number of saved history commands to amount.

input-radix

 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.

language

 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.

listsize

 set listsize count show listsize

The number of source lines GDB lists with the list command.

logging

 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


file

The file to which GDB logs command output. The default is gdb.txt.


overwrite

If set, overwrite the log file each time. Otherwise GDB appends to it.


redirect

If set, send output to the log file only. The default outputs to both the terminal and the log file.

max-user-call-depth

 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.

opaque-type-resolution

 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.

osabi

 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.

output-radix

 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.

overload-resolution

 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.

pagination

 set pagination show pagination

Enable/disable pagination of output. Default is on.

paths

 show paths

Display the current search path for executable programs (the PATH environment variable). This path is also used to find object files.

print

 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 print address, show print address

Include the program counter in stack frame information.


set print array, show print array

Prettyprint arrays. This is easier to read but takes up more space. Default is off.


set print asm-demangle, show print asm-demangle

Demangle C++/Objective C names, even in disassembly listings.


set print demangle, show print demangle

Demangle C++/Objective C names in output.


set print elements count, show print elements

Print no more than count elements from an array. The default is 200; a value of 0 means "unlimited."


set print null-stop, show print null-stop

Stop printing array elements upon encountering one set to zero (ASCII NUL for character arrays, hence the name). Default is off.


set print object, show print object

For a pointer, print the pointed-to object's actual type, which is derived from virtual function table information, instead of the declared type. The default is off, which prints the declared type.


set print pascal_static-members


show print pascal_static-members

Print Pascal static members.


set print pretty, show print pretty

Prettyprint structures, one element per line, with indentation to convey nesting.


set print sevenbit-strings, show print sevenbit-strings

Print 8-bit characters in strings as \nnn.


set print static-members, show print static-members

Print static members when displaying a C++ object.


set print symbol-filename, show print symbol-filename

When printing the symbolic form of an address, include the source filename and line number.


set print union, show print union

Print unions inside structures.


set print vtbl, show print vtbl

Prettyprint C++ virtual function tables. The default is off.


set print max-symbolic-offset max


show print max-symbolic-offset

When displaying addresses, only use the symbol + offset form if the offset is less than max. The default is 0, which means "unlimited."

prompt

 set prompt string show prompt

Set GDB 's prompt to string, or show the prompt string. The default prompt is (gdb).

radix

 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.

scheduler-locking

 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.

solib-absolute-prefix

 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.

solib-search-path

 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.

step-mode

 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.

stop-on-solib-events

 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.

symbol-reloading

 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.

trust-readonly-sections

 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.

tui

 set tui feature value show tui feature

Set the TUI feature feature to value.

TUI Features


set tui active-border-mode mode


show tui active-border-mode

Choose/show the curses library attribute for the border of the active window. Available choices are normal, standout, half, half-standout, bold, and bold-standout.


set tui border-kind kind, show tui border-kind

Set/show the characters used to draw the border to one of the following:

acs

Draw borders using the Alternate Character Set (line drawing characters) if the terminal supports it.

ascii

Draw borders using the regular characters +, -, and |.

space

Draw borders using space characters.



set tui border-mode mode, show tui border-mode

Choose/show the curses library attribute for the border of the other, nonactive windows. Available choices are normal, standout, half, half-standout, bold, and bold-standout.

values

 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.

variable

 set variable assignment

Ensure that assignment actually affects a program variable instead of a GDB variable.

verbose

 set verbose show verbose

Enable display of informative messages during long operations. This reassures you that GDB is still alive.

version

 show version

Show the current version of GDB.

warranty

 show warranty

Display the "no warranty" provisions from the GNU General Public License (GPL).

watchdog

 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.

width

 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.

write

 set write show write

Allow GDB to write into the executable and core files. The default is off.

     < Day Day Up > 


    Unix in a Nutshell
    Unix in a Nutshell, Fourth Edition
    ISBN: 0596100299
    EAN: 2147483647
    Year: 2005
    Pages: 201

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net