Add debug info for enums.

Previously enums were reduced to the underlying type.
Now the symbolic constants can be used.

This is a bug-fixed version of commit 001a3964.