This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Delay allocation of dbx_symfile_info
- From: Kevin Buettner <kevinb at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at adacore dot com>
- Date: Sat, 8 Jun 2019 13:17:12 -0700
- Subject: Re: [PATCH] Delay allocation of dbx_symfile_info
- References: <20190607210324.6294-1-tromey@adacore.com>
On Fri, 7 Jun 2019 15:03:24 -0600
Tom Tromey <tromey@adacore.com> wrote:
> I noticed that elfread.c always allocates a dbx_symfile_info, even
> though this is only ever needed in the unusual case of reading stabs
> in ELF.
>
> This patch moves the allocation into dbxread.c, and applies the same
> treatment to similar code in coffread.c.
>
> Regression tested on x86-64 Fedora 29.
>
> gdb/ChangeLog
> 2019-06-07 Tom Tromey <tromey@adacore.com>
>
> * elfread.c (elf_read_minimal_symbols): Don't set the dbx objfile
> data.
> (elf_new_init): Don't call stabsread_new_init.
> * dbxread.c (coffstab_build_psymtabs): Set dbx objfile data.
> (elfstab_build_psymtabs): Likewise. Call stabsread_new_init.
> * coffread.c (coff_symfile_init): Don't set the dbx objfile data.
LGTM.
Kevin