116
Chapter 14. Using gdb with Different Languages
.*, -
4
*
Dereferences of pointers to members.
[]
Array indexing.
a
[
i
]
is defined as
*(
a
+
i
)
. Same precedence as
-
4
.
()
Function parameter list. Same precedence as
-
4
.
::
C
++
scope resolution operator. Defined on
struct
,
union
, and
class
types.
::
Doubled colons also represent the gdb scope operator (refer to Section 10.1
Expressions
). Same
precedence as
::
, above.
If an operator is redefined in the user code, gdb usually attempts to invoke the redefined version instead
of using the operator’s predefined meaning.
14.4.1.2. C and C
++
constants
gdb allows you to express the constants of C and C
++
in the following ways:
•
Integer constants are a sequence of digits. Octal constants are specified by a leading
0
(that is, zero),
and hexadecimal constants by a leading
0x
or
0X
. Constants may also end with a letter
l
, specifying
that the constant should be treated as a
long
value.
•
Floating point constants are a sequence of digits, followed by a decimal point, followed by a
sequence of digits, and optionally followed by an exponent. An exponent is of the form:
e[[+]|-]
nnn
, where
nnn
is another sequence of digits. The
+
is optional for positive exponents.
A floating-point constant may also end with a letter
f
or
F
, specifying that the constant should be
treated as being of the
float
(as opposed to the default
double
) type; or with a letter
l
or
L
,
which specifies a
long double
constant.
•
Enumerated constants consist of enumerated identifiers, or their integral equivalents.
•
Character constants are a single character surrounded by single quotes (
’
), or a number--the ordinal
value of the corresponding character (usually its ascii value). Within quotes, the single character
may be represented by a letter or by
escape sequences
, which are of the form
\
nnn
, where
nnn
is
the octal representation of the character’s ordinal value; or of the form
\
x
, where
x
is a predefined
special character--for example,
\n
for newline.
•
String constants are a sequence of character constants surrounded by double quotes (
"
). Any valid
character constant (as described above) may appear. Double quotes within the string must be pre-
ceded by a backslash, so for instance
"a\"b’c"
is a string of five characters.
•
Pointer constants are an integral value. You can also write pointers to constants using the C operator
&
.
•
Array constants are comma-separated lists surrounded by braces
{
and
}
; for example,
{1,2,3}
is a
three-element array of integers,
{{1,2}, {3,4}, {5,6}}
is a three-by-two array, and
{&"hi",
&"there", &"fred"}
is a three-element array of pointers.
Содержание ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Страница 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Страница 12: ...2 Chapter 1 Debugging with gdb ...
Страница 28: ...18 Chapter 4 Getting In and Out of gdb ...
Страница 34: ...24 Chapter 5 gdb Commands ...
Страница 44: ...34 Chapter 6 Running Programs Under gdb ...
Страница 68: ...58 Chapter 8 Examining the Stack ...
Страница 98: ...88 Chapter 10 Examining Data ...
Страница 112: ...102 Chapter 12 Tracepoints ...
Страница 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Страница 138: ...128 Chapter 14 Using gdb with Different Languages ...
Страница 144: ...134 Chapter 15 Examining the Symbol Table ...
Страница 170: ...160 Chapter 19 Debugging remote programs ...
Страница 198: ...188 Chapter 21 Controlling gdb ...
Страница 204: ...194 Chapter 22 Canned Sequences of Commands ...
Страница 206: ...196 Chapter 23 Command Interpreters ...
Страница 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Страница 296: ...286 Chapter 27 gdb Annotations ...
Страница 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Страница 322: ...312 Chapter 30 Using History Interactively ...
Страница 362: ...352 Appendix D gdb Remote Serial Protocol ...
Страница 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Страница 386: ...376 Appendix G GNU Free Documentation License ...
Страница 410: ......