This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ob/testsuite] Specify filename in freebpcmd.exp


The problem with starting a test with "break 60" is that it assumes
the current source file is still the one containing "main".  If
(A) gdb_load connects to a remote target system, and (B) the runtime
library has debug information for the file containing _start, then
this assumption won't hold; it will try to set the breakpoint in the
wrong file.

So, like other tests, just specify the file explicitly.

Tested on arm-none-eabi and x86_64-linux.  Checked in.

2009-11-13  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.base/freebpcmd.exp: Delete unused variable.  Specify
	srcfile when setting a breakpoint.

Index: gdb/testsuite/gdb.base/freebpcmd.exp
===================================================================
--- gdb/testsuite/gdb.base/freebpcmd.exp	(revision 218691)
+++ gdb/testsuite/gdb.base/freebpcmd.exp	(revision 218692)
@@ -48,7 +48,6 @@ set bug_id 0
 
 set testfile "freebpcmd"
 set srcfile ${testfile}.c
-set srcfile1 ${testfile}1.c
 set binfile ${objdir}/${subdir}/${testfile}
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
@@ -61,7 +60,7 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-gdb_test "break [gdb_get_line_number "euphonium"]" "" "set breakpoint"
+gdb_test "break ${srcfile}:[gdb_get_line_number "euphonium"]" "" "set breakpoint"
 
 # The goal of all this is to make sure that there's plenty of memory
 # churn, and different amounts of it each time the inferior stops;

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]