gdb:显示一些数据的类型信息 [英] gdb: show typeinfo of some data

查看:141
本文介绍了gdb:显示一些数据的类型信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我想得到 typeid(* this).name(),即 this 。



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

使用 ptype 命令,像这样:

 (gdb)ptype 42 
type = int


Basically, I want to get typeid(*this).name(), i.e. the real type of this.

I want to get this in GDB (without modifying the source code). I tried print typeid(*this) but it says that typeid is unknown (because I didn't included it there in the source file).

解决方案

Use ptype command, like this:

(gdb) ptype 42
type = int

这篇关于gdb:显示一些数据的类型信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