a68: Emit proper DW_DIE_typedef in DWARF
Correctly emits DW_DIE_typedef directives in DWARF for Algol 68 type declarations.
The Algol 68 front-end now correctly generates DW_DIE_typedef directives in DWARF debug information. Previously, mode declarations in the Algol 68 front-end were immediately replaced by their underlying modes, preventing the generation of accurate type definition information. This patch leverages GENERIC features to ensure that when a type declaration is made, the DWARF output properly reflects it as a distinct typedef, improving the usability of debuggers for Algol 68 code.
In Details
The Algol 68 front-end's handling of mode declarations, specifically a68_lower_mode_declaration, has been updated to correctly generate DWARF type information. Previously, mode declarations were directly substituted with their underlying type representations early in the compilation process. This commit modifies the lowering process to use GENERIC features, ensuring that DW_DIE_typedef entries are created in the DWARF output when a new type name is introduced, rather than just the underlying type. This involves changes in a68-low-decls.cc and related headers, including the introduction…
- a68
- GCC's front-end for the Algol 68 programming language.
- DWARF
- A standard file format used for debugging information in executable files. It allows debuggers to map machine code back to source code constructs like variables, types, and functions.
- DW_DIE_typedef
- A Debugging With Attributed Record (DWARF) Debug Information Entry (DIE) that specifically represents a type definition (typedef).
- mode
- In GCC, a 'mode' represents a data type and its size, such as 'SI' for signed integer, 'DF' for double-precision float, or 'HF' for half-precision float. In the context of Algol 68, this relates to their type system.
- GENERIC
- GCC's intermediate representation (IR) that is shared across different languages and targets before specific optimizations or code generation occurs.
- symbol table
- A data structure used by a compiler to store information about identifiers (such as variable and function names) encountered in the source code.