Show the full scope of an expression.
which name
name |
An identifier or typedef name of the expression. |
This command shows the full scope of an expression.
Use this command to determine to which declaration an identifier resolves. This command shows the fully qualified scope information for the instance of the specified expression visible from the current scope.
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 ().
The following example shows how to use the whereis and which commands to determine a variable's scope:
(idb) where 4 >0 0x08053549 in ((Planet*)0x806ae98)->Planet::printBody(i=2) "/home/user/examples/solarSystemSrc/planet.cxx":19 #1 0x0804bacf in ((HeavenlyBody*)0x806ae98)->HeavenlyBody::printBodyAndItsSatellites(i=2) "/home/user/examples/solarSystemSrc/heavenlyBody.cxx":62 #2 0x0804bb0a in ((HeavenlyBody*)0x806ae40)->HeavenlyBody::printBodyAndItsSatellites(i=1) "/home/user/examples/solarSystemSrc/heavenlyBody.cxx":68 #3 0x08056745 in main() "/home/user/examples/solarSystemSrc/main/solarSystem.cxx":120 (idb) which i "/home/user/examples/solarSystemSrc/planet.cxx"Planet::printBody(unsigned int) consti (idb) assign i = 10 (idb) print i 10 (idb) whereis i "/home/user/examples/solarSystemSrc/heavenlyBody.cxx"HeavenlyBody::printBodyAndItsSatellites(unsigned int) consti "/home/user/examples/solarSystemSrc/heavenlyBody.cxx"HeavenlyBody::printBodyAndItsSatellites(unsigned int) consti "/home/user/examples/solarSystemSrc/heavenlyBody.cxx"HeavenlyBody::satelliteNumber(class HeavenlyBody*) consti "/home/user/examples/solarSystemSrc/main/solarSystem.cxx"maini "/home/user/examples/solarSystemSrc/main/solarSystem.cxx"printBiggestMoonsi "/home/user/examples/solarSystemSrc/main/solarSystem.cxx"trackBiggestMoons(class Moon*)i "/home/user/examples/solarSystemSrc/planet.cxx"Moon::printBody(unsigned int) consti "/home/user/examples/solarSystemSrc/planet.cxx"Planet::printBody(unsigned int) consti "/home/user/examples/solarSystemSrc/star.cxx"Star::printBody(unsigned int) consti (idb) func HeavenlyBody::printBodyAndItsSatellites void HeavenlyBody::printBodyAndItsSatellites(unsigned int) const in /home/user/examples/solarSystemSrc/heavenlyBody.cxx line No. 62: 62 printBody(i); {static int somethingToReturnTo; somethingToReturnTo++; } (idb) which i "/home/user/examples/solarSystemSrc/heavenlyBody.cxx"HeavenlyBody::printBodyAndItsSatellites(unsigned int) consti (idb) print i 2
Copyright © 2001-2011, Intel Corporation. All rights reserved.