Fixed test case to compile & run on FreeBSD

Problems:
1. linking -dl lib on FreeBSD platform
2. backtrace from ld-elf shows r_debug_state() instead of _dl_debug_state()

Cause:
1. There is no dl library on FreeBSD platform test has to ignore linking "-ldl"
2. The stop due to a shared library event shows backtrace frame #0
   function as r_debug_state()

gdb/ChangeLog:

	PR gdb/23095
	* gdb/testsuite/gdb.base/break-probes.exp: Pass shlib_load to
	prepare_for_testing.  Set normal_bp to r_debug_state if target
	is bsd.
This commit is contained in:
Rajendra SY 2018-04-22 18:19:26 -04:00 committed by Simon Marchi
parent b2c5b54ee3
commit db86b02b3a
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2018-04-22 Rajendra SY <rajendra.sy@gmail.com>
PR gdb/23095
* gdb/testsuite/gdb.base/break-probes.exp: Pass shlib_load to
prepare_for_testing. Set normal_bp to r_debug_state if target
is bsd.
2018-04-21 Pedro Alves <palves@redhat.com>
Rajendra SY <rajendra.sy@gmail.com>

View File

@ -23,7 +23,11 @@ set libname $testfile-solib
set srcfile_lib $srcdir/$subdir/$libname.c
set binfile_lib [standard_output_file $libname.so]
set normal_bp "_dl_debug_state"
if { [istarget "*bsd*"] } {
set normal_bp "r_debug_state"
} else {
set normal_bp "_dl_debug_state"
}
set probes_bp "dl_main"
if { [gdb_compile_shlib $srcfile_lib $binfile_lib \
@ -33,7 +37,7 @@ if { [gdb_compile_shlib $srcfile_lib $binfile_lib \
}
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
[list additional_flags=-DSHLIB_NAME=\"$binfile_lib\" libs=-ldl]] } {
[list debug shlib_load additional_flags=-DSHLIB_NAME=\"$binfile_lib\"]] } {
return -1
}