public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: disable break-interp.exp for Arm buildbot
@ 2019-08-09  9:21 Alan Hayward
  2019-08-09 17:22 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Hayward @ 2019-08-09  9:21 UTC (permalink / raw)
  To: gdb-patches; +Cc: nd, Alan Hayward

[As a side note, the Arm buildbot worker is now up and running!]

[The better solution here would be to fix stop on solib, but I have no idea
 why it's failing (yet working on a real Arm box, which is where it really
 matters), for the moment I'd rather get buildbot working.]

Add is_aarch32_on_aarch64_target to detect an Arm target that is running on
AArch64 (for example, in an AArch64 docker).  The key here is that the target
will be Arm, but uname will still report AArch64.

Use this test to disable gdb.base/break-interp.exp, as this test currently
generates 132 sequential timeouts.

This change will enable the Arm buildbot worker setup to run the testsuite
within a reasonable timeframe.

gdb/testsuite/ChangeLog:

2019-08-09  Alan Hayward  <alan.hayward@arm.com>

	* gdb.base/break-interp.exp: Skip if is AArch32 on AArch64 target.
	* lib/future.exp (gdb_find_uname): New procedure.
	* lib/gdb.exp (is_aarch32_on_aarch64_target): Likewise.
---
 gdb/testsuite/gdb.base/break-interp.exp |  3 ++-
 gdb/testsuite/lib/future.exp            | 10 ++++++++++
 gdb/testsuite/lib/gdb.exp               | 20 ++++++++++++++++++++
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index d6da653529..6a366db49f 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -15,7 +15,8 @@
 
 # This test only works on GNU/Linux.
 if { ![isnative] || [is_remote host] || [use_gdb_stub]
-     || ![istarget *-linux*] || [skip_shlib_tests]} {
+     || ![istarget *-linux*] || [skip_shlib_tests]
+     || [is_aarch32_on_aarch64_target]} {
     continue
 }
 
diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp
index 122e652858..d43dd95904 100644
--- a/gdb/testsuite/lib/future.exp
+++ b/gdb/testsuite/lib/future.exp
@@ -172,6 +172,16 @@ proc gdb_find_eu-unstrip {} {
     return $eu_unstrip
 }
 
