GDB Python error: No enum type named tree_code
GDB fails with a Python error when debugging cc1, indicating an issue with symbol interpretation.
Georg-Johann Lay is encountering a Python error in GDB when attempting to debug the GCC compiler (cc1). The error message “No enum type named tree_code” suggests a mismatch or problem with how GDB is interpreting the compiler’s debugging symbols. The user is seeking assistance to resolve this debugging issue.
- proposer
Reports a Python GDB error when debugging cc1, seeking help to resolve it.
“Perhaps someone can help me with debugging cc1. What I am doing is to run $ ddd cc1 from the gcc $buildir/gcc gdb says: Python Exception <class 'gdb.error'>: No enum type named tree_code. .gdbinit:18: Error in sourced command file: Error occurred in Python: No enum type named tree_code. (gdb) What to do about it?”
- other
Acknowledges the ongoing issue and reiterates the original problem description.
“Perhaps someone can help me with debugging cc1. What I am doing is to run $ ddd cc1 from the gcc $buildir/gcc gdb says: Python Exception <class 'gdb.error'>: No enum type named tree_code. .gdbinit:18: Error in sourced command file: Error occurred in Python: No enum type named tree_code. (gdb) What to do about it?”
In Details
The user is reporting a GDB Python API error when debugging GCC's compiler frontend, cc1. The error "No enum type named tree_code" likely stems from GDB's Python pretty-printers or type lookups failing to find a specific enum (tree_code) within the DWARF debugging information generated by GCC. This could be due to a mismatch in GDB version, GCC's internal representation of tree_code, or issues with the Python scripting within GDB itself.