Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* PATCH: Use is_x86_like_target to check x86 targets
@ 2012-10-11 15:29 H.J. Lu
  2012-10-11 17:27 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2012-10-11 15:29 UTC (permalink / raw)
  To: GDB

Hi,

Use

if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]) || ![is_ilp32_target] } then {

to check x86 targets doesn't work for x32.  This patch uses
is_x86_like_target to check x86 targets.  Tested on x32, ia32 and x86-64.
OK to install?

Thanks.


H.J.
---
2012-10-11  H.J. Lu  <hongjiu.lu@intel.com>

	* gdb.arch/i386-bp_permanent.exp: Skip if not is_x86_like_target.
	* gdb.arch/i386-cfi-notcurrent.exp: Likewise.
	* gdb.arch/i386-disp-step.exp: Likewise.
	* gdb.arch/i386-gnu-cfi.exp: Likewise.
	* gdb.arch/i386-prologue.exp: Likewise.
	* gdb.arch/i386-size-overlap.exp: Likewise.
	* gdb.arch/i386-size.exp: Likewise.
	* gdb.arch/i386-unwind.exp: Likewise.

diff --git a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
index 026f956..907eb95 100644
--- a/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
+++ b/gdb/testsuite/gdb.arch/i386-bp_permanent.exp
@@ -18,7 +18,7 @@
 
 # Test stepping over permanent breakpoints on i386.
 
-if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]) || ![is_ilp32_target] } then {
+if { ![is_x86_like_target] } then {
     verbose "Skipping skip over permanent breakpoint on i386 tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.exp b/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.exp
index cf41c57..52731f7 100644
--- a/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.exp
+++ b/gdb/testsuite/gdb.arch/i386-cfi-notcurrent.exp
@@ -16,7 +16,7 @@
 # [RFA] DWARF frame unwinder executes one too many rows
 # http://sourceware.org/ml/gdb-patches/2012-07/msg00650.html
 
-if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]) || ![is_ilp32_target] } {
+if { ![is_x86_like_target] } {
     return 0
 }
 
diff --git a/gdb/testsuite/gdb.arch/i386-disp-step.exp b/gdb/testsuite/gdb.arch/i386-disp-step.exp
index 8a51be5..bf7f985 100644
--- a/gdb/testsuite/gdb.arch/i386-disp-step.exp
+++ b/gdb/testsuite/gdb.arch/i386-disp-step.exp
@@ -18,7 +18,7 @@
 # Test i386 displaced stepping.
 
 
-if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]) || ![is_ilp32_target] } then {
+if { ![is_x86_like_target] } then {
     verbose "Skipping x86 displaced stepping tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp b/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
index d7b41cc..f603fc5 100644
--- a/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
+++ b/gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
@@ -23,7 +23,7 @@
 # Test i386 unwinder.
 
 
-if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]) || ![is_ilp32_target] } then {
+if { ![is_x86_like_target] } then {
     verbose "Skipping i386 unwinder tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-prologue.exp b/gdb/testsuite/gdb.arch/i386-prologue.exp
index 2e724aa..b48952f 100644
--- a/gdb/testsuite/gdb.arch/i386-prologue.exp
+++ b/gdb/testsuite/gdb.arch/i386-prologue.exp
@@ -21,7 +21,7 @@
 # Test i386 prologue analyzer.
 
 
-if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]) || ![is_ilp32_target] } then {
+if { ![is_x86_like_target] } then {
     verbose "Skipping i386 prologue tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-size-overlap.exp b/gdb/testsuite/gdb.arch/i386-size-overlap.exp
index 23cbabc..67d5db1 100644
--- a/gdb/testsuite/gdb.arch/i386-size-overlap.exp
+++ b/gdb/testsuite/gdb.arch/i386-size-overlap.exp
@@ -17,7 +17,7 @@
 
 # Test that GDB can handle overlapping sizes of symbols.
 
-if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]) || ![is_ilp32_target] } then {
+if { ![is_x86_like_target] } then {
     verbose "Skipping i386 unwinder tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-size.exp b/gdb/testsuite/gdb.arch/i386-size.exp
index 241d939..0f0b1d8 100644
--- a/gdb/testsuite/gdb.arch/i386-size.exp
+++ b/gdb/testsuite/gdb.arch/i386-size.exp
@@ -20,7 +20,7 @@
 
 # Test that GDB can see the sizes of symbols.
 
-if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]) || ![is_ilp32_target] } then {
+if { ![is_x86_like_target] } then {
     verbose "Skipping i386 unwinder tests."
     return
 }
diff --git a/gdb/testsuite/gdb.arch/i386-unwind.exp b/gdb/testsuite/gdb.arch/i386-unwind.exp
index 4ae5943..89fcbc9 100644
--- a/gdb/testsuite/gdb.arch/i386-unwind.exp
+++ b/gdb/testsuite/gdb.arch/i386-unwind.exp
@@ -21,7 +21,7 @@
 # Test i386 unwinder.
 
 
-if {(![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]) || ![is_ilp32_target] } then {
+if { ![is_x86_like_target] } then {
     verbose "Skipping i386 unwinder tests."
     return
 }


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

* Re: PATCH: Use is_x86_like_target to check x86 targets
  2012-10-11 15:29 PATCH: Use is_x86_like_target to check x86 targets H.J. Lu
@ 2012-10-11 17:27 ` Pedro Alves
  2012-10-11 17:37   ` H.J. Lu
  2012-10-11 17:38   ` Pedro Alves
  0 siblings, 2 replies; 4+ messages in thread
From: Pedro Alves @ 2012-10-11 17:27 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GDB

Some of these tests are written in assembly and have things like:

    "gdb1435:\n"
    "    pushl %ebp\n"
    "    mov   %esp, %ebp\n"
    "    call  " SYMBOL (trap) "\n"

I thought this use of 32-bit regs wouldn't be correct for x32.

-- 
Pedro Alves


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

* Re: PATCH: Use is_x86_like_target to check x86 targets
  2012-10-11 17:27 ` Pedro Alves
@ 2012-10-11 17:37   ` H.J. Lu
  2012-10-11 17:38   ` Pedro Alves
  1 sibling, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2012-10-11 17:37 UTC (permalink / raw)
  To: Pedro Alves; +Cc: GDB

On Thu, Oct 11, 2012 at 10:27 AM, Pedro Alves <palves@redhat.com> wrote:
> Some of these tests are written in assembly and have things like:
>
>     "gdb1435:\n"
>     "    pushl %ebp\n"
>     "    mov   %esp, %ebp\n"
>     "    call  " SYMBOL (trap) "\n"
>
> I thought this use of 32-bit regs wouldn't be correct for x32.
>
> --
> Pedro Alves
>

We have

# Return 1 if this target is an x86 or x86-64 with -m32.
proc is_x86_like_target {} {
    if {![istarget "x86_64-*-*"] && ![istarget i?86-*]} {
        return 0
    }
    return [expr [is_ilp32_target] && ![is_amd64_regs_target]]
}

is_x86_like_target returns 0 for -mx32 and -m64.

-- 
H.J.


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

* Re: PATCH: Use is_x86_like_target to check x86 targets
  2012-10-11 17:27 ` Pedro Alves
  2012-10-11 17:37   ` H.J. Lu
@ 2012-10-11 17:38   ` Pedro Alves
  1 sibling, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2012-10-11 17:38 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GDB

On 10/11/2012 06:27 PM, Pedro Alves wrote:
> Some of these tests are written in assembly and have things like:
> 
>     "gdb1435:\n"
>     "    pushl %ebp\n"
>     "    mov   %esp, %ebp\n"
>     "    call  " SYMBOL (trap) "\n"
> 
> I thought this use of 32-bit regs wouldn't be correct for x32.

Nevermind, that was silly.

Patch is OK.

-- 
Pedro Alves


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

end of thread, other threads:[~2012-10-11 17:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-11 15:29 PATCH: Use is_x86_like_target to check x86 targets H.J. Lu
2012-10-11 17:27 ` Pedro Alves
2012-10-11 17:37   ` H.J. Lu
2012-10-11 17:38   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox