Discussion:
[Bug gdb/23104] New: Test case gdb.base/info-shared.exp fails on FreeBSD
rajendra.sy at gmail dot com
2018-04-22 02:44:29 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23104

Bug ID: 23104
Summary: Test case gdb.base/info-shared.exp fails on FreeBSD
Product: gdb
Version: HEAD
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: rajendra.sy at gmail dot com
Target Milestone: ---

Issue:
Linking "-dl" library when compiling test source fails on FreeBSD platform

I tried adding "debug shlib_load" to prepare_for_testing solves the
compilation error but breaks the test case on Linux & FreeBSD with 6 failures.

Failed test cases:
FAIL: gdb.base/info-shared.exp: continue to breakpoint: library load #1
FAIL: gdb.base/info-shared.exp: continue to breakpoint: library load #2
FAIL: gdb.base/info-shared.exp: continue to breakpoint: library load #3
FAIL: gdb.base/info-shared.exp: continue to breakpoint: library load #4
FAIL: gdb.base/info-shared.exp: continue to breakpoint: library unload #1
FAIL: gdb.base/info-shared.exp: continue to breakpoint: library unload #2

Expected output does not match:
Earlier: Breakpoint 2, 0x000000000040064a in stop ()

With shlib_load change : Breakpoint 2, stop () at
/homes/syrajendra/Rajendra/projects/compiler/gdb/gdb-8.0/binutils-gdb/gdb/testsuite/gdb.base/info-shared.c:23

The gdb/testsuite/lib/gdb.exp:577 function gdb_continue_to_breakpoint does not
seem to handle this new output.
--
You are receiving this mail because:
You are on the CC list for the bug.
rajendra.sy at gmail dot com
2018-04-22 02:56:37 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23104

--- Comment #1 from Rajendra S Y <rajendra.sy at gmail dot com> ---
Possible solutions:
1. Update gdb_continue_to_breakpoint function to handle new output
2. Update gdb_compile function do not add -rpath by default ( lappend
new_options "ldflags=-Wl,-rpath,\\\$ORIGIN" )
3. Add a check in test case skip "-ldl" option

Please suggest.
--
You are receiving this mail because:
You are on the CC list for the bug.
simon.marchi at ericsson dot com
2018-04-23 20:50:04 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23104

Simon Marchi <simon.marchi at ericsson dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |simon.marchi at ericsson dot com

--- Comment #2 from Simon Marchi <simon.marchi at ericsson dot com> ---
It works here on Linux if I just change libs=-ldl for shlib_load.

You are right that adding "debug" too makes the test fail, but I would consider
it as a separate change. Do you need to add it to make the test pass on
FreeBSD?
--
You are receiving this mail because:
You are on the CC list for the bug.
rajendra.sy at gmail dot com
2018-04-24 00:11:26 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23104

--- Comment #3 from Rajendra S Y <rajendra.sy at gmail dot com> ---
Adding "debug" causes the failure on FreeBSD too.
Just changing libs=-ldl with shlib_load works, test case compiled fine & I see
19 passes & no failures on FreeBSD.
Please push this change.
--
You are receiving this mail because:
You are on the CC list for the bug.
cvs-commit at gcc dot gnu.org
2018-04-24 14:16:29 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23104

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Marchi <***@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0a8ddac418d3e8e12a1bb51c3b0da90155f83403

commit 0a8ddac418d3e8e12a1bb51c3b0da90155f83403
Author: Simon Marchi <***@ericsson.com>
Date: Tue Apr 24 10:14:14 2018 -0400

info-shared.exp: Replace libs=-ldl with shlib_load

As reported in PR 23104, -ldl doesn't work on FreeBSD. Replace it with
shlib_load, which adds the right flags for dynamic library loading based
on the current target platform.

The test still passes on Linux, and should now pass on FreeBSD, though I
did not test personally.

gdb/testsuite/ChangeLog:

PR gdb/23104
* gdb.base/info-shared.exp: Replace libs=-ldl with shlib_load.
--
You are receiving this mail because:
You are on the CC list for the bug.
simon.marchi at ericsson dot com
2018-04-24 14:19:02 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23104

Simon Marchi <simon.marchi at ericsson dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED

--- Comment #5 from Simon Marchi <simon.marchi at ericsson dot com> ---
Pushed.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...