特定の式のすべての宣言を表示します。
whereis コマンドは、すべての変数の宣言と各宣言の完全修飾のスコープ情報をリストします。
変数のスコープ情報は、通常、変数が宣言されている関数を含むソースファイルの名前、関数の名前、変数の名前で構成されます。スコープ情報の要素はバッククォートで区切られます。
このコマンドを使用して、異なるユニットにある多重定義された識別子や同じユニットにある異なるルーチンを区別するのに必要な情報を入手できます。
次の例は、どちらも printBody という名前の 2 つの C++ メソッドにおけるブレークポイントの設定方法を示しています。
(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]
whereis コマンドのその他の例については、which コマンドの例を参照してください。
シンボルのスペルが不確かな場合は、whereis コマンドを使用して、引用符で囲まれた文字列で示す正規表現でシンボルテーブルを検索できます。正規表現の規則に一致するすべてのシンボルが昇順で表示されます。次に例を示します。
(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); }
$symbolsearchlimit デバッガー変数を使用して、正規表現による検索で whereis コマンドで返される最大シンボル数を指定できます。$symbolsearchlimit 変数のデフォルト値は 100 です。0 は無制限を意味します。