From db86b02b3ac8426f3fc0754f48f3645235cc2ae6 Mon Sep 17 00:00:00 2001 From: Rajendra SY Date: Sun, 22 Apr 2018 18:19:26 -0400 Subject: [PATCH] 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. --- gdb/ChangeLog | 7 +++++++ gdb/testsuite/gdb.base/break-probes.exp | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 70c461a4b3a..063a7712006 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2018-04-22 Rajendra SY + + 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 Rajendra SY diff --git a/gdb/testsuite/gdb.base/break-probes.exp b/gdb/testsuite/gdb.base/break-probes.exp index 22aa66171c8..664b911fdf2 100644 --- a/gdb/testsuite/gdb.base/break-probes.exp +++ b/gdb/testsuite/gdb.base/break-probes.exp @@ -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 } -- 2.30.2