From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23407 invoked by alias); 6 Apr 2004 23:49:04 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23343 invoked from network); 6 Apr 2004 23:48:57 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 6 Apr 2004 23:48:57 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i36NmvWB031296 for ; Tue, 6 Apr 2004 19:48:57 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i36Nmuj03220; Tue, 6 Apr 2004 19:48:56 -0400 To: gdb-patches@sources.redhat.com Subject: RFA: test GDB's ability to find #included source files by name From: Jim Blandy Date: Tue, 06 Apr 2004 23:49:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-04/txt/msg00159.txt.bz2 Passes for STABS, fails on Dwarf 2. Filed as symtab/1607. 2004-04-06 Jim Blandy * gdb.base/incfunc.exp, gdb.base/incfunc.c, gdb.base/incfunc2.c: New test. Index: gdb/testsuite/gdb.base/incfunc.exp =================================================================== RCS file: gdb/testsuite/gdb.base/incfunc.exp diff -N gdb/testsuite/gdb.base/incfunc.exp *** gdb/testsuite/gdb.base/incfunc.exp 1 Jan 1970 00:00:00 -0000 --- gdb/testsuite/gdb.base/incfunc.exp 6 Apr 2004 23:24:39 -0000 *************** *** 0 **** --- 1,70 ---- + # Copyright 2004 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + # Please email any bugs, comments, and/or additions to this file to: + # bug-gdb@gnu.org + + # Make sure GDB's debug information reader includes the names of + # header files in the partial symbol table. + + if $tracelevel { + strace $tracelevel + } + + # + # test running programs + # + set prms_id 0 + set bug_id 0 + + set testfile incfunc + set srcfile ${testfile}.c + set binfile ${objdir}/${subdir}/${testfile} + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." + } + + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_load ${binfile} + + if ![runto_main] then { + perror "couldn't run to breakpoint" + continue + } + + get_debug_format + + # When we stopped at main, we read full symbols for main's compilation + # unit. But the test needs to run before we've read any full symbols, + # so re-start GDB. + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_load ${binfile} + + if { [test_debug_format "DWARF 2"] } then { + setup_kfail "gdb/1607" *-*-* + } + gdb_test_multiple "break incfunc2.c:4" "set breakpoint in included file" { + -re "Breakpoint ${decimal} at ${hex}: file .*incfunc2.c, line .*${gdb_prompt}" { + pass "set breakpoint in included file" + } + -re "Make breakpoint pending on future shared library load. .y or .n.. " { + fail "set breakpoint in included file" + } + } Index: gdb/testsuite/gdb.base/incfunc2.c =================================================================== RCS file: gdb/testsuite/gdb.base/incfunc2.c diff -N gdb/testsuite/gdb.base/incfunc2.c *** gdb/testsuite/gdb.base/incfunc2.c 1 Jan 1970 00:00:00 -0000 --- gdb/testsuite/gdb.base/incfunc2.c 6 Apr 2004 23:24:39 -0000 *************** *** 0 **** --- 1,5 ---- + void + f (void) + { + puts ("Hello.\n"); + } Index: gdb/testsuite/gdb.base/incfunc.c =================================================================== RCS file: gdb/testsuite/gdb.base/incfunc.c diff -N gdb/testsuite/gdb.base/incfunc.c *** gdb/testsuite/gdb.base/incfunc.c 1 Jan 1970 00:00:00 -0000 --- gdb/testsuite/gdb.base/incfunc.c 6 Apr 2004 23:24:39 -0000 *************** *** 0 **** --- 1,8 ---- + #include + #include "incfunc2.c" + + int + main () + { + f (); + }