From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YGKrCpQMX2jnjSIAWB0awg (envelope-from ) for ; Fri, 27 Jun 2025 17:26:44 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=zuU4IF+B; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 2858A1E11E; Fri, 27 Jun 2025 17:26:44 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_SBL_CSS,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=unavailable autolearn_force=no version=4.0.1 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 807B11E0C2 for ; Fri, 27 Jun 2025 17:26:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 089E8385C6D5 for ; Fri, 27 Jun 2025 21:26:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 089E8385C6D5 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=zuU4IF+B Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by sourceware.org (Postfix) with ESMTPS id 9BF883858408 for ; Fri, 27 Jun 2025 21:26:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9BF883858408 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9BF883858408 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::f31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1751059569; cv=none; b=wU5SaxPombuE60Fpi1EMVbg9fqNcYNNOs0ljBNNs2QH2LTFSQITJBIsY3pEq3djYGi06NGfXOiZsZmlo4JfaReOJPPevUuMghdd7n0yzHRgUEAcbtUU/SzZF4WemzIl+c+iGIuBdwL6aWxKyQR5MiJ9NZN22M1QxjV6Q6SifWIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1751059569; c=relaxed/simple; bh=A9FT/e3l2JbkEwreJSxm5Wx2K/7lXAozqyQnx0ALVOc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZKv43uZlPmk83pQaUKF0kuW9Ua18s00SAicLG80HsbBUFCUkeq3jJBX8QLe7TkPk1QxMGklO90bC+JmHRHKe4Sue2ZFoqJqw+MMC87zW98vbU2+DJo9CjIGI6WE1miyXPXuoWsPZfH/zoH4EATxEBZJPl/fbFKccatSvwFLea9Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BF883858408 Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-6faf66905adso2506956d6.2 for ; Fri, 27 Jun 2025 14:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751059569; x=1751664369; darn=sourceware.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=u26qGh98NBL7ekCJ5slXcfg8eRf6ceKEtiU7JG/wc8A=; b=zuU4IF+B3GnFszMCMBAfPhHS4ICRaaulFQD4hfuawybYnzLhLQB8nk08IAN8YnTlO9 +ODOBlrRrUiT5by1RiDf+w1U1XMGAMcZ82G1vVmQEo73N7IpWqh9KwSYHPOVJpLfK2td cLaACCA6d2N/3XQ8JdVnjRIvOJeCNUMId+gjxNN8S3QOcksHPNxy/as23IbSmVkEao70 b6BWdhqRM7jpt+HxEHY2hGKKpYHpWrDVOOMDyT3SoI+uus/JGjpylnb3jUSKtrnV9k0u k6Jg/5r0eq/deAhkM9nGDhbcmuxMco/vYLphEeheg+KsFswl5cPUnwKeiIP+pWM/Vdgv iSBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751059569; x=1751664369; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=u26qGh98NBL7ekCJ5slXcfg8eRf6ceKEtiU7JG/wc8A=; b=g80+jSH87QniI8VkP5V5P9no8qLCyHYYwBqcM210t5gpwzA3A5h1+X5CPko1CaV8Ik k0ki46kUf35O8uB0DQJsOFA5Qflgq3kLePVYDM6cUj1BPuVtribLiCx+S4ju+6P9M0G4 eR/pPFx+XEVBd/QA8bhihNNhI/JjgLajL1WGCFCwiBv3dmMiqelDu+0IHWg/ZzGLyOLc XaosFzc4bKJwXUeb1Gh+cGaUR0hUf0HwP/enkO1ZVUmf8/Mat3dp8j5iuPiG4+19VGbl W/auC8vEOVU01xMa6qauRZbHubad1t4bJL8+76PhZTBktg5+Jb5UOQZYSE7fGCLcexYC W56A== X-Gm-Message-State: AOJu0YwfPslbxIRaiOuIu9KeP1008hHhcwMSwNgpUdPhBc1jjdL6dTfu kjnU9kZw0mbCwB15uAHI7L/wbu8d4uddOZE12DKonj8yMME0befOFZacVJE/dDU3gqPvVZW5yjO q3gKW X-Gm-Gg: ASbGnct3luyk+29Sj5inyEOoffE+a7e+B4beGCCHpqRrt4RhTcwVsBB1zeCCdNUrcjY kLdrfRWqRaEeak2McwIvLYc+EAijZJ8ZQyYJxhDC8PzeK9VpktlOrntmfmSkrXDxbcAyqVirM3j ju5iKGVSnISuWGcdhOWD89NF9Gs5xi/k8/GJeinCVueoIfxoW6fdLsoIh2wf7JDqvwUUAbhvDXj RXgksYPFTUfeooZRPRrR+T5v0IPP1W8AQesxOCZBAggJaRI3tosmXD6iw1tCyfAmsL7CV7+bOMO Ffm78iwS8P7V417/Zi88GmNDzqNueRf5FRxvZ7bsP4AFjS9mFuCizAckPYbblyjxcOigm5y3 X-Google-Smtp-Source: AGHT+IGPSSQduX2Rs9rXoDcuu5+RvnuJEnppMZohSBaS4yUy/G2nAK9nDIQS4kM1ynY+MCHU6fXKXg== X-Received: by 2002:ad4:4ee5:0:b0:6fa:c66b:8928 with SMTP id 6a1803df08f44-6ffed7a4f32mr84892956d6.2.1751059568936; Fri, 27 Jun 2025 14:26:08 -0700 (PDT) Received: from localhost ([2804:14d:7e39:88d6:d199:fdf8:4324:f598]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d4431346b9sm199047685a.3.2025.06.27.14.26.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jun 2025 14:26:08 -0700 (PDT) From: Thiago Jung Bauermann To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] GDB: maint: Fix build on FreeBSD In-Reply-To: (Simon Marchi's message of "Fri, 27 Jun 2025 09:50:00 -0400") References: <20250627044533.1246090-1-thiago.bauermann@linaro.org> User-Agent: mu4e 1.12.11; emacs 30.1 Date: Fri, 27 Jun 2025 18:26:06 -0300 Message-ID: <87qzz4c1w1.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain 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 Hello Simon, Simon Marchi writes: > On 6/27/25 12:45 AM, Thiago Jung Bauermann wrote: >> While trying to build current trunk of GDB on FreeBSD 14.3 on aarch64, >> I hit this warning converted to an error: >> >> In file included from /home/bauermann/src/binutils-gdb/gdb/maint.c:37: >> /home/bauermann/src/binutils-gdb/gdb/maint.h:64:8: error: private field 'm_start_space' is not used [-Werror,-Wunused-private-field] >> 64 | long m_start_space; >> | ^ >> 1 error generated. >> gmake[2]: *** [Makefile:1973: maint.o] Error 1 >> >> I used the default compiler on this system: >> >> $ c++ --version >> FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2) >> Target: aarch64-unknown-freebsd14.3 >> Thread model: posix >> InstalledDir: /usr/bin >> >> The problem is that the only two places that use m_start_space are >> guarded by HAVE_USEFUL_SBRK, so also guard the member declaration with >> it. >> >> Build-tested on aarch64-unknown-freebsd14.3. > > I think there is nothing wrong with fixing the build, so: > > Approved-By: Simon Marchi Thanks! Pushed as commit 48e0ec748443. > But then, is this feature useful at all nowadays? I don't have a deep > knowledge of memory allocators work, but my understanding is that modern > allocators use mmap to obtain more memory from the system (or they use > both). So the memory usage computed using sbrk would not be very > accurate. All of this to say that, if there is a metric we know is not > accurate, it might be better to remove it. I don't know much either, but my cursory research suggests you're right. OTOH I would think it should be possible to obtain a "memory allocated by GDB" number to use in place of the sbrk return result, so at least on some platforms this metric can be fixed. For example, glibc provides the malloc_info function, and Unix in general can use RSS. Not that I'm volunteering to fix this code. :-) -- Thiago