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:
-
offset+
offsetlist
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 list
command,
this specifies the line offset lines up or down from the first
linespec.
:
linenumBy default, in C++ and Ada, function is interpreted as specifying all functions named function in all scopes. For C++, this means in all namespaces and classes. For Ada, this means in all packages.
For example, assuming a program with C++ symbols named
A::B::func
and B::func
, both commands break func and break B::func set a breakpoint on both symbols.
Commands that accept a linespec let you override this with the
-qualified
option. For example, break -qualified func sets a breakpoint on a free-function named func
ignoring
any C++ class methods and namespace functions called func
.
See Explicit Locations.
:
label:
function-pstap|-probe-stap
[objfile:
[provider:
]]nameSystemTap
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.