which (idb モードのみ)

式のフルスコープを表示します。

構文

which name  

パラメーター

name

式の識別子または typedef の名前。

説明

このコマンドは、式のフルスコープを表示します。

このコマンドを使用して、識別子が解決する宣言を特定します。このコマンドは、現在のスコープから見える指定された式のインスタンスについて完全修飾されたスコープ情報を表示します。

変数のスコープ情報は、通常、変数が宣言されている関数を含むソースファイルの名前、関数の名前、変数の名前で構成されます。スコープ情報の要素はバッククォートで区切られます。

次の例は、whereis コマンドと which コマンドを使用して変数のスコープを特定する方法を表示します。

(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 

このヘルプトピックについてのフィードバックを送信