+proc gdb_find_uname {} {
+    global UNAME_FOR_TARGET
+    if [info exists UNAME_FOR_TARGET] {
+	set uname $UNAME_FOR_TARGET
+    } else {
+	set uname [transform uname]
+    }
+    return $uname
+}
+
 proc gdb_default_target_compile {source destfile type options} {
     global target_triplet
     global tool_root_dir
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index edc8dfcdfd..ffdb763104 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2629,6 +2629,26 @@ proc is_aarch64_target {} {
     return [expr ![is_aarch32_target]]
 }
 
+# Return 1 if this target is AArch32/Arm running on AArch64.
+
+proc is_aarch32_on_aarch64_target {} {
+    if { ![istarget "arm*-*-*"] } {
+	return 0
+    }
+
+    set uname_program [gdb_find_uname]
+    set command "exec $uname_program -m"
+    verbose -log "command is $command"
+    set result [catch $command output]
+    verbose -log "result is $result"
+    verbose -log "output is $output"
+    if {$result == 0 && [string match $output "aarch64"]} {
+	return 1
+    }
+    return 0
+}
+
+
 # Return 1 if displaced stepping is supported on target, otherwise, return 0.
 proc support_displaced_stepping {} {
 
-- 
2.20.1 (Apple Git-117)

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

* Re: [PATCH] testsuite: disable break-interp.exp for Arm buildbot
  2019-08-09  9:21 [PATCH] testsuite: disable break-interp.exp for Arm buildbot Alan Hayward
@ 2019-08-09 17:22 ` Pedro Alves
  2019-08-12 15:53   ` Alan Hayward
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2019-08-09 17:22 UTC (permalink / raw)
  To: Alan Hayward, gdb-patches; +Cc: nd

On 8/9/19 10:21 AM, Alan Hayward wrote:

> Use this test to disable gdb.base/break-interp.exp, 

I'd rather avoid completely skipping silently, since this way 
nobody will ever remember to enable it back.

> as this test currently generates 132 sequential timeouts.

So, in the general case, when something like that happens, it's better
to make the testcase bail out earlier in response to one of the
failures.  Like, if we fail to run to a breakpoint or something, then
there's no point in continuing the parts of the testcase that depend
on running to that breakpoint.

Is there some fundamental failures in each of the iterations of
the test that we could detect to skip most of the tests in each of
the iterations?

From your mention of "fix stop on solib" not working, it sounds like the
trouble is that when the testcase does "set stop-on-solib-events 1 + run",
the inferior never stops and we time out.  Can you make reach_1 detect it
and bail out without waiting for a time out?  Like, make the testcase
put a breakpoint somewhere in case stop-on-solib-events fails to stop
the inferior.

That'd be better since it'd record the FAILs, and it would be target
independent.

Some minor comments below.

> diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
> index d6da653529..6a366db49f 100644
> --- a/gdb/testsuite/gdb.base/break-interp.exp
> +++ b/gdb/testsuite/gdb.base/break-interp.exp
> @@ -15,7 +15,8 @@
>  
>  # This test only works on GNU/Linux.
>  if { ![isnative] || [is_remote host] || [use_gdb_stub]
> -     || ![istarget *-linux*] || [skip_shlib_tests]} {
> +     || ![istarget *-linux*] || [skip_shlib_tests]
> +     || [is_aarch32_on_aarch64_target]} {
>      continue
>  }

ENOCOMMENTS.

>  
> diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp
> index 122e652858..d43dd95904 100644
> --- a/gdb/testsuite/lib/future.exp
> +++ b/gdb/testsuite/lib/future.exp
> @@ -172,6 +172,16 @@ proc gdb_find_eu-unstrip {} {
>      return $eu_unstrip
>  }
>  
> +proc gdb_find_uname {} {
> +    global UNAME_FOR_TARGET
> +    if [info exists UNAME_FOR_TARGET] {
> +	set uname $UNAME_FOR_TARGET
> +    } else {
> +	set uname [transform uname]
> +    }
> +    return $uname
> +}
> +
Not sure this should be here.  See the comment at the
top of the file.

Thanks,
Pedro Alves

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

* Re: [PATCH] testsuite: disable break-interp.exp for Arm buildbot
  2019-08-09 17:22 ` Pedro Alves
@ 2019-08-12 15:53   ` Alan Hayward
  2019-08-15 17:49     ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Hayward @ 2019-08-12 15:53 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, nd



> On 9 Aug 2019, at 18:22, Pedro Alves <palves@redhat.com> wrote:
> 
> On 8/9/19 10:21 AM, Alan Hayward wrote:
> 
>> Use this test to disable gdb.base/break-interp.exp, 
> 
> I'd rather avoid completely skipping silently, since this way 
> nobody will ever remember to enable it back.
> 
>> as this test currently generates 132 sequential timeouts.
> 
> So, in the general case, when something like that happens, it's better
> to make the testcase bail out earlier in response to one of the
> failures.  Like, if we fail to run to a breakpoint or something, then
> there's no point in continuing the parts of the testcase that depend
> on running to that breakpoint.
> 
> Is there some fundamental failures in each of the iterations of
> the test that we could detect to skip most of the tests in each of
> the iterations?
> 
> From your mention of "fix stop on solib" not working, it sounds like the
> trouble is that when the testcase does "set stop-on-solib-events 1 + run",
> the inferior never stops and we time out.  Can you make reach_1 detect it
> and bail out without waiting for a time out?  Like, make the testcase
> put a breakpoint somewhere in case stop-on-solib-events fails to stop
> the inferior.
> 
> That'd be better since it'd record the FAILs, and it would be target
> independent.
> 

Agreed. It’s not quite that simple - the failures happen in cases where there
is no debug (eg BINprelinkNOdebugNOpieNO), so there is nowhere I can place
a breakpoint.

Maybe exit the test case if one of them times out?  (I’m not keen on that either).


Alan.


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

* Re: [PATCH] testsuite: disable break-interp.exp for Arm buildbot
  2019-08-12 15:53   ` Alan Hayward
@ 2019-08-15 17:49     ` Pedro Alves
  0 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2019-08-15 17:49 UTC (permalink / raw)
  To: Alan Hayward; +Cc: gdb-patches, nd

On 8/12/19 4:53 PM, Alan Hayward wrote:

> Agreed. It’s not quite that simple - the failures happen in cases where there
> is no debug (eg BINprelinkNOdebugNOpieNO), so there is nowhere I can place
> a breakpoint.

Even if you have no debug info, you should still be able to put a breakpoint
on functions.  GDB knows the functions exist from the ELF symbol tables (minsyms):

 Reading symbols from testsuite/outputs/gdb.base/break-interp/break-interp-BINprelinkNOdebugNOpieNO...
 (No debugging symbols found in testsuite/outputs/gdb.base/break-interp/break-interp-BINprelinkNOdebugNOpieNO)
 (gdb) b main
 Breakpoint 1 at 0x40074b
 (gdb) 

Thanks,
Pedro Alves

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

end of thread, other threads:[~2019-08-15 17:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09  9:21 [PATCH] testsuite: disable break-interp.exp for Arm buildbot Alan Hayward
2019-08-09 17:22 ` Pedro Alves
2019-08-12 15:53   ` Alan Hayward
2019-08-15 17:49     ` Pedro Alves

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).