gdb: getting into a dictionary
i saw this post today: How to view contents of NSDictionary variable in Xcode debugger?. i need to see the contents of 开发者_如何学Goa dictonary but i only know the "key"...is there a way i can spit out the details like a print_r in php? po gives me the object, but i would like to go deeper
po 0x2027c0 NSCFDictionary
In the Xcode debugger, right click on the dictionary in the debugger window and select "print description to console", or in the GDB console window, type print-object myDictionary
where myDictionary is a reference to the dictionary you want to print e.g.
(gdb) print-object myDictionary
{
bar = foo;
biz = baz;
}
I don't know about mono, but when I, some time ago, took a look at Quake3 (written in C) in GDB, I had to do this
(gdb) print pak_checksums@9
To print out
static const unsigned pak_checksums[] =
{
1566731103u,
298122907u,
412165236u,
2991495316u,
1197932710u,
4087071573u,
3709064859u,
908855077u,
977125798u
};
And the result was:
$1 = {1566731103, 298122907, 412165236, -1303471980, 1197932710, -207895723,
-585902437, 908855077, 977125798}
[Real checksums changed for this example ;-)) ]
精彩评论