diff options
author | Roland Pesch <pesch@cygnus> | 1992-07-11 03:08:13 +0000 |
---|---|---|
committer | Roland Pesch <pesch@cygnus> | 1992-07-11 03:08:13 +0000 |
commit | 6c380b13e613f2aaf4f2367340002498ed04c6c0 (patch) | |
tree | 5fb586b388b43b1261a6f503e2c76ebb4b901c70 /gdb/doc | |
parent | 5a2c1d8583d6bd6c7a5f404e8733f7b4d9826a82 (diff) | |
download | gdb-6c380b13e613f2aaf4f2367340002498ed04c6c0.zip gdb-6c380b13e613f2aaf4f2367340002498ed04c6c0.tar.gz gdb-6c380b13e613f2aaf4f2367340002498ed04c6c0.tar.bz2 |
First attempt at doc for general uses of quotes around symbols.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/gdb.texinfo | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 398f500..4f31975 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -3635,7 +3635,13 @@ using the colon-colon notation: @noindent Here @var{file} or @var{function} is the name of the context for the -static @var{variable}. +static @var{variable}. In the case of file names, you can use quotes to +make sure _GDBN__ parses the file name as a single word---for example, +to print a global value of @code{x} defined in @file{f2.c}: + +@example +(_GDBP__) p 'f2.c'::x +@end example @cindex C++ scope resolution This use of @samp{::} is very rarely in conflict with the very similar @@ -5672,6 +5678,27 @@ program's symbol table, in the file indicated when you started _GDBN__ (@pxref{File Options, ,Choosing Files}), or by one of the file-management commands (@pxref{Files, ,Commands to Specify Files}). +@c FIXME! This might be intentionally specific to C and C++; if so, move +@c to someplace in C section of lang chapter. +@cindex symbol names +@cindex names of symbols +@cindex quoting names +Occasionally, you may need to refer to symbols that contain unusual +characters, which _GDBN__ ordinarily treats as word delimiters. The +most frequent case is in referring to static variables in other +source files (@pxref{Variables,,Program Variables}). File names +are recorded in object files as debugging symbols, but _GDBN__ would +ordinarily parse a typical file name, like @file{foo.c}, as the three words +@samp{foo} @samp{.} @samp{c}. To allow _GDBN__ to recognize +@samp{foo.c} as a single symbol, enclose it in single quotes; for example, + +@example +p 'foo.c'::x +@end example + +@noindent +looks up the value of @code{x} in the scope of the file @file{foo.c}. + @table @code @item info address @var{symbol} @kindex info address |