gpt4 book ai didi

c++ - gdb:显示一些数据的类型信息

转载 作者:IT老高 更新时间:2023-10-28 12:50:07 25 4
gpt4 key购买 nike

基本上我想得到typeid(*this).name(),即this的真实类型。

我想在 GDB 中得到这个(不修改源代码)。我试过 print typeid(*this) 但它说 typeid 是未知的(因为我没有将它包含在源文件中)。

最佳答案

使用ptype命令,像这样:

(gdb) ptype 42
type = int

关于c++ - gdb:显示一些数据的类型信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9568201/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com