From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id 6F6A53857809 for ; Mon, 25 Jul 2022 15:56:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6F6A53857809 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4Ls4QS2j2xz3NS6; Mon, 25 Jul 2022 15:56:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ls4QS1qRnz3Q1T; Mon, 25 Jul 2022 15:56:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658764560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YQNUhJZijACRLATAwlgsIUY1+3C2k30rp/BTntJRo24=; b=GBato1XavRMdejJd+hjlWw6+0uT9ndjVRo/Er/RfMf9e4oXhktcrIYj1QbBd232BQZimxf qRCqKN4g+idrWnfGRGYBSjbICTtffOiA4wRUaajQ953yha81UDlsVMpbjIqTVD977tqvik psUEnXY3h5804GZaRXVIPqhEkeB07Rdp6UJipIL+K6K94ABQfd6AOie3qEeiSheS/RFfwC D8DwYEIAUX5k8pGHssojEmYlygERCstz5rrGseZcTVnTFpxKA2KCpSAAEGIu3jSvdCeGbL lUFU805RrxNGWkj24XmQPsHTyDl4d6O60bb/fDWEj/1CEmEIZk1A0b9lE5QBKQ== Received: from [10.0.1.4] (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Ls4QR4bt1z198B; Mon, 25 Jul 2022 15:55:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 25 Jul 2022 08:55:58 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: Luis Machado , Enze Li , gdb-patches@sourceware.org Cc: enze.li@gmx.com References: <6ec77420-8123-676c-ebba-20d55a5222fd@arm.com> From: John Baldwin Subject: Re: [PATCH v2] gdb/hurd: pass memory_tagged as false to find_memory_region_ftype In-Reply-To: <6ec77420-8123-676c-ebba-20d55a5222fd@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658764560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YQNUhJZijACRLATAwlgsIUY1+3C2k30rp/BTntJRo24=; b=pr0ZExm0AfNdiLW+/sV20womaTuBV6+CN0Cq2G+kui2d62ZeFm1oH9uyoLjLM9e0R5IY1k 7ZttHVTVtfm0Ck1VD9xf7gh7ybgvrRWJFlVeqVp0vo6hL4I5FnQPD48+T+hceI690IfPAM 4ot5Rs6Up7B2czOkDv537Pdm8MPuKqybdPAO5qY7WAxPrpcSGqbD+C9+PhfNWxpgQ3dmJA B3zxYwN05thUpeEg6mS5+Pp3v3Q8of6SvdljGy7DHwebCPhWRqpMASrRFsbtSJA9i6PhTL oQbwQ4XEsO/ZIY8QIdQqEkZuApYrDdCEC6EWZFXyxwJgwKEiO32rJ86SeQS5Kw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658764560; a=rsa-sha256; cv=none; b=sV9pblmSqDPvzVUgoGqJ5YnA2v01DW+tIwPpSZqKMUyawYK/mVQyfD229EySCcHETJ/T9v AQp9uqaEoLv/4hpIyT1JRT8YJ5x5A7bAqoHJr1QYtenRg1jl8Aq2g3lPHg2OIINmZPV62o 09evIUpRrEQ193LgqDt/3Qmc+VnkZ/VluWmjEr2J67kfStzly+XpPvAIW9/3VypFm3WE4H Kxpdr5moGeh4QBd732mfFmaRmsufZLNeXKZFAk3i3JxRBczi75TfLIPaCn8Auvb+oz2WLW HkWWbMVl9gncq3XzjcwAIhE9e3CmOz14RbSTFY+ko+gCEczA2Jhk7dpe0Bmqcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, NICE_REPLY_A, 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 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: Mon, 25 Jul 2022 15:56:06 -0000 On 7/25/22 12:39 AM, Luis Machado wrote: > Hi! > > On 7/24/22 04:40, Enze Li wrote: >> I tried building GDB on GNU/Hurd, and ran into this error: >> >> CXX gnu-nat.o >> gnu-nat.c: In member function ‘virtual int gnu_nat_target::find_memory_regions(find_memory_region_ftype, void*)’: >> gnu-nat.c:2620:21: error: too few arguments to function >> 2620 | (*func) (last_region_address, >> | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ >> 2621 | last_region_end - last_region_address, >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 2622 | last_protection & VM_PROT_READ, >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 2623 | last_protection & VM_PROT_WRITE, >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 2624 | last_protection & VM_PROT_EXECUTE, >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 2625 | 1, /* MODIFIED is unknown, pass it as true. */ >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 2626 | data); >> | ~~~~~ >> gnu-nat.c:2635:13: error: too few arguments to function >> 2635 | (*func) (last_region_address, last_region_end - last_region_address, >> | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 2636 | last_protection & VM_PROT_READ, >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 2637 | last_protection & VM_PROT_WRITE, >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 2638 | last_protection & VM_PROT_EXECUTE, >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 2639 | 1, /* MODIFIED is unknown, pass it as true. */ >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 2640 | data); >> | ~~~~~ >> make[2]: *** [Makefile:1926: gnu-nat.o] Error 1 >> >> This is because in this commit: >> >> commit 68cffbbd4406b4efe1aa6e18460b1d7ca02549f1 >> Date: Thu Mar 31 11:42:35 2022 +0100 >> >> [AArch64] MTE corefile support >> >> Added a new argument to find_memory_region_ftype, but did not pass it to >> the function in gnu-nat.c. Fix this by passing memory_tagged as false. >> >> As Luis pointed out, similar bugs may also appear on FreeBSD and NetBSD, >> and I have reproduced them on both systems. This patch fixes them >> incidentally. >> >> Tested by rebuilding on GNU/Hurd, FreeBSD/amd64 and NetBSD/amd64. >> --- >> gdb/fbsd-nat.c | 2 +- >> gdb/gnu-nat.c | 2 ++ >> gdb/netbsd-nat.c | 2 +- >> 3 files changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c >> index 398f1c18b33..a4ca4a53415 100644 >> --- a/gdb/fbsd-nat.c >> +++ b/gdb/fbsd-nat.c >> @@ -125,7 +125,7 @@ fbsd_nat_target::find_memory_regions (find_memory_region_ftype func, >> Pass MODIFIED as true, we do not know the real modification state. */ >> func (kve->kve_start, size, kve->kve_protection & KVME_PROT_READ, >> kve->kve_protection & KVME_PROT_WRITE, >> - kve->kve_protection & KVME_PROT_EXEC, 1, data); >> + kve->kve_protection & KVME_PROT_EXEC, 1, false, data); >> } >> return 0; >> } >> diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c >> index 72314824278..5dd4d148c76 100644 >> --- a/gdb/gnu-nat.c >> +++ b/gdb/gnu-nat.c >> @@ -2623,6 +2623,7 @@ gnu_nat_target::find_memory_regions (find_memory_region_ftype func, >> last_protection & VM_PROT_WRITE, >> last_protection & VM_PROT_EXECUTE, >> 1, /* MODIFIED is unknown, pass it as true. */ >> + false, /* No memory tags in the object file. */ >> data); >> last_region_address = region_address; >> last_region_end = region_address += region_length; >> @@ -2637,6 +2638,7 @@ gnu_nat_target::find_memory_regions (find_memory_region_ftype func, >> last_protection & VM_PROT_WRITE, >> last_protection & VM_PROT_EXECUTE, >> 1, /* MODIFIED is unknown, pass it as true. */ >> + false, /* No memory tags in the object file. */ >> data); >> >> return 0; >> diff --git a/gdb/netbsd-nat.c b/gdb/netbsd-nat.c >> index c45df391afc..d3bf83d35f5 100644 >> --- a/gdb/netbsd-nat.c >> +++ b/gdb/netbsd-nat.c >> @@ -259,7 +259,7 @@ nbsd_nat_target::find_memory_regions (find_memory_region_ftype func, >> Pass MODIFIED as true, we do not know the real modification state. */ >> func (kve->kve_start, size, kve->kve_protection & KVME_PROT_READ, >> kve->kve_protection & KVME_PROT_WRITE, >> - kve->kve_protection & KVME_PROT_EXEC, 1, data); >> + kve->kve_protection & KVME_PROT_EXEC, 1, false, data); >> } >> return 0; >> } > > The above LGTM. Thanks again for getting these files fixed. I think this one can go in as it is > fairly obvious and addresses broken builds for hurd, fbsd and netbsd Agreed, and the BSD bits all look good to me. Enze, do you have push access or do you need someone to push this (and the other netbsd build fix) for you? -- John Baldwin