c - How can I examine in gdb a variable that has the same name as its type -


i'm debugging existing c library gdb 7.4
i'm trying examine variable which, unfortunately, declared same name type:

extern const enum rtx_class rtx_class[num_rtx_code]; 

now can't find way examine variable. p rtx_class returns attempt use type name expression, same p &rtx_class , p rtx_class[0].
however, info var rtx_class works , returns const rtx_class rtx_class[145] expected.

any idea?

try workaround. binary like:

nm your-executable |grep rtx_class

you should address (let's it's 0xabcdef, assuming global variable. in gdb like:

print *(rtx_class*)(0xabcdef+sizeof(rtx_class)*n)

this should print rtx_class[n]. or @ least in simple testcase.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -