Improve Debug Messaging in the Ada Compiler
The Ada compiler's internal debugging messages have been enhanced with more contextual information, including locations and fixes.
The Ada compiler’s debugging messages (dmsg) now include additional information to aid developers. Missing attributes of Error_Msg_Object are now printed, and support for printing locations and fixes has been added via new dedit, dfix, and dloc functions. Helper functions for converting spans and file/line/column numbers to strings were also moved/added.
In Details
This commit enhances the Ada compiler's internal debugging capabilities (erroutc.adb, erroutc-pretty_emitter.adb) by adding more context to the dmsg function. New functions like dedit, dfix, and dloc expose more information about error locations and proposed fixes, which is useful when diagnosing issues within the Ada front end.
For Context
When developing a compiler, developers often use debug messages to understand the internal state and diagnose problems. This commit improves the quality of these debug messages in the Ada compiler by adding more information, such as the location of errors and suggested fixes. Better debug messages make it easier for compiler developers to fix bugs and improve the compiler.