Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
定義されていると仮定します: とint a[100] 入力するとprint a、gdb は自動的にそれを配列として表示します: 1, 2, 3, 4...。ただし、aがパラメーターとして関数に渡されると、gdb はそれを通常の int ポインターとして扱い、typeprint aは次のように表示します(int *)0x7fffffffdaa0。a配列として表示したい場合はどうすればよいですか?
int a[100]
print a
1, 2, 3, 4...
a
(int *)0x7fffffffdaa0
*(T (*)[N])pここで、T は型、N は要素の数、p はポインターです。
*(T (*)[N])p
コマンドを使用しxます。
x
(gdb) x/100w a