From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14853 invoked by alias); 12 Oct 2009 13:57:42 -0000 Received: (qmail 14837 invoked by uid 22791); 12 Oct 2009 13:57:40 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Oct 2009 13:57:34 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 334BE290035 for ; Mon, 12 Oct 2009 15:57:32 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id maIgi2wpCRvI for ; Mon, 12 Oct 2009 15:57:31 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 78C18290034 for ; Mon, 12 Oct 2009 15:57:31 +0200 (CEST) From: Tristan Gingold Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: [RFA]: no "no debugging symbols found" for separate debug Date: Mon, 12 Oct 2009 13:57:00 -0000 Message-Id: To: gdb-patches ml Mime-Version: 1.0 (Apple Message framework v1076) 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: 2009-10/txt/msg00230.txt.bz2 Hi, when a stripped executable with a separate debug file is loaded, gdb prints "no debugging symbols found". I think this is confusing and this was not printed in gdb 6.8 The reason is that only the objfile is checked, not the separate debug file. This patch fixes that and add a test in the sepdebug.exp file. Tristan. 2009-10-12 Tristan Gingold * objfiles.c (objfile_has_symbols): New function. * objfiles.h (objfile_has_symbols): Add prototype. * symfile.c (symbol_file_add_with_addrs_or_offsets): Call objfile_has_symbols. (reread_symbols): Ditto. testsuite/ 2009-10-12 Tristan Gingold * gdb.base/sepdebug.exp: Check debug info are found. Index: objfiles.c =================================================================== RCS file: /cvs/src/src/gdb/objfiles.c,v retrieving revision 1.97 diff -c -r1.97 objfiles.c *** objfiles.c 18 Sep 2009 17:33:51 -0000 1.97 --- objfiles.c 12 Oct 2009 13:52:31 -0000 *************** *** 717,722 **** --- 717,746 ---- return objfile->symtabs != NULL; } + /* Return non-zero if OBJFILE has full or partial symbols, either directly + or throught its the separate debug file. */ + + int + objfile_has_symbols (struct objfile *objfile) + { + struct objfile *separate_objfile; + + if (objfile_has_partial_symbols (objfile) + || objfile_has_full_symbols (objfile)) + return 1; + + separate_objfile = objfile->separate_debug_objfile; + if (separate_objfile == NULL) + return 0; + + if (objfile_has_partial_symbols (separate_objfile) + || objfile_has_full_symbols (separate_objfile)) + return 1; + + return 0; + } + + /* Many places in gdb want to test just to see if we have any partial symbols available. This function returns zero if none are currently available, nonzero otherwise. */ Index: objfiles.h =================================================================== RCS file: /cvs/src/src/gdb/objfiles.h,v retrieving revision 1.64 diff -c -r1.64 objfiles.h *** objfiles.h 11 Sep 2009 18:51:31 -0000 1.64 --- objfiles.h 12 Oct 2009 13:52:32 -0000 *************** *** 476,481 **** --- 476,483 ---- extern int objfile_has_full_symbols (struct objfile *objfile); + extern int objfile_has_symbols (struct objfile *objfile); + extern int have_partial_symbols (void); extern int have_full_symbols (void); Index: symfile.c =================================================================== RCS file: /cvs/src/src/gdb/symfile.c,v retrieving revision 1.246 diff -c -r1.246 symfile.c *** symfile.c 18 Sep 2009 17:33:51 -0000 1.246 --- symfile.c 12 Oct 2009 13:52:32 -0000 *************** *** 1040,1047 **** } if ((from_tty || info_verbose) ! && !objfile_has_partial_symbols (objfile) ! && !objfile_has_full_symbols (objfile)) { wrap_here (""); printf_unfiltered (_("(no debugging symbols found)...")); --- 1040,1046 ---- } if ((from_tty || info_verbose) ! && !objfile_has_symbols (objfile)) { wrap_here (""); printf_unfiltered (_("(no debugging symbols found)...")); *************** *** 2422,2429 **** zero is OK since dbxread.c also does what it needs to do if objfile->global_psymbols.size is 0. */ (*objfile->sf->sym_read) (objfile, 0); ! if (!objfile_has_partial_symbols (objfile) ! && !objfile_has_full_symbols (objfile)) { wrap_here (""); printf_unfiltered (_("(no debugging symbols found)\n")); --- 2421,2427 ---- zero is OK since dbxread.c also does what it needs to do if objfile->global_psymbols.size is 0. */ (*objfile->sf->sym_read) (objfile, 0); ! if (!objfile_has_symbols (objfile)) { wrap_here (""); printf_unfiltered (_("(no debugging symbols found)\n")); Index: testsuite/gdb.base/sepdebug.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/sepdebug.exp,v retrieving revision 1.19 diff -c -r1.19 sepdebug.exp *** testsuite/gdb.base/sepdebug.exp 19 Jan 2009 19:05:01 -0000 1.19 --- testsuite/gdb.base/sepdebug.exp 12 Oct 2009 13:52:34 -0000 *************** *** 61,66 **** --- 61,69 ---- gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} + if { $gdb_file_cmd_debug_info != "debug" } then { + fail "No debug information found." + } if [target_info exists gdb_stub] { gdb_step_for_stub;