Why gdb casting is not working?

前端 未结 4 1217
遥遥无期
遥遥无期 2020-12-23 21:24

I use print (CEthPacket*) 0xeb609a0 to examine an object at the given address and get A syntax error in expression, near \') 0xeb609a0\'.

W

4条回答
  •  醉梦人生
    2020-12-23 22:19

    I just ran in to similar issue, and, from a colleague of mine, I learnt that you need to provide the namespace that the class belongs to within a single quotes as following:

    (gdb) p ('MyScope::MyClass'*) ptr; 
    

提交回复
热议问题