Show all declarations of a specific expression.
whereis name
name |
An identifier or typedef name of the expression. |
The whereis command lists all declarations of a variable and each declaration's fully qualified scope information.
The scope information of a variable usually consists of the name of the source file that contains the function in which the variable is declared, the name of that function, and the name of the variable. The components of the scope information are separated by back-quotes ().
You can use this command to obtain information needed to differentiate overloaded identifiers that are in different units, or within different routines in the same unit.
The following example shows how to set breakpoints in two C++ methods, both named printBody:
(idb) whereis printBody "/home/user/examples/solarSystemSrc/heavenlyBody.cxx"HeavenlyBody::printBody(const class HeavenlyBody*, unsigned int) "/home/user/examples/solarSystemSrc/planet.cxx"Moon::printBody(unsigned int) const "/home/user/examples/solarSystemSrc/planet.cxx"Moon::printBody(unsigned int) const "/home/user/examples/solarSystemSrc/planet.cxx"Planet::printBody(unsigned int) const "/home/user/examples/solarSystemSrc/planet.cxx"Planet::printBody(unsigned int) const "/home/user/examples/solarSystemSrc/star.cxx"Star::printBody(unsigned int) const "/home/user/examples/solarSystemSrc/star.cxx"Star::printBody(unsigned int) const (idb) stop in "star.h"Star::printBody Select from ---------------------------------------------------- 1 /home/user/examples/solarSystemSrc/main/solarSystem.cxx 2 /home/user/examples/solarSystemSrc/star.cxx 3 None of the above ---------------------------------------------------- 1 [#2: stop in virtual void Star::printBody(unsigned int) const]
See also the which command for another example of the whereis command.
If you are not sure how to spell a symbol, you can use the whereis command to search the symbol table for the regular expression represented by the quoted string. All symbols that match the rules of the regular expression are displayed in ascending order. For example:
(idb) whereis planet Symbol not found (idb) whereis "[Pp]lanet" "solarSystemSrc/derived_class_includes/planet.h"Moon::Moon(char*, Megameters, Kilometers, class Planet*) "solarSystemSrc/derived_class_includes/planet.h"Planet "solarSystemSrc/derived_class_includes/planet.h"Planet "solarSystemSrc/derived_class_includes/planet.h"Planet "solarSystemSrc/derived_class_includes/planet.h"Planet::Planet(char*, Megameters, class HeavenlyBody*) "solarSystemSrc/derived_class_includes/planet.h"Planet::Planet(char*, Megameters, class HeavenlyBody*) "solarSystemSrc/derived_class_includes/planet.h"Planet::print(unsigned int) "solarSystemSrc/derived_class_includes/planet.h"__INTER__Moon_Moon_Orbit_Planet_Xv "solarSystemSrc/derived_class_includes/planet.h"__INTER__Planet_Planet_Orbit_Xv "solarSystemSrc/derived_class_includes/planet.h"__dt__6PlanetXv __T_6Planet __cxxexsig6Planet __vtbl_5Orbit6Planet __vtbl_5Orbit6Planet4Moon __vtbl_6Planet solarSystemSrc/derived_class_includes/planet.h solarSystemSrc/derived_class_includes/planet.h solarSystemSrc/derived_class_includes/planet.h solarSystemSrc/planet.cxx (idb) whereis "^Planet$" "solarSystemSrc/derived_class_includes/planet.h"Planet "solarSystemSrc/derived_class_includes/planet.h"Planet "solarSystemSrc/derived_class_includes/planet.h"Planet "solarSystemSrc/derived_class_includes/planet.h"Planet::Planet(char*, Megameters, class HeavenlyBody*) (idb) whereis Planet "solarSystemSrc/derived_class_includes/planet.h"Planet "solarSystemSrc/derived_class_includes/planet.h"Planet "solarSystemSrc/derived_class_includes/planet.h"Planet "solarSystemSrc/derived_class_includes/planet.h"Planet::Planet(char*, Megameters, class HeavenlyBody*) (idb) which Planet "solarSystemSrc/derived_class_includes/planet.h"Planet (idb) whatis Planet class Planet : HeavenlyBody, Orbit { Planet(char*, Megameters, class HeavenlyBody*); virtual void print(unsigned int); }
You can use the $symbolsearchlimit debugger variable to specify the maximum number of symbols that will be returned by the whereis command for a regular expression search. The default value for the $symbolsearchlimit variable is 100; a value of 0 indicates no limit.
Copyright © 1996-2010, Intel Corporation. All rights reserved.