GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
cobol

COBOL: Program naming convention updated for GDB compatibility

GCC's COBOL front-end now uses a hierarchical naming convention for contained programs to ensure compatibility with the GDB debugger.

The GCC COBOL front-end has been updated to include the full naming hierarchy for contained programs. This change ensures that these programs are named correctly according to the requirements of the GDB-COBOL debugger, allowing for proper debugging of nested program structures.

In Details

The cobol_set_decl_assembler_name function in cobol1.cc and related naming functions in genapi.cc and gg.cc have been modified to support generating fully qualified assembly names for contained PROGRAM-ID programs. Previously, these names might have been simplified, hindering GDB's ability to resolve and debug nested or contained routines. This change ensures that the assembly names reflect the full lexical hierarchy of the COBOL program structure, enabling GDB to correctly identify and set breakpoints within these contained programs.

For Context
COBOL
Common Business-Oriented Language. A high-level programming language designed for business applications.
PROGRAM-ID
A COBOL statement used to declare the name of a program or subprogram.
assembler name
The name given to a function or variable in the assembly code generated by the compiler. This is what the debugger and linker typically see.
contained programs
In COBOL, programs that are defined within the scope of another program, creating a nested structure.
compiler front-end
The part of a compiler that parses the source code and performs initial analysis, converting it into an intermediate representation. For GCC, this includes language-specific components like the COBOL front-end.
Filed Under: coboldebugginggdb