[patch] Fix false warning: Shared library is missing debugging information.
Tristan Gingold
gingold@adacore.com
Mon Jan 11 15:21:00 GMT 2010
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.
More information about the Gdb-patches
mailing list