From: Jim Blandy <jimb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: RFA: test GDB's ability to find #included source files by name
Date: Tue, 06 Apr 2004 23:49:00 -0000 [thread overview]
Message-ID: <vt2wu4sd5z5.fsf@zenia.home> (raw)
Passes for STABS, fails on Dwarf 2. Filed as symtab/1607.
2004-04-06 Jim Blandy <jimb@redhat.com>
* 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 <stdio.h>
+ #include "incfunc2.c"
+
+ int
+ main ()
+ {
+ f ();
+ }
reply other threads:[~2004-04-06 23:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vt2wu4sd5z5.fsf@zenia.home \
--to=jimb@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox