gdb/testsuite/
* gdb.base/break-interp-main.c, gdb.base/break-interp-lib.c: New. * gdb.base/break-interp.exp: Exit on skip_shlib_tests. Change $srcfile. New variables $binfile_lib and $srcfile_lib. Call get_compiler_info and gdb_compile_shlib. Use new -Wl compiler options. (dl bt, main bt): New tests.
This commit is contained in:
parent
51bee8e9b7
commit
06a6f27066
|
@ -1,3 +1,11 @@
|
||||||
|
2010-01-14 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* gdb.base/break-interp-main.c, gdb.base/break-interp-lib.c: New.
|
||||||
|
* gdb.base/break-interp.exp: Exit on skip_shlib_tests. Change $srcfile.
|
||||||
|
New variables $binfile_lib and $srcfile_lib. Call get_compiler_info
|
||||||
|
and gdb_compile_shlib. Use new -Wl compiler options.
|
||||||
|
(dl bt, main bt): New tests.
|
||||||
|
|
||||||
2010-01-14 Jan Kratochvil <jan.kratochvil@redhat.com>
|
2010-01-14 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
Support PIEs with no symfile_objfile.
|
Support PIEs with no symfile_objfile.
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
/* This testcase is part of GDB, the GNU debugger.
|
||||||
|
|
||||||
|
Copyright 2009 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 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/>. */
|
||||||
|
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
|
void
|
||||||
|
libfunc (void)
|
||||||
|
{
|
||||||
|
raise (SIGSEGV);
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
/* This testcase is part of GDB, the GNU debugger.
|
||||||
|
|
||||||
|
Copyright 2009 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 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/>. */
|
||||||
|
|
||||||
|
extern void libfunc (void);
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
libfunc ();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -14,7 +14,7 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# This test only works on GNU/Linux.
|
# This test only works on GNU/Linux.
|
||||||
if { ![isnative] || [is_remote host] || ![istarget *-linux*] } {
|
if { ![isnative] || [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,21 @@ set binprefix ${objdir}/${subdir}/${test}
|
||||||
# Only to get the $interp_system name.
|
# Only to get the $interp_system name.
|
||||||
set srcfile_test "start.c"
|
set srcfile_test "start.c"
|
||||||
set binfile_test ${test}-test
|
set binfile_test ${test}-test
|
||||||
set srcfile "start.c"
|
set binfile_lib ${objdir}/${subdir}/${test}.so
|
||||||
|
set srcfile "${test}-main.c"
|
||||||
|
set srcfile_lib "${test}-lib.c"
|
||||||
|
|
||||||
|
if [get_compiler_info ${binfile_lib}] {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Use -soname so that it is listed with " => " by ldd and this testcase makes
|
||||||
|
# a copy of ${binfile_lib} for each prelink variant.
|
||||||
|
|
||||||
|
if {[gdb_compile_shlib ${srcdir}/${subdir}/${srcfile_lib} ${binfile_lib} [list debug additional_flags=-Wl,-soname,${test}.so]] != ""} {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
if {[build_executable ${test}.exp $binfile_test ${srcfile_test} {}] == -1} {
|
if {[build_executable ${test}.exp $binfile_test ${srcfile_test} {}] == -1} {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
@ -236,8 +250,15 @@ proc test_ld {file ifmain trynosym} {
|
||||||
gdb_load $file
|
gdb_load $file
|
||||||
|
|
||||||
reach "dl_main" run
|
reach "dl_main" run
|
||||||
|
|
||||||
|
gdb_test "bt" "#0 +\[^\r\n\]*\\mdl_main\\M.*" "dl bt"
|
||||||
|
|
||||||
if $ifmain {
|
if $ifmain {
|
||||||
reach "main" continue
|
reach "main" continue
|
||||||
|
|
||||||
|
reach "libfunc" continue
|
||||||
|
|
||||||
|
gdb_test "bt" "#0 +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#1 +\[^\r\n\]*\\mmain\\M.*" "main bt"
|
||||||
}
|
}
|
||||||
|
|
||||||
if !$trynosym {
|
if !$trynosym {
|
||||||
|
@ -389,6 +410,7 @@ foreach ldprelink {NO YES} {
|
||||||
lappend pf_prefix "$binname:"
|
lappend pf_prefix "$binname:"
|
||||||
|
|
||||||
set opts "additional_flags=-Wl,--dynamic-linker,$interp,-rpath,$dir"
|
set opts "additional_flags=-Wl,--dynamic-linker,$interp,-rpath,$dir"
|
||||||
|
lappend opts "additional_flags=-Wl,$binfile_lib,-rpath,[file dirname $binfile_lib]"
|
||||||
if {$binsepdebug != "NO"} {
|
if {$binsepdebug != "NO"} {
|
||||||
lappend opts {debug}
|
lappend opts {debug}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue