From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by sourceware.org (Postfix) with ESMTPS id E23CE3858D28 for ; Thu, 26 Jan 2023 18:34:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E23CE3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f45.google.com with SMTP id fl24so1763698wmb.1 for ; Thu, 26 Jan 2023 10:34:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3GaxguPo2/oMBYut6PB+c5zAurz9MDcnax8rQIEn7eQ=; b=Z/m4vluSN3q9jC/p9cwO0lcPgJeI3jtGs+mtmmYYuzBo8PPYANghiEG+2oprzCjipA /soNa+9YyzCk2mwXMgAI/20Jc83gLHcIla4r+QHmUHfQb3MJUCVEfnjgxPdDq6YUUeHJ czfs7fxid2HLZhtZUXr19TiX3iJdKisukfik+f2SMygvoVFFwSUHftvHoTxhypj7arK+ 9EuxS5gHlWT1MFT9ynOLx9QVDNTJJKMvbRiv4AyRV+EikBsW0UUy4lIcovVmtqyzCusH H7BPSHZGvRXhrNQ/4LyQ87TPwMB5dP+qzPh7oZ1BPOUnFu8v66nUpzWS7EvoV3h15bQM TTbA== X-Gm-Message-State: AO0yUKXYOf+Stb3fwgKeck2QZEDJam9DLtsszVcjRKHVK036mqD23vg+ TqFMsTLUa8lsY3ESoj/OGNdwYpmfiIal/Q== X-Google-Smtp-Source: AK7set9f6CFdyRQZ8vCfAV8QBeTe8wEui36Eo1WGw/vbGFPgHmS0Bzwcq3YA98IhFyDdcndLb1uupQ== X-Received: by 2002:a05:600c:4691:b0:3dc:24fc:ef6f with SMTP id p17-20020a05600c469100b003dc24fcef6fmr3524715wmo.40.1674758050540; Thu, 26 Jan 2023 10:34:10 -0800 (PST) Received: from ?IPv6:2001:8a0:f92b:9e00::1fe? ([2001:8a0:f92b:9e00::1fe]) by smtp.gmail.com with ESMTPSA id v23-20020a05600c4d9700b003cfa81e2eb4sm2083672wmp.38.2023.01.26.10.34.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Jan 2023 10:34:10 -0800 (PST) Subject: Re: [pushed] [gdb/testsuite] Add and use is_x86_64_m64_target To: Tom de Vries , Tom Tromey , Tom de Vries via Gdb-patches References: <20230125200626.29340-1-tdevries@suse.de> <20230125200626.29340-4-tdevries@suse.de> <87zga6tihb.fsf@tromey.com> <0e639a56-144c-7d0b-c100-a9a6253d7075@suse.de> <87fsbxs2dn.fsf@tromey.com> <2d0bbb89-e68c-7098-58ad-ad2eed5e1355@suse.de> From: Pedro Alves Message-ID: <6fb4b81f-fe82-4e5f-01b5-b93cc518961e@palves.net> Date: Thu, 26 Jan 2023 18:34:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <2d0bbb89-e68c-7098-58ad-ad2eed5e1355@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-01-26 5:08 p.m., Tom de Vries via Gdb-patches wrote: > On 1/26/23 17:38, Pedro Alves wrote: >> On 2023-01-26 4:10 p.m., Tom Tromey wrote: >>>>>>>> "Tom" == Tom de Vries via Gdb-patches writes: >>> >>> Tom> On 1/26/23 10:17, Tom de Vries wrote: >>>>> ./gdb.base/jit-reader.exp: >>>>>    require {is_any_target "i?86-*-*" "x86_64-*-*"} is_lp64_target >>>>> ./gdb.arch/amd64-i386-address.exp: >>>>>    require {is_any_target "x86_64-*-*" "i?86-*-*"} is_lp64_target >>> >>> Tom> And, doesn't is_lp64_target imply that we're not on an "i?86-*-*" ? >>> >>> Tom> Am I missing something here? >>> >>> I am not sure.  Can you use 'gcc -m64' on an x86? >> >> Yeah, you can.  CodeSourcery toolchains used to be like that back in the day -- 32-bit >> hosted, so the target triplet indicated 32-bit, but you could use -m64 for 64-bit. >> No clue what they do nowadays. > > Ah, that's interesting, thanks. > > So, perhaps then you could indeed end up with is_lp64_target == true on an i?86 (by using target board unix/-m64). Right. > > But assuming you would end up with a complete 64-bit executable, you still wouldn't been able to run it on the 32-bit target, so I think it's a corner-case that doesn't prevent us from dropping the i?86 test here. Don't know whether that's true on all operating systems. I may be misremembering -- it may be that gdb was actually built as 64-bit, but with the toolchain configured to target 32-bit by default (and thus with 32-bit triplet). In that case, then debugging would work. See: https://sourceware.org/pipermail/gdb-patches/2009-April/064685.html "x86 -m64" is also why is_amd64_regs_target also runs the test for [istarget "i?86-*"]: # Return 1 if target has x86_64 registers - either amd64 or x32. # x32 target identifies as x86_64-*-linux*, therefore it cannot be determined # just from the target string. gdb_caching_proc is_amd64_regs_target { if {![istarget "x86_64-*-*"] && ![istarget "i?86-*"]} { return 0 } Pedro Alves > > Thanks, > - Tom > >> >> Pedro Alves >> >>> Or could you have a >>> 64-bit machine that advertises as i386 if userspace is mostly 32-bit? >> >>