Let's assume we have defined a global non-initialized variable named f in C code.
Considering that, we would make label named f in the Assembly representation and put it in the .bss section.
The problem I've encountered is the following:
- Using
laworks fine, and loads the address of user-defined global variable into some register - Trying to print, or examine the symbol
fin gdb returns some object at some address0x7f7f...which is not the variable I intended to print - Using
info variablesI was able to find astatic FILE *fpointer variable f probably originating from C library that got linked with the source file, and concluded it being what is getting printed in gdb - I also tried doing
p 'file.s'::fto print the user-defined variable but had no luck with that either
So my question is how to differentiate between duplicate symbol names while debugging using gdb?