https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81155
--- Comment #6 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
(In reply to Jakub Jelinek from comment #5)
> where gdb sees the difference and why doesn't it make the file
> containing main the default?
pr43051-1.exe.good
<1><117>: Abbrev Number: 3 (DW_TAG_subprogram)
<118> DW_AT_abstract_origin: <0x69>
<11c> DW_AT_low_pc : 0x400410
<124> DW_AT_high_pc : 0x3d
...
pr43051-1.exe.bad
<1><117>: Abbrev Number: 3 (DW_TAG_subprogram)
<118> DW_AT_abstract_origin: <0x69>
<11c> DW_AT_ranges : 0x0
...
GDB read_partial_die() does support DW_AT_low_pc+DW_AT_high_pc but not
DW_AT_ranges. Therefore for pr43051-1.exe.bad GDB considers it only as a
declaration of main() and not its definition, not worth expanding its CU.