This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix assert crashes with minidebuginfo
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Fri, 1 Feb 2013 20:06:37 +0100
- Subject: Re: [patch] Fix assert crashes with minidebuginfo
- References: <20130201182134.GA14273@host2.jankratochvil.net>
On Fri, 01 Feb 2013 19:21:34 +0100, Jan Kratochvil wrote:
> diff --git a/gdb/symfile.c b/gdb/symfile.c
> index 63bf329..6f968b7 100644
> --- a/gdb/symfile.c
> +++ b/gdb/symfile.c
> @@ -823,7 +823,12 @@ static void
> read_symbols (struct objfile *objfile, int add_flags)
> {
> (*objfile->sf->sym_read) (objfile, add_flags);
> - if (!objfile_has_partial_symbols (objfile))
> +
> + /* find_separate_debug_file_in_section should be called only if there is
> + single binary with no existing separate debug info file. */
> + if (!objfile_has_partial_symbols (objfile)
> + && objfile->separate_debug_objfile == NULL
> + && objfile->separate_debug_objfile_backlink == NULL)
> {
> bfd *abfd = find_separate_debug_file_in_section (objfile);
> struct cleanup *cleanup = make_cleanup_bfd_unref (abfd);
As discussed with Tom off-list:
first entry:
* SYM_READ reads separate .debug file.
second entry, called for the .debug file:
* nothing interesting as objfile_has_partial_symbols (objfile).
first entry continues:
* But the primary file still !objfile_has_partial_symbols (objfile),
therefore minidebuginfo is read as a secondary debug info file
(those are supported for MacOSX).
third entry, called for the minidebuginfo
* SYM_READ starts to search for separate debug info (via its PT_NOTE
build-id) file for the minidebuginfo file.
=> crash
Regards,
Jan