【问题标题】:does gdb has something similar to struct command of crash utilitygdb 是否有类似于崩溃实用程序的 struct 命令的东西
【发布时间】:2017-06-20 05:43:17
【问题描述】:

我想转储ovs-vswitchd的内部数据结构。

(gdb) print/x all_dpif_backers
$11 = {
    map = {
        buckets = 0x7e0e28,
        one = 0x23467f0,
        mask = 0x0,
        n = 0x1
    }
}

现在我知道 0x23467f0 是 struct hmap_node 的地址。如果使用崩溃 实用程序,我可以像这样转储值: 崩溃>结构hmap_node 0x23467f0 我们如何使用 gdb 做到这一点?

【问题讨论】:

  • 也许我应该这样做:p/x (struct shash_node)*0x23467f0

标签: gdb crash-dumps


【解决方案1】:

我们如何使用 gdb 做到这一点?

(gdb) print *(struct hmap_node*) 0x23467f0

或者

(gdb) print (struct hmap_node*) 0x23467f0
$1 = ...
(gdb) print *$1

另见 GDB pretty printing

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-15
    • 1970-01-01
    • 1970-01-01
    • 2011-12-04
    • 2011-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多