* [PATCH] [PR gdb/23095] Fixed test case to compile & run on FreeBSD
@ 2018-04-21 3:11 Rajendra SY
2018-04-21 14:59 ` Simon Marchi
0 siblings, 1 reply; 6+ messages in thread
From: Rajendra SY @ 2018-04-21 3:11 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 520 bytes --]
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()
Test passed:
PASS: gdb.base/break-probes.exp: set stop-on-solib-events 1
gdb/ChangeLog:
2018-04-20 Rajendra SY <rajendra.sy@gmail.com>
PR gdb/23095
* gdb/testsuite/gdb.base/break-probes.exp:
[-- Attachment #2: gdb-break-probes.diff --]
[-- Type: application/octet-stream, Size: 991 bytes --]
diff --git a/gdb/testsuite/gdb.base/break-probes.exp b/gdb/testsuite/gdb.base/break-probes.exp
index 22aa66171c..7dbc78e94b 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 \
@@ -32,8 +36,13 @@ if { [gdb_compile_shlib $srcfile_lib $binfile_lib \
return -1
}
+set lib_dl "-ldl"
+if { [istarget "*bsd*"] } {
+ set lib_dl ""
+}
+
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
- [list additional_flags=-DSHLIB_NAME=\"$binfile_lib\" libs=-ldl]] } {
+ [list additional_flags=-DSHLIB_NAME=\"$binfile_lib\" libs=${lib_dl}]] } {
return -1
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [PR gdb/23095] Fixed test case to compile & run on FreeBSD
2018-04-21 3:11 [PATCH] [PR gdb/23095] Fixed test case to compile & run on FreeBSD Rajendra SY
@ 2018-04-21 14:59 ` Simon Marchi
2018-04-22 1:31 ` Rajendra SY
0 siblings, 1 reply; 6+ messages in thread
From: Simon Marchi @ 2018-04-21 14:59 UTC (permalink / raw)
To: Rajendra SY; +Cc: gdb-patches
On 2018-04-20 23:10, Rajendra SY wrote:
> 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()
>
> Test passed:
> PASS: gdb.base/break-probes.exp: set stop-on-solib-events 1
>
> gdb/ChangeLog:
> 2018-04-20 Rajendra SY <rajendra.sy@gmail.com>
>
> PR gdb/23095
> * gdb/testsuite/gdb.base/break-probes.exp:
Hi Rajendra,
Instead of conditionally adding -ldl in the test, it would be better to
pass the "shlib_load" options to prepare_for_testing. It will add the
right flag depending on the platform.
It is handled here, from what I see it already considers freebsd:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/testsuite/lib/gdb.exp;h=4d48f5e3ad39967bba3ecf8cad5da5ea87f355c8;hb=HEAD#l3593
Can you try that?
The other part of the change (r_debug_state) is probably fine to keep
there, because it's very specific to this test.
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [PR gdb/23095] Fixed test case to compile & run on FreeBSD
2018-04-21 14:59 ` Simon Marchi
@ 2018-04-22 1:31 ` Rajendra SY
2018-04-22 14:11 ` Simon Marchi
0 siblings, 1 reply; 6+ messages in thread
From: Rajendra SY @ 2018-04-22 1:31 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]
Simon,
Thanks for reviewing the patch.
Attached updated patch.
Thanks
Rajendra
On Sat, Apr 21, 2018 at 8:29 PM, Simon Marchi <simon.marchi@polymtl.ca> wrote:
> On 2018-04-20 23:10, Rajendra SY wrote:
>>
>> 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()
>>
>> Test passed:
>> PASS: gdb.base/break-probes.exp: set stop-on-solib-events 1
>>
>> gdb/ChangeLog:
>> 2018-04-20 Rajendra SY <rajendra.sy@gmail.com>
>>
>> PR gdb/23095
>> * gdb/testsuite/gdb.base/break-probes.exp:
>
>
> Hi Rajendra,
>
> Instead of conditionally adding -ldl in the test, it would be better to pass
> the "shlib_load" options to prepare_for_testing. It will add the right flag
> depending on the platform.
>
> It is handled here, from what I see it already considers freebsd:
>
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/testsuite/lib/gdb.exp;h=4d48f5e3ad39967bba3ecf8cad5da5ea87f355c8;hb=HEAD#l3593
>
> Can you try that?
>
> The other part of the change (r_debug_state) is probably fine to keep there,
> because it's very specific to this test.
>
> Simon
[-- Attachment #2: gdb-break-probes.diff --]
[-- Type: application/octet-stream, Size: 907 bytes --]
diff --git a/gdb/testsuite/gdb.base/break-probes.exp b/gdb/testsuite/gdb.base/break-probes.exp
index 22aa66171c..664b911fdf 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
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [PR gdb/23095] Fixed test case to compile & run on FreeBSD
2018-04-22 1:31 ` Rajendra SY
@ 2018-04-22 14:11 ` Simon Marchi
2018-04-22 15:33 ` Rajendra SY
0 siblings, 1 reply; 6+ messages in thread
From: Simon Marchi @ 2018-04-22 14:11 UTC (permalink / raw)
To: Rajendra SY; +Cc: gdb-patches
On 2018-04-21 21:31, Rajendra SY wrote:
> Simon,
>
> Thanks for reviewing the patch.
> Attached updated patch.
>
> Thanks
> Rajendra
LGTM, thanks. Do you have push access or would you like me to push it?
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [PR gdb/23095] Fixed test case to compile & run on FreeBSD
2018-04-22 14:11 ` Simon Marchi
@ 2018-04-22 15:33 ` Rajendra SY
2018-04-22 22:21 ` Simon Marchi
0 siblings, 1 reply; 6+ messages in thread
From: Rajendra SY @ 2018-04-22 15:33 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb-patches
Simon,
I don't have push access.
Please commit.
Thanks
Rajendra
On Sun, Apr 22, 2018 at 7:41 PM, Simon Marchi <simon.marchi@polymtl.ca> wrote:
> On 2018-04-21 21:31, Rajendra SY wrote:
>>
>> Simon,
>>
>> Thanks for reviewing the patch.
>> Attached updated patch.
>>
>> Thanks
>> Rajendra
>
>
> LGTM, thanks. Do you have push access or would you like me to push it?
>
> Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [PR gdb/23095] Fixed test case to compile & run on FreeBSD
2018-04-22 15:33 ` Rajendra SY
@ 2018-04-22 22:21 ` Simon Marchi
0 siblings, 0 replies; 6+ messages in thread
From: Simon Marchi @ 2018-04-22 22:21 UTC (permalink / raw)
To: Rajendra SY; +Cc: gdb-patches
On 2018-04-22 11:32, Rajendra SY wrote:
> Simon,
>
> I don't have push access.
> Please commit.
>
> Thanks
> Rajendra
Done. I realized there was no content to the ChangeLog entry, so I made
something up.
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-04-22 22:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-21 3:11 [PATCH] [PR gdb/23095] Fixed test case to compile & run on FreeBSD Rajendra SY
2018-04-21 14:59 ` Simon Marchi
2018-04-22 1:31 ` Rajendra SY
2018-04-22 14:11 ` Simon Marchi
2018-04-22 15:33 ` Rajendra SY
2018-04-22 22:21 ` Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox