public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Skip dlopen-libpthread.exp in cross testing
@ 2014-09-25  7:57 Yao Qi
  2014-09-25 15:38 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Yao Qi @ 2014-09-25  7:57 UTC (permalink / raw)
  To: gdb-patches

I see the following fails on arm-linux-gnueabi,

result of ldd build-git/arm/gdb/testsuite/gdb.threads/dlopen-libpthread.so is 1
output of ldd build-git/arm/gdb/testsuite/gdb.threads/dlopen-libpthread.so is not a dynamic executable
child process exited abnormally
FAIL: gdb.threads/dlopen-libpthread.exp: ldd dlopen-libpthread.so
FAIL: gdb.threads/dlopen-libpthread.exp: ldd dlopen-libpthread.so output contains libs

the test script invokes ldd (on host) for the target libraries, which
is wrong.  ldd can't be cross because it invokes dynamic linker with
LD_TRACE_LOADED_OBJECTS and gets the dependent libraries.  My first
reaction to this problem is to execute ld.so on the target (like
remote_exec target).  When I start to hack proc build_executable_own_libs,
I find it has assumptions here and there that the native testing is
performed.  Then I check the callers of build_executable_own_libs,
and they are all skipped if isnative is false.  It is reasonable to do
the same in dlopen-libpthread.exp too.

gdb/testsuite:

2014-09-25  Yao Qi  <yao@codesourcery.com>

	* gdb.threads/dlopen-libpthread.exp: Skip it if isnative is
	false.
---
 gdb/testsuite/gdb.threads/dlopen-libpthread.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.threads/dlopen-libpthread.exp b/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
index f0e3358..265eb5d 100644
--- a/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
+++ b/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if {![istarget *-linux*] || [skip_shlib_tests]} {
+if {![isnative] || ![istarget *-linux*] || [skip_shlib_tests]} {
     return 0
 }
 
-- 
1.9.3

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Skip dlopen-libpthread.exp in cross testing
  2014-09-25  7:57 [PATCH] Skip dlopen-libpthread.exp in cross testing Yao Qi
@ 2014-09-25 15:38 ` Pedro Alves
  2014-09-28  3:51   ` Yao Qi
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2014-09-25 15:38 UTC (permalink / raw)
  To: Yao Qi, gdb-patches

On 09/25/2014 08:52 AM, Yao Qi wrote:
> performed.  Then I check the callers of build_executable_own_libs,
> and they are all skipped if isnative is false.  It is reasonable to do
> the same in dlopen-libpthread.exp too.

Agreed.

I think we should put an "error" call in build_executable_own_libs
too, so that whoever adds the next test that uses this doesn't
end up forgetting the same thing.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Skip dlopen-libpthread.exp in cross testing
  2014-09-25 15:38 ` Pedro Alves
@ 2014-09-28  3:51   ` Yao Qi
  2014-09-29 15:28     ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Yao Qi @ 2014-09-28  3:51 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Pedro Alves <palves@redhat.com> writes:

> I think we should put an "error" call in build_executable_own_libs
> too, so that whoever adds the next test that uses this doesn't
> end up forgetting the same thing.

OK, how about this below?

Subject: [PATCH] Error in build_executable_own_libs for non-native target

gdb/testsuite:

2014-09-28  Yao Qi  <yao@codesourcery.com>

	* lib/prelink-support.exp (build_executable_own_libs): Error if
	the target isn't native.

diff --git a/gdb/testsuite/lib/prelink-support.exp b/gdb/testsuite/lib/prelink-support.exp
index a0fb12b..113a078 100644
--- a/gdb/testsuite/lib/prelink-support.exp
+++ b/gdb/testsuite/lib/prelink-support.exp
@@ -118,6 +118,10 @@ proc file_copy {src dest} {
 proc build_executable_own_libs {testname executable sources options {interp ""} {dir ""}} {
     global subdir
 
+    if { ![isnative] } {
+	error "This proc can be only used for native target."
+    }
+
     if {[build_executable $testname $executable $sources $options] == -1} {
 	return ""
     }
-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Skip dlopen-libpthread.exp in cross testing
  2014-09-28  3:51   ` Yao Qi
@ 2014-09-29 15:28     ` Pedro Alves
  2014-09-30  4:05       ` Yao Qi
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2014-09-29 15:28 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 09/28/2014 04:47 AM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
> 
>> I think we should put an "error" call in build_executable_own_libs
>> too, so that whoever adds the next test that uses this doesn't
>> end up forgetting the same thing.
> 
> OK, how about this below?
> 
> Subject: [PATCH] Error in build_executable_own_libs for non-native target
> 
> gdb/testsuite:
> 
> 2014-09-28  Yao Qi  <yao@codesourcery.com>
> 
> 	* lib/prelink-support.exp (build_executable_own_libs): Error if
> 	the target isn't native.

Looks good, thanks.

Pedro Alves

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Skip dlopen-libpthread.exp in cross testing
  2014-09-29 15:28     ` Pedro Alves
@ 2014-09-30  4:05       ` Yao Qi
  0 siblings, 0 replies; 5+ messages in thread
From: Yao Qi @ 2014-09-30  4:05 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Pedro Alves <palves@redhat.com> writes:

> Looks good, thanks.

Great, two patches are pushed in.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-30  4:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-25  7:57 [PATCH] Skip dlopen-libpthread.exp in cross testing Yao Qi
2014-09-25 15:38 ` Pedro Alves
2014-09-28  3:51   ` Yao Qi
2014-09-29 15:28     ` Pedro Alves
2014-09-30  4:05       ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).