Chapter 14. Using gdb with Different Languages
125
14.4.3.3. Constants
gdb allows you to express the constants of Modula-2 in the following ways:
•
Integer constants are simply a sequence of digits. When used in an expression, a constant is inter-
preted to be type-compatible with the rest of the expression. Hexadecimal integers are specified by
a trailing
H
, and octal integers by a trailing
B
.
•
Floating point constants appear as a sequence of digits, followed by a decimal point and another
sequence of digits. An optional exponent can then be specified, in the form
E[+|-]
nnn
, where
[+|-]
nnn
is the desired exponent. All of the digits of the floating point constant must be valid
decimal (base 10) digits.
•
Character constants consist of a single character enclosed by a pair of like quotes, either single
(
’
) or double (
"
). They may also be expressed by their ordinal value (their ascii value, usually)
followed by a
C
.
•
String constants consist of a sequence of characters enclosed by a pair of like quotes, either single
(
’
) or double (
"
). Escape sequences in the style of C are also allowed. Refer to Section 14.4.1.2
C
and C++constants
, for a brief explanation of escape sequences.
•
Enumerated constants consist of an enumerated identifier.
•
Boolean constants consist of the identifiers
TRUE
and
FALSE
.
•
Pointer constants consist of integral values only.
•
Set constants are not yet supported.
14.4.3.4. Modula-2 defaults
If type and range checking are set automatically by gdb, they both default to
on
whenever the working
language changes to Modula-2. This happens regardless of whether you or gdb selected the working
language.
If you allow gdb to set the language automatically, then entering code compiled from a file whose
name ends with
.mod
sets the working language to Modula-2. Refer to Section 14.1.3
Having gdb
infer the source language
, for further details.
14.4.3.5. Deviations from standard Modula-2
A few changes have been made to make Modula-2 programs easier to debug. This is done primarily
via loosening its type strictness:
•
Unlike in standard Modula-2, pointer constants can be formed by integers. This allows you to
modify pointer variables during debugging. (In standard Modula-2, the actual address contained in
a pointer variable is hidden from you; it can only be modified through direct assignment to another
pointer variable or expression that returned a pointer.)
•
C escape sequences can be used in strings and characters to represent non-printable characters.
gdb prints out strings with these escape sequences embedded. Single non-printable characters are
printed using the
CHR(
nnn
)
format.
•
The assignment operator (
:=
) returns the value of its right-hand argument.
•
All built-in procedures both modify
and
return their argument.
Summary of Contents for ENTERPRISE LINUX 3 - SECURITY GUIDE
Page 1: ...Red Hat Enterprise Linux 3 Debugging with gdb ...
Page 12: ...2 Chapter 1 Debugging with gdb ...
Page 28: ...18 Chapter 4 Getting In and Out of gdb ...
Page 34: ...24 Chapter 5 gdb Commands ...
Page 44: ...34 Chapter 6 Running Programs Under gdb ...
Page 68: ...58 Chapter 8 Examining the Stack ...
Page 98: ...88 Chapter 10 Examining Data ...
Page 112: ...102 Chapter 12 Tracepoints ...
Page 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Page 138: ...128 Chapter 14 Using gdb with Different Languages ...
Page 144: ...134 Chapter 15 Examining the Symbol Table ...
Page 170: ...160 Chapter 19 Debugging remote programs ...
Page 198: ...188 Chapter 21 Controlling gdb ...
Page 204: ...194 Chapter 22 Canned Sequences of Commands ...
Page 206: ...196 Chapter 23 Command Interpreters ...
Page 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Page 296: ...286 Chapter 27 gdb Annotations ...
Page 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Page 322: ...312 Chapter 30 Using History Interactively ...
Page 362: ...352 Appendix D gdb Remote Serial Protocol ...
Page 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Page 386: ...376 Appendix G GNU Free Documentation License ...
Page 410: ......