Skip to content

Change the default debug info format in 32-bit Arm to DWARF

Summary

On Linux at least, the -g option of fpc defaults to generating debug information in the DWARF2 format. I tested on aarch64-linux and x86_64-linux and that was the case. This is good.

However, on armv8l-linux (that is, 32-bit Arm), it defaults to stabs. This was noticed because GDB just removed support for the stabs debug format, and the GDB tests for Pascal started to fail on our CI for armv8l-linux.

System Information

Tested on Ubuntu 24.04 and 25.04 systems, both of which have fpc 3.2.2 installed.

Steps to reproduce

Assuming hello.pas is a simple hello world program:

  1. fpc -o hello -g hello.pas
  2. readelf -w hello

What is the current bug behavior?

On aarch64-linux and x86_64-linux, the last command outputs the DWARF debug info in the hello binary. On armv8l-linux, the output is empty because there is no DWARF debug info, only stabs.

What is the expected (correct) behavior?

There should be DWARF debug info when using the -g option in armv8l-systems.

Edited by Thiago Jung Bauermann
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information