Download GDB User Manual - C programming language ressources

Transcript
130
Debugging with gdb
break create
You must specify the complete method name, including any colons. If your program’s
source files contain more than one create method, you’ll be presented with a numbered
list of classes that implement that method. Indicate your choice by number, or type ‘0’ to
exit if none apply.
As another example, to clear a breakpoint established at the makeKeyAndOrderFront:
method of the NSWindow class, enter:
clear -[NSWindow makeKeyAndOrderFront:]
12.4.2.2 The Print Command With Objective-C
The print command has also been extended to accept methods. For example:
print -[object hash]
will tell gdb to send the hash message to object and print the result. Also, an additional
command has been added, print-object or po for short, which is meant to print the
description of an object. However, this command may only work with certain Objective-C
libraries that have a particular hook function, _NSPrintForDebugger, defined.
12.4.3 Fortran
gdb can be used to debug programs written in Fortran, but it currently supports only the
features of Fortran 77 language.
Some Fortran compilers (gnu Fortran 77 and Fortran 95 compilers among them) append
an underscore to the names of variables and functions. When you debug programs compiled by those compilers, you will need to refer to variables and functions with a trailing
underscore.
12.4.3.1 Fortran Operators and Expressions
Operators must be defined on values of specific types. For instance, + is defined on numbers,
but not on characters or other non- arithmetic types. Operators are often defined on groups
of types.
**
The exponentiation operator. It raises the first operand to the power of the
second one.
:
The range operator. Normally used in the form of array(low:high) to represent
a section of array.
12.4.3.2 Fortran Defaults
Fortran symbols are usually case-insensitive, so gdb by default uses case-insensitive matches
for Fortran symbols. You can change that with the ‘set case-insensitive’ command, see
Chapter 13 [Symbols], page 143, for the details.
12.4.3.3 Special Fortran Commands
gdb has some commands to support Fortran-specific features, such as displaying common
blocks.