From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by sourceware.org (Postfix) with ESMTPS id 5076E3858D34 for ; Thu, 2 Jul 2020 18:21:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5076E3858D34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wr1-f65.google.com with SMTP id a6so29617849wrm.4 for ; Thu, 02 Jul 2020 11:21:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=LGXg5s7keOhiD75CZZIMRE4tDGQZLDRvSjcFQRCttrQ=; b=CyjSHOUXA2s2Y6C9II4jMNuYAYdeUrenn7U18MNOway85oxphx5fjYqBbJvf6LdBgc 3pvhXn4StPSTIH4A3kOqJFJUkqnhZy9tp9w0FuFGy9zKiq4t7J5YEhnjL8vOI678jFxn 9Nv0MEpFLMZL38zeH+P+8ZR4whGVeVUhSwE61nezVsDXI4tAmxdujSjsx2BgyGQkNE9I ifCmcKTUW7Ej5gGOJ+4j5WVYuVRhtXCfLkX2IQt2lK+IZbizM4GcZEM4ANoacbg97uVJ FlxMBLLLydDQmjVujEBjxMZQ0fgMjAANeAYC0K+Rk10EMY0wgo5EO72XI7CCWStF4DqW jqfQ== X-Gm-Message-State: AOAM530+jPaJX/0OuvjewkWdoDAGRoguwP/BqdJjq/+qPnaMc1j8zRgc gR9w0+9T7s6RFVCT6I9DCpkjhfw9h4nrPw== X-Google-Smtp-Source: ABdhPJyQ+1MJquJZQBTiea7yOSBqP1mHdkox5JBO9GpLsI5P0wVa4kTmIBg9Cmgi0rsUiUyV5Fy0BQ== X-Received: by 2002:a5d:5647:: with SMTP id j7mr31532897wrw.242.1593714079757; Thu, 02 Jul 2020 11:21:19 -0700 (PDT) Received: from ?IPv6:2001:8a0:f922:c400:56ee:75ff:fe8d:232b? ([2001:8a0:f922:c400:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id b23sm12174410wmd.37.2020.07.02.11.21.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jul 2020 11:21:18 -0700 (PDT) Subject: Re: Building today's snapshot of GDB with MinGW To: Eli Zaretskii References: <83a70l20dn.fsf@gnu.org> <83wo3ozlvn.fsf@gnu.org> <56f26808-dfb0-6703-6f1f-9818c35946dd@polymtl.ca> <83pn9fxofc.fsf@gnu.org> <83v9j6vxey.fsf@gnu.org> <9876615e-ab54-9fc4-4892-f855901e951e@polymtl.ca> <76a315f9-ed60-93b4-10ab-95bc3bc8ae64@palves.net> <83pn9dx121.fsf@gnu.org> Cc: simon.marchi@polymtl.ca, tromey@adacore.com, brobecker@adacore.com, gdb-patches@sourceware.org From: Pedro Alves Message-ID: <5efa2c99-9960-43e1-49d2-317448d69824@palves.net> Date: Thu, 2 Jul 2020 19:21:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <83pn9dx121.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2020 18:21:22 -0000 On 7/2/20 6:46 PM, Eli Zaretskii wrote: >> Cc: tromey@adacore.com, brobecker@adacore.com, gdb-patches@sourceware.org >> From: Pedro Alves >> Date: Thu, 2 Jul 2020 15:40:20 +0100 >> >>> 290 i[34567]86-*-linux*) >>> 291 # Target: Intel 386 running GNU/Linux >>> 292 gdb_target_obs="i386-linux-tdep.o \ >>> 293 glibc-tdep.o \ >>> 294 solib-svr4.o symfile-mem.o \ >>> 295 linux-tdep.o linux-record.o" >>> 296 if test "x$enable_64_bit_bfd" = "xyes"; then >>> 297 # Target: GNU/Linux x86-64 >>> 298 gdb_target_obs="amd64-linux-tdep.o ${gdb_target_obs}" >>> 299 fi >>> 300 ;; >>> >> >> This is so a i686-linux-gnu hosted toolchain works with 64-bit binaries. >> There are vendors who prefer (or used to prefer, time has passed >> and don't know if that's still a thing) it that way, as it's a single >> build for 32-bit and 64-bit hosts that way. Users can then build >> 64-bit apps with e.g., "i686-unknown-linux-gnu-gcc -m64". Naturally, >> the debugger follows suit (though that's only useful for cross debugging, >> since for native debugging 64-bit inferiors, you need a 64-bit debugger). > > Thanks. > > AFAIK, this is impossible on Windows: a 64-bit debugger can debug > 32-bit programs (and I think GDB recently learned how to do that), but > a 32-bit debugger cannot debug 64-bit programs. > Which is exactly the same with Linux. See my parenthetical remark above. I.e., a 32-bit GNU/Linux gdb cannot debug a native 64-bit program, but it can debug against a 64-bit GNU/Linux gdbserver. So if you make a similar change for Windows, you'll make it so that a 32-bit Windows gdb could debug against a 64-bit Windows gdbserver. Whether that's really useful, I have no clue. All depends on how you intend to ship the binaries. Maybe vendors have all switched to 64-bit-hosted toolchains nowadays.