4
我有一個全局變量,它的名稱有多個符號,我想打印所有這些符號。例如:在GDB中,我該如何解決重複的符號
(gdb) info var g_reallocCount
All variables matching regular expression "g_reallocCount":
File sv.c:
long int g_reallocCount;
long int g_reallocCount;
long int g_reallocCount;
long int g_reallocCount;
,當我嘗試使用「打印g_reallocCount」我得到的結果只有一個,這不是我需要的人。
我相信我有多個符號的原因是我正在改變的靜態庫鏈接到多個加載的模塊。目前我不確定我是否可以改變這一事實。
感謝
這是這個問題。一個最簡單的測試用例就是在共享庫中聲明一個隱藏變量,並在與這樣的庫鏈接的可執行二進制文件中聲明具有相同名稱的靜態變量。 –