From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12694 invoked by alias); 11 Jan 2010 15:13:20 -0000 Received: (qmail 12677 invoked by uid 22791); 11 Jan 2010 15:13:19 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Jan 2010 15:13:15 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0BFDDKD031702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 11 Jan 2010 10:13:13 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0BFD3pV001353 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 11 Jan 2010 10:13:13 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id o0BFD1aD009529 for ; Mon, 11 Jan 2010 16:13:01 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id o0BFCwGA009524 for gdb-patches@sourceware.org; Mon, 11 Jan 2010 16:12:58 +0100 Date: Mon, 11 Jan 2010 15:13:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] Fix false warning: Shared library is missing debugging information. Message-ID: <20100111151258.GA9354@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00248.txt.bz2 Hi, since http://sourceware.org/ml/gdb-cvs/2009-08/msg00134.html commit 28bc5797a9be8409c7f78881f93fff58c4e9d6ed Author: Doug Evans GDB prints: (gdb) info sharedlibrary From To Syms Read Shared Object Library 0x000000362de00af0 0x000000362de18344 Yes (*) /lib64/ld-linux-x86-64.so.2 0x000000362ea05390 0x000000362ea107c8 Yes (*) /lib64/libpthread.so.0 0x000000362e21e860 0x000000362e32597c Yes (*) /lib64/libc.so.6 (*): Shared library is missing debugging information. (gdb) _ despite the system has full separate debug info files installed. This "Shared library is missing debugging information." message was a response on a wish by Pedro Alves: http://sourceware.org/ml/gdb-patches/2009-07/msg00086.html We do have a "Syms Read" column in info shared's output, maybe we should extend that from "Yes, No" -> "Yes, Sorry-I've-tried-but-didn't-find-any, No". So the case when debug info has been found - although in a separate debug info file - should be IMO the case "Yes" and not the case "Sorry-I've-tried-but-didn't-find-any". With the patch GDB now prints in the same case: (gdb) info sharedlibrary From To Syms Read Shared Object Library 0x000000362de00af0 0x000000362de18344 Yes /lib64/ld-linux-x86-64.so.2 0x000000362ea05390 0x000000362ea107c8 Yes /lib64/libpthread.so.0 0x000000362e21e860 0x000000362e32597c Yes /lib64/libc.so.6 (gdb) _ No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu. Thanks, Jan 2010-01-11 Jan Kratochvil * solib.c (info_sharedlibrary_command): New variable objfile, initialize it. Prefer checking symbols for separate debug info file. --- 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 (*)");