I compiled a very simple java program with gcj-4.4 and -o option. I loaded it in gdb-7.2 and tried to do some debugging. I noticed at I could print the variables in int type but I could not print an array of int. I received this error message:
我用gcj-4.4和-o选项编译了一个非常简单的java程序。我在gdb-7.2中加载它并尝试进行一些调试。我注意到我可以在int类型中打印变量,但我无法打印int数组。我收到此错误消息:
(gdb) p orderFinish[0]
cannot find java.lang.Object
(gdb) p (int)orderFinish
$8 = -136261440
(gdb) p orderFinish[3]
cannot find java.lang.Object
(gdb) p in
$9 = 1
(gdb) whatis orderFinish
type = int[]
So my question is how can I print a Java array in gdb? My OS is openSUSE-11.1 x64-86bit. Thanks!
所以我的问题是如何在gdb中打印Java数组?我的操作系统是openSUSE-11.1 x64-86bit。谢谢!
1 个解决方案
#1
0
Its been a while since I used GDB but p *array-variable@length should work.
自从我使用GDB以来已经有一段时间了,但是p * array-variable @ length应该可行。
Source: http://www.yolinux.com/TUTORIALS/GDB-Commands.html
资料来源:http://www.yolinux.com/TUTORIALS/GDB-Commands.html
#1
0
Its been a while since I used GDB but p *array-variable@length should work.
自从我使用GDB以来已经有一段时间了,但是p * array-variable @ length应该可行。
Source: http://www.yolinux.com/TUTORIALS/GDB-Commands.html
资料来源:http://www.yolinux.com/TUTORIALS/GDB-Commands.html