From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22474 invoked by alias); 11 Oct 2012 17:37:26 -0000 Received: (qmail 22254 invoked by uid 22791); 11 Oct 2012 17:37:24 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ob0-f169.google.com (HELO mail-ob0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Oct 2012 17:37:20 +0000 Received: by mail-ob0-f169.google.com with SMTP id va7so2346751obc.0 for ; Thu, 11 Oct 2012 10:37:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.172.199 with SMTP id be7mr1306393oec.93.1349977039984; Thu, 11 Oct 2012 10:37:19 -0700 (PDT) Received: by 10.76.144.229 with HTTP; Thu, 11 Oct 2012 10:37:19 -0700 (PDT) In-Reply-To: <50770186.9090002@redhat.com> References: <20121011152929.GC14479@gmail.com> <50770186.9090002@redhat.com> Date: Thu, 11 Oct 2012 17:37:00 -0000 Message-ID: Subject: Re: PATCH: Use is_x86_like_target to check x86 targets From: "H.J. Lu" To: Pedro Alves Cc: GDB Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00184.txt.bz2 On Thu, Oct 11, 2012 at 10:27 AM, 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. > > -- > 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.