2018-01-01 05:43:02 +01:00
|
|
|
# Copyright 2008-2018 Free Software Foundation, Inc.
|
2008-05-04 06:04:11 +02:00
|
|
|
|
|
|
|
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
# This file tests setting breakpoints according to the full path of a
|
|
|
|
# source file.
|
|
|
|
|
test suite update - gdb.base/[efg]
Convert files gdb.base/[efg]*.exp to use standard_output_file et al.
* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.exp,
eu-strip-infcall.exp, eval-skip.exp, exe-lock.exp,
expand-psymtabs.exp, exprs.exp, fileio.exp, find.exp,
fixsection.exp, foll-exec.exp, foll-fork.exp,
fortran-sym-case.exp, frame-args.exp, freebpcmd.exp, fullname.exp,
funcargs.exp, gcore-buffer-overflow.exp, gcore.exp, gdb1090.exp,
gdb11530.exp, gdb11531.exp, gdb1250.exp, gdb1555.exp, gdb1821.exp,
gdbindex-stabs.exp, gdbvars.exp, gnu-ifunc.exp, gnu_vector.exp:
Use standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:50:30 +02:00
|
|
|
standard_testfile
|
2008-05-04 06:04:11 +02:00
|
|
|
|
|
|
|
# We rely on being able to copy things around.
|
|
|
|
|
|
|
|
if { [is_remote host] } {
|
|
|
|
untested "setting breakpoints by full path"
|
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Create a temporary file in the build directory. Use a different
|
|
|
|
# filename in case ${srcdir} == ${objdir}.
|
|
|
|
if { [catch {file copy -force ${srcdir}/${subdir}/${srcfile} \
|
test suite update - gdb.base/[efg]
Convert files gdb.base/[efg]*.exp to use standard_output_file et al.
* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.exp,
eu-strip-infcall.exp, eval-skip.exp, exe-lock.exp,
expand-psymtabs.exp, exprs.exp, fileio.exp, find.exp,
fixsection.exp, foll-exec.exp, foll-fork.exp,
fortran-sym-case.exp, frame-args.exp, freebpcmd.exp, fullname.exp,
funcargs.exp, gcore-buffer-overflow.exp, gcore.exp, gdb1090.exp,
gdb11530.exp, gdb11531.exp, gdb1250.exp, gdb1555.exp, gdb1821.exp,
gdbindex-stabs.exp, gdbvars.exp, gnu-ifunc.exp, gnu_vector.exp:
Use standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:50:30 +02:00
|
|
|
[standard_output_file tmp-${srcfile}]}] != 0 } {
|
2008-05-04 06:04:11 +02:00
|
|
|
error "Could not create temporary file"
|
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Build the test executable using an absolute path.
|
test suite update - gdb.base/[efg]
Convert files gdb.base/[efg]*.exp to use standard_output_file et al.
* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.exp,
eu-strip-infcall.exp, eval-skip.exp, exe-lock.exp,
expand-psymtabs.exp, exprs.exp, fileio.exp, find.exp,
fixsection.exp, foll-exec.exp, foll-fork.exp,
fortran-sym-case.exp, frame-args.exp, freebpcmd.exp, fullname.exp,
funcargs.exp, gcore-buffer-overflow.exp, gcore.exp, gdb1090.exp,
gdb11530.exp, gdb11531.exp, gdb1250.exp, gdb1555.exp, gdb1821.exp,
gdbindex-stabs.exp, gdbvars.exp, gnu-ifunc.exp, gnu_vector.exp:
Use standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:50:30 +02:00
|
|
|
if { [gdb_compile [standard_output_file tmp-${srcfile}] "${binfile}" executable {debug}] != "" } {
|
2008-05-04 06:04:11 +02:00
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Unlike most GDB tests, we do not use gdb_reinitialize_dir in this script.
|
|
|
|
# We're testing GDB's ability to find files in other ways.
|
|
|
|
|
|
|
|
# Get the line number.
|
|
|
|
|
|
|
|
set line [gdb_get_line_number "set breakpoint 1 here"]
|
|
|
|
|
|
|
|
# Initialize GDB after getting the line number, to make sure
|
|
|
|
# symbols aren't loaded.
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
gdb_start
|
|
|
|
gdb_load ${binfile}
|
|
|
|
|
|
|
|
set msg "set breakpoint by full path before loading symbols - built absolute"
|
test suite update - gdb.base/[efg]
Convert files gdb.base/[efg]*.exp to use standard_output_file et al.
* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.exp,
eu-strip-infcall.exp, eval-skip.exp, exe-lock.exp,
expand-psymtabs.exp, exprs.exp, fileio.exp, find.exp,
fixsection.exp, foll-exec.exp, foll-fork.exp,
fortran-sym-case.exp, frame-args.exp, freebpcmd.exp, fullname.exp,
funcargs.exp, gcore-buffer-overflow.exp, gcore.exp, gdb1090.exp,
gdb11530.exp, gdb11531.exp, gdb1250.exp, gdb1555.exp, gdb1821.exp,
gdbindex-stabs.exp, gdbvars.exp, gnu-ifunc.exp, gnu_vector.exp:
Use standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:50:30 +02:00
|
|
|
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
|
2008-05-04 06:04:11 +02:00
|
|
|
pass $msg
|
|
|
|
} else {
|
|
|
|
fail $msg
|
|
|
|
}
|
|
|
|
|
|
|
|
gdb_test "break main" \
|
|
|
|
"Breakpoint.*at.*line.*" "set breakpoint at main - built absolute"
|
|
|
|
|
|
|
|
set msg "set breakpoint by full path after loading symbols - built absolute"
|
test suite update - gdb.base/[efg]
Convert files gdb.base/[efg]*.exp to use standard_output_file et al.
* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.exp,
eu-strip-infcall.exp, eval-skip.exp, exe-lock.exp,
expand-psymtabs.exp, exprs.exp, fileio.exp, find.exp,
fixsection.exp, foll-exec.exp, foll-fork.exp,
fortran-sym-case.exp, frame-args.exp, freebpcmd.exp, fullname.exp,
funcargs.exp, gcore-buffer-overflow.exp, gcore.exp, gdb1090.exp,
gdb11530.exp, gdb11531.exp, gdb1250.exp, gdb1555.exp, gdb1821.exp,
gdbindex-stabs.exp, gdbvars.exp, gnu-ifunc.exp, gnu_vector.exp:
Use standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:50:30 +02:00
|
|
|
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
|
2008-05-04 06:04:11 +02:00
|
|
|
pass $msg
|
|
|
|
} else {
|
|
|
|
fail $msg
|
|
|
|
}
|
|
|
|
|
|
|
|
# Build the test executable using a relative path.
|
2013-08-23 20:18:57 +02:00
|
|
|
if { [gdb_compile [relative_filename [pwd] [standard_output_file tmp-${srcfile}]] \
|
|
|
|
"${binfile}" executable {debug}] != "" } {
|
2008-05-04 06:04:11 +02:00
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
gdb_start
|
|
|
|
gdb_load ${binfile}
|
|
|
|
|
|
|
|
set msg "set breakpoint by full path before loading symbols - built relative"
|
test suite update - gdb.base/[efg]
Convert files gdb.base/[efg]*.exp to use standard_output_file et al.
* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.exp,
eu-strip-infcall.exp, eval-skip.exp, exe-lock.exp,
expand-psymtabs.exp, exprs.exp, fileio.exp, find.exp,
fixsection.exp, foll-exec.exp, foll-fork.exp,
fortran-sym-case.exp, frame-args.exp, freebpcmd.exp, fullname.exp,
funcargs.exp, gcore-buffer-overflow.exp, gcore.exp, gdb1090.exp,
gdb11530.exp, gdb11531.exp, gdb1250.exp, gdb1555.exp, gdb1821.exp,
gdbindex-stabs.exp, gdbvars.exp, gnu-ifunc.exp, gnu_vector.exp:
Use standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:50:30 +02:00
|
|
|
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
|
2008-05-04 06:04:11 +02:00
|
|
|
pass $msg
|
|
|
|
} else {
|
|
|
|
fail $msg
|
|
|
|
}
|
|
|
|
|
|
|
|
gdb_test "break main" \
|
|
|
|
"Breakpoint.*at.*line.*" "set breakpoint at main - built relative"
|
|
|
|
|
|
|
|
set msg "set breakpoint by full path after loading symbols - built relative"
|
test suite update - gdb.base/[efg]
Convert files gdb.base/[efg]*.exp to use standard_output_file et al.
* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.exp,
eu-strip-infcall.exp, eval-skip.exp, exe-lock.exp,
expand-psymtabs.exp, exprs.exp, fileio.exp, find.exp,
fixsection.exp, foll-exec.exp, foll-fork.exp,
fortran-sym-case.exp, frame-args.exp, freebpcmd.exp, fullname.exp,
funcargs.exp, gcore-buffer-overflow.exp, gcore.exp, gdb1090.exp,
gdb11530.exp, gdb11531.exp, gdb1250.exp, gdb1555.exp, gdb1821.exp,
gdbindex-stabs.exp, gdbvars.exp, gnu-ifunc.exp, gnu_vector.exp:
Use standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:50:30 +02:00
|
|
|
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
|
2008-05-04 06:04:11 +02:00
|
|
|
pass $msg
|
|
|
|
} else {
|
|
|
|
fail $msg
|
|
|
|
}
|
|
|
|
|
|
|
|
# Build the test executable using relative paths not relative to the directory
|
|
|
|
# we'll run GDB from.
|
|
|
|
|
|
|
|
set save_pwd [pwd]
|
2013-08-23 20:18:57 +02:00
|
|
|
cd [standard_output_file {}]
|
test suite update - gdb.base/[efg]
Convert files gdb.base/[efg]*.exp to use standard_output_file et al.
* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.exp,
eu-strip-infcall.exp, eval-skip.exp, exe-lock.exp,
expand-psymtabs.exp, exprs.exp, fileio.exp, find.exp,
fixsection.exp, foll-exec.exp, foll-fork.exp,
fortran-sym-case.exp, frame-args.exp, freebpcmd.exp, fullname.exp,
funcargs.exp, gcore-buffer-overflow.exp, gcore.exp, gdb1090.exp,
gdb11530.exp, gdb11531.exp, gdb1250.exp, gdb1555.exp, gdb1821.exp,
gdbindex-stabs.exp, gdbvars.exp, gnu-ifunc.exp, gnu_vector.exp:
Use standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:50:30 +02:00
|
|
|
if { [gdb_compile [standard_output_file tmp-${srcfile}] "${testfile}" \
|
|
|
|
executable {debug}] != "" } {
|
2008-07-09 12:50:52 +02:00
|
|
|
cd $save_pwd
|
2008-05-04 06:04:11 +02:00
|
|
|
return -1
|
|
|
|
}
|
|
|
|
cd $save_pwd
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
gdb_start
|
|
|
|
gdb_load ${binfile}
|
|
|
|
|
|
|
|
set msg "set breakpoint by full path before loading symbols - built other"
|
test suite update - gdb.base/[efg]
Convert files gdb.base/[efg]*.exp to use standard_output_file et al.
* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.exp,
eu-strip-infcall.exp, eval-skip.exp, exe-lock.exp,
expand-psymtabs.exp, exprs.exp, fileio.exp, find.exp,
fixsection.exp, foll-exec.exp, foll-fork.exp,
fortran-sym-case.exp, frame-args.exp, freebpcmd.exp, fullname.exp,
funcargs.exp, gcore-buffer-overflow.exp, gcore.exp, gdb1090.exp,
gdb11530.exp, gdb11531.exp, gdb1250.exp, gdb1555.exp, gdb1821.exp,
gdbindex-stabs.exp, gdbvars.exp, gnu-ifunc.exp, gnu_vector.exp:
Use standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:50:30 +02:00
|
|
|
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
|
2008-05-04 06:04:11 +02:00
|
|
|
pass $msg
|
|
|
|
} else {
|
|
|
|
fail $msg
|
|
|
|
}
|
|
|
|
|
|
|
|
gdb_test "break main" \
|
|
|
|
"Breakpoint.*at.*line.*" "set breakpoint at main - built other"
|
|
|
|
|
|
|
|
set msg "set breakpoint by full path after loading symbols - built other"
|
test suite update - gdb.base/[efg]
Convert files gdb.base/[efg]*.exp to use standard_output_file et al.
* ena-dis-br.exp, enum_cond.exp, enumval.exp, environ.exp,
eu-strip-infcall.exp, eval-skip.exp, exe-lock.exp,
expand-psymtabs.exp, exprs.exp, fileio.exp, find.exp,
fixsection.exp, foll-exec.exp, foll-fork.exp,
fortran-sym-case.exp, frame-args.exp, freebpcmd.exp, fullname.exp,
funcargs.exp, gcore-buffer-overflow.exp, gcore.exp, gdb1090.exp,
gdb11530.exp, gdb11531.exp, gdb1250.exp, gdb1555.exp, gdb1821.exp,
gdbindex-stabs.exp, gdbvars.exp, gnu-ifunc.exp, gnu_vector.exp:
Use standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:50:30 +02:00
|
|
|
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
|
2008-05-04 06:04:11 +02:00
|
|
|
pass $msg
|
|
|
|
} else {
|
|
|
|
fail $msg
|
|
|
|
}
|