Rate This Document
Findability
Accuracy
Completeness
Readability

The Source File or Variable Cannot Be Found During GDB Debugging

When GCC for openEuler uses -g to compile source code, the default debugging information is generated in the DWARF-5 standard. If the GDB version is too early, it may not fully support DWARF-5 features, leading to errors in GDB.

Solution: Add -gdwarf-2 during compilation to forcibly generate debugging information of low standards (such as DWARF-2).