Bug 30996 - [gdb/symtab, gdb-index] Write name_of_main/language_of_main into .gdb_index in more cases
Summary: [gdb/symtab, gdb-index] Write name_of_main/language_of_main into .gdb_index i...
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: HEAD
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-24 08:18 UTC by Tom de Vries
Modified: 2023-10-25 08:43 UTC (History)
2 users (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 2023-10-24 08:18:38 UTC
[ Reported here: https://sourceware.org/pipermail/gdb-patches/2023-October/203488.html ]

The v9 .gdb_index contains a shortcut table, but it doesn't always contain information.

For instance, this is the case for C and C++ programs.

Making this information available in more cases will speed up gdb startup if  finding the language of main requires expanding a large CU.
Comment 1 Tom Tromey 2023-10-24 20:19:42 UTC
This may be easier once bug#30174 is done.

Many languages use minsyms here, which is fast.
The danger would be to have a scenario where
the DWARF reader picks "main", but in reality
gdb should choose some other language (e.g, Ada).

But maybe we can special-case "main" in the main-finding
function.
Comment 2 Tom de Vries 2023-10-25 07:34:33 UTC
(In reply to Tom de Vries from comment #0)
> Making this information available in more cases will speed up gdb startup if
> finding the language of main requires expanding a large CU.

FWIW, implementing lazy expansion ( PR29398 ) might also address this problem sufficiently.