Bug 29160 - [gdb, ctf+dwarf] FAIL: gdb.base/ctf-constvars.exp: print vox
Summary: [gdb, ctf+dwarf] FAIL: gdb.base/ctf-constvars.exp: print vox
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 13.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-20 08:38 UTC by Tom de Vries
Modified: 2022-10-12 15:17 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2022-05-20 08:38:18 UTC
On openSUSE Tumbleweed, with gcc 12.1.0, which supports -gctf, I run into:
...
FAIL: gdb.base/ctf-constvars.exp: print vox
...

AFAICT this is due to:
...
  /* Read the CTF section only if there is no DWARF info.  */
  if (!has_dwarf2 && ei.ctfsect)
    {
      elfctf_build_psymtabs (objfile);
    }
...
and the the exec has both ctf and dwarf:
...
$ readelf -S -W outputs/gdb.base/ctf-constvars/ctf-constvars
  ...
  [27] .ctf              PROGBITS        0000000000000000 0052cc 00054f 00      0   0  1
  [28] .debug_aranges    PROGBITS        0000000000000000 003160 000120 00      0   0 16
  [29] .debug_info       PROGBITS        0000000000000000 003280 000988 00      0   0  1
  [30] .debug_abbrev     PROGBITS        0000000000000000 003c08 000282 00      0   0  1
  [31] .debug_line       PROGBITS        0000000000000000 003e8a 00024f 00      0   0  1
  [32] .debug_str        PROGBITS        0000000000000000 0040d9 0004bc 01  MS  0   0  1
  [33] .debug_line_str   PROGBITS        0000000000000000 004595 000144 01  MS  0   0  1
  [34] .debug_rnglists   PROGBITS        0000000000000000 0046d9 000042 00      0   0  1
...

This due to the linked in startup files having dwarf info:
...
$ readelf --dwarf-depth=1 -wi outputs/gdb.base/ctf-constvars/ctf-constvars | grep name
    <1a>   DW_AT_name        :   ../sysdeps/x86_64/start.S
    <3a>   DW_AT_name        :   ../sysdeps/x86/abi-note.c
    <510>   DW_AT_name        :  init.c
    <551>   DW_AT_name        :  static-reloc.c
    <957>   DW_AT_name        :  ../sysdeps/x86_64/crti.S
    <97a>   DW_AT_name        :  ../sysdeps/x86_64/crtn.S
...