Supported Languages; C And C - Red Hat ENTERPRISE LINUX 3 - DEBUGGING WITH GDB Manual

Debugging with gdb
Hide thumbs Also See for ENTERPRISE LINUX 3 - DEBUGGING WITH GDB:
Table of Contents

Advertisement

Chapter 14. Using gdb with Different Languages
an error. In many implementations of C, mathematical overflow causes the result to "wrap around" to
lower values--for example, if
+ 1 =>
m
s
This, too, is specific to individual languages, and in some cases specific to individual compilers or
machines. Refer to Section 14.4 Supported languages, for further details on specific languages.
gdb provides some additional commands for controlling the range checker:
set check range auto
Set range checking on or off based on the current working language. Refer to Section 14.4 Sup-
ported languages, for the default settings for each language.
set check range on
set check range off
Set range checking on or off, overriding the default setting for the current working language. A
warning is issued if the setting does not match the language default. If a range error occurs and
range checking is on, then a message is printed and evaluation of the expression is aborted.
set check range warn
Output messages when the gdb range checker detects a range error, but attempt to evaluate the
expression anyway. Evaluating the expression may still be impossible for other reasons, such as
accessing memory that the process does not own (a typical example from many Unix systems).
show range
Show the current setting of the range checker, and whether or not it is being set automatically by
gdb.

14.4. Supported languages

gdb supports C, C++, Objective-C, Fortran, Java, assembly, and Modula-2. Some gdb features may
be used in expressions regardless of the language you use: the gdb
construct (refer to Section 10.1 Expressions) can be used with the constructs of any
{type}addr
supported language.
The following sections detail to what degree each source language is supported by gdb. These sections
are not meant to be language tutorials or references, but serve only as a reference guide to what the gdb
expression parser accepts, and what input and output formats should look like for different languages.
There are many good books written on each of these languages; please look to these for a language
reference or tutorial.

14.4.1. C and C++

Since C and C++ are so closely related, many features of gdb apply to both languages. Whenever this
is the case, we discuss those languages together.
The C++ debugging facilities are jointly implemented by the C++ compiler and gdb. Therefore, to
debug your C++ code effectively, you must compile your C++ programs with a supported C++
compiler, such as gnu
is the largest integer value, and
m
, or the HP ANSI C++ compiler (
g++
is the smallest, then
s
and
@
::
).
aCC
113
operators, and the

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 3 - DEBUGGING WITH GDB and is the answer not in the manual?

Questions and answers

Table of Contents