From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4qiNEs0zBGeFGQUAWB0awg (envelope-from ) for ; Mon, 07 Oct 2024 15:17:33 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=q74xqe7Y; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 27FE81E355; Mon, 7 Oct 2024 15:17:33 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5C35E1E05C for ; Mon, 7 Oct 2024 15:17:32 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 07D23386102A for ; Mon, 7 Oct 2024 19:17:32 +0000 (GMT) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 30C4D3858C39 for ; Mon, 7 Oct 2024 19:17:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30C4D3858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 30C4D3858C39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728328633; cv=none; b=bgPw/fhYHWnjwuC83z29EZmbQFEe7EwUqIdGXR9GX0O5Upby/hw256EXU18TwNyAs64SYyubXCU2XL+sp6w1btGxbGPCQdgOYwiPQnR1TXdcOoxJP80N0zwHmB3F6vTupSW3BeXvdrBSWe7Lb8Fa9LCwvZnEKL5IvgnfeDGl3G8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728328633; c=relaxed/simple; bh=P+rz+0OQra5FPluFp0+p0QbkEeGS36LgxPx3vD0W6Tg=; h=DKIM-Signature:Date:Message-Id:From:To:Subject:MIME-version; b=wqEEogE2sKo3awGq7I7w6Un+BVM5UxNa7EWE/XVAb/5cIRp8TUSpQi7CfA74vLjpl+JtG3UqlfXKoIwKNIrkKQ87V+ILtIoUXcky39THPffgTr8uaBPt59b30Q7g9ws2KuVQk60dgDmY5aZCQple1Xc7RIRL0qV4URzOYpRvl8c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxtEE-00044r-Ho; Mon, 07 Oct 2024 15:17:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=LEEDskSO32QlewcwAvSK+M1c6eo6HcAyEEZPNnuABZk=; b=q74xqe7Y3PRgL55IHbNb eFtkdeTXk3QYqpjW69ukE6gNAN2xhfeEUndmLnxOF1ABZqfuiv/cYiwf5TetAOiPHgkkZDLYxqKVK DkKUtTyPe5POPJU3z7byXH7d04kfrrh7QycpvIeUBVwUCJpBlJBbu1ehLizpWPeL7e9JWMd+8tqM4 n8HqhOsTOIstjNFSSLZBucDNa8cBJ6BFwjLbykSzONgJ2wyKvwakeQ2vwBff5XZIK5uv54FvpLPKK ZE89b/19Y/pTw3KnDifpKzDRm1SeFIjpjm5qrEb6E5CEF2nj5KWqrqShUxGD82kMj2GFrNX2O0U+A zXYLiRd9sboNRg==; Date: Mon, 07 Oct 2024 22:17:08 +0300 Message-Id: <86a5ffu3ij.fsf@gnu.org> From: Eli Zaretskii To: Guinevere Larsen Cc: aburgess@redhat.com, gdb-patches@sourceware.org In-Reply-To: (message from Guinevere Larsen on Mon, 7 Oct 2024 15:30:37 -0300) Subject: Re: [PATCH] gdb, configure: Add disable-formats option for configure References: <20240925175340.1850969-1-guinevere@redhat.com> <86msjvars2.fsf@gnu.org> <865xqi9sak.fsf@gnu.org> <8634llaay5.fsf@gnu.org> <87setey6vi.fsf@redhat.com> <86ed4y1tgg.fsf@gnu.org> <87bk00x7u6.fsf@redhat.com> <86ed4wx6yt.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org > Date: Mon, 7 Oct 2024 15:30:37 -0300 > Cc: gdb-patches@sourceware.org > From: Guinevere Larsen > > > And a more practical question: if I want to build GDB that will run on > > GNU/Linux and should be able to debug Linux executables natively and > > MS-Windows executables via gdbserver, which formats should I specify > > with this new --enable-formats option? > > Linux uses elf files, and windows uses PE-coff (compiled when coff is > requested), so you would need --enable-formats=elf,coff > > However, with the patch as-is in the list, any value you put in there > (including --enable-formats=no, which would add nothing user selected) > would compile support for elf and coff anyway, so there is no need to worry. > > Finally, if you aren't sure, the default behavior if the flag is to > compile all readers, keeping with the old behavior. I presume users and packagers will want to use this feature to avoid compiling in stuff they will never need. The problem, as I see it, is that it is hard to decide what to specify, and your answer to my Linux+Windows question illustrates this very well. By contrast, the security benefits might not be interesting at least to some. > > See, I think these are the questions that the readers of the manual > > will ask themselves, and we should have the answers there for them. > > > That's a reasonable point. I don't think we should need to document all > targets, but I can see the value of documenting the main usage of the > file format when describing the options, as a guideline for users > running on mainstream platforms and not meant as an exhaustive list. I'm > thinking of adding the following to the readme: > > `--enable-binary-file-format=FORMAT,FORMAT...' > `--enable-binary-file-format=all' >   Configure GDB to only be be able to read selected file formats. >   The special value "all" causes all file formats to be compiled in, > and is the >   the default behavior of the option. The other possible options are: >   * coff: Main format on windows systems. This is required to compile with >     windows target support; >   * dbx: (also known as a.out), is a legacy file format, this is > recommended >     if you know you will be dealing with this file format; >   * elf: Main format of linux systems. This is heavily recommended when >     compiling with linux support; >   * macho: Main format on MacOS systems, this is heavily recommended >     when compiling for those targets; >   * mips: (also known as ecoff), this is the main file format for targets >     running on MIPS CPUs. It is heavily recommended when supporting those >     targets. >   * xcoff: Main format of AIX systems, this is required to compile for AIX >     targets and rs6000 CPUs. > > > What do you think? That's a good starting point, but IMO it stops short of answering the practical questions people will ask themselves. For example, how do I configure GDB to support a single target that is my native target and OS? will specifying the single format from the above list do? One thing I remember is that many targets produce core files in ELF format. If that is true, then omitting ELF should be discouraged for that reason. And maybe also other similar practical factoids.