Fixed test case to compile & run on FreeBSD
authorRajendra SY <rajendra.sy@gmail.com>
Sun, 22 Apr 2018 22:19:26 +0000 (18:19 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sun, 22 Apr 2018 22:20:05 +0000 (18:20 -0400)
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
gdb/testsuite/gdb.base/break-probes.exp

index 70c461a4b3ac04e1b0de4fee0e8b687cbc3d1e9e..063a77120065b6d7afdf6a10ffece363796bd065 100644 (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>
 
index 22aa66171c860ae3c4679d58018f1663529f6c94..664b911fdf2242d86c78e91c72cd5e29f9e1be03 100644 (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
 }
 
This page took 0.028993 seconds and 4 git commands to generate.