9.2.1 Linespec Locations
A linespec is a colon-separated list of source location parameters such
as file name, function name, etc. Here are all the different ways of
specifying a linespec:
- Specifies the line number linenum of the current source file.
- Specifies the line offset lines before or after the current
line. For the
list command, the current line is the last one
printed; for the breakpoint commands, this is the line at which
execution stopped in the currently selected stack frame
(see Frames, for a description of stack frames.) When
used as the second of the two linespecs in a
this specifies the line offset lines up or down from the first
- Specifies the line linenum in the source file filename.
If filename is a relative file name, then it will match any
source file name with the same trailing components. For example, if
filename is ‘gcc/expr.c’, then it will match source file
name of /build/trunk/gcc/expr.c, but not
/build/trunk/libcpp/expr.c or /build/trunk/gcc/x-expr.c.
- Specifies the line that begins the body of the function function.
For example, in C, this is the line with the open brace.
- Specifies the line where label appears in function.
- Specifies the line that begins the body of the function function
in the file filename. You only need the file name with a
function name to avoid ambiguity when there are identically named
functions in different source files.
- Specifies the line at which the label named label appears
in the function corresponding to the currently selected stack frame.
If there is no current selected stack frame (for instance, if the inferior
is not running), then gdb will not search for a label.
- The gnu/Linux tool
SystemTap provides a way for
applications to embed static probes. See Static Probe Points, for more
information on finding and using static probes. This form of linespec
specifies the location of such a static probe.
If objfile is given, only probes coming from that shared library
or executable matching objfile as a regular expression are considered.
If provider is given, then only probes from that provider are considered.
If several probes match the spec, gdb will insert a breakpoint at
each one of those probes.