winIDEA: Variables missing from the structure

26-Nov-2024

Variables missing from the structure or two structures in the ELF with the same name but slightly different types are usually caused by compiler excessive code optimization.


Possible solution

winIDEA offers an option to control the resolution of variable locations from Symbol table.

1. Open Debug | Configure Session | Applications | Symbol Files

2. Select the ELF download file.

3. Press Edit

4. Press Advanced

5. In the Edit options dialog disable Use symbol table for variables with no location which will disable the loading of variables with no address in .debug_info.





If enabled (default) winIDEA will try to resolve variable location by querying symbol table. 


Other common issues caused by code optimization:
  • Unusual sequence in stepping through code.
  • Can not set a breakpoint in source code, whereas in the Disassembly Window it is possible.


Was this answer helpful?