This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix false warning: Shared library is missing debugging information.
- From: Tristan Gingold <gingold at adacore dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 11 Jan 2010 16:22:06 +0100
- Subject: Re: [patch] Fix false warning: Shared library is missing debugging information.
- References: <20100111151258.GA9354@host0.dyn.jankratochvil.net>
On Jan 11, 2010, at 4:12 PM, Jan Kratochvil wrote:
> Hi,
[...]
> despite the system has full separate debug info files installed.
>
> This "Shared library is missing debugging information." message was a response
[...]
> --- a/gdb/solib.c
> +++ b/gdb/solib.c
> @@ -842,6 +842,7 @@ info_sharedlibrary_command (char *pattern, int from_tty)
> for (so = so_list_head; so; so = so->next)
> {
> struct cleanup *lib_cleanup;
> + struct objfile *objfile;
>
> if (! so->so_name[0])
> continue;
> @@ -861,10 +862,16 @@ info_sharedlibrary_command (char *pattern, int from_tty)
> ui_out_field_skip (uiout, "to");
> }
>
> + /* We just check the state of any single separate debug info file, if
> + such one exists. */
> + objfile = so->objfile;
> + if (objfile->separate_debug_objfile)
> + objfile = objfile->separate_debug_objfile;
> +
> if (! ui_out_is_mi_like_p (interp_ui_out (top_level_interpreter ()))
> && so->symbols_loaded
> - && !objfile_has_partial_symbols (so->objfile)
> - && !objfile_has_full_symbols (so->objfile))
> + && !objfile_has_partial_symbols (objfile)
> + && !objfile_has_full_symbols (objfile))
> {
> so_missing_debug_info = 1;
> ui_out_field_string (uiout, "syms-read", "Yes (*)");
I think you should use !objfile_has_symbols (so->objfile) instead.
It is somewhat wrong to check objfile->separate_debug_objfile without checking the whole chain, because the
chain has no particular order.
(Of course, this only concerns Darwin but who knows in the future :-)
Thank you for improving the user experience,
Tristan.