f78
An overview of type checking
For the expressions you use in GDB commands, you can tell the GDB type checker
to skip checking; to treat any mismatches as errors and abandon the
expression; or to only issue warnings when type mismatches occur, but evaluate the
expression anyway. When you choose the last of these, GDB evaluates expressions like
the second example, but also issues a warning.
Even if you turn type checking off, there may be other reasons related to type
that prevent GDB from evaluating an expression. For instance, GDB does not
know how to add an
Each language defines to what degree it is strict about type. For instance,
both Modula-2 and C require the arguments to arithmetical operators to be
numbers. In C, enumerated types and pointers can be represented as numbers, so that
they are valid arguments to mathematical operators. See
GDB provides the following additional commands for controlling the type
checker.
set check type off
Set type checking on or off based on the current working language. See Supported languages for the default settings for each language.
Set type checking on or off, overriding the default setting for the current
working language. Issue a warning if the setting does not match the language
default. If any type mismatches occur in evaluating an expression while
typechecking is on, GDB prints a message and aborts evaluation of the expression.
Cause the type checker to issue warnings, but to always attempt to evaluate
the expression. Evaluatin
15e
g the expression may still be impossible for other
reasons. For example, GDB cannot add numbers and structures.
Show the current setting of the type checker, and whether or not GDB is
setting it automatically.