From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YZueFWEJRWp7HSEAWB0awg (envelope-from ) for ; Wed, 01 Jul 2026 08:34:41 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=jbuJkI6n; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5422B1E098; Wed, 01 Jul 2026 08:34:41 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FORGED_GMAIL_RCVD,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (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 7FA3C1E024 for ; Wed, 01 Jul 2026 08:34:40 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 82E074BA2E16 for ; Wed, 1 Jul 2026 12:34:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82E074BA2E16 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=jbuJkI6n Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id A843A4BA2E0E for ; Wed, 1 Jul 2026 12:33:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A843A4BA2E0E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A843A4BA2E0E Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::335 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782909238; cv=none; b=IFJQAYnt4c3YnLMTFMm+iAPSZuFmoj7bFLsSFl1833uaU+wCYqH+iwq+sMlqQnuq3w+95xt1QSKD6h4PeTQFLpWaqR3mhNbzCFwhOC3bD5YllSW186EMRBMbG7pBlHhBFwLlvhIP+8sNZOHkPnzKaHnJWgX36vYBFwcI8fZ74L0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782909238; c=relaxed/simple; bh=R/I5qiVuOkjXcBStPQvj5+YWGFPKEBOJsiadogRdbFY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=YcV7sKR8hY6vEtT5R68epj5CAHbi+2cyTXX/9Xb/kS7YqUHM8IhvN8it02iDRKQrzfWH5Hy5kxNzMrmZw+JEIgnyn/SWZjTAAd7UFo3l3omfxe814y4ViNXmPI1tL9U0jd3TW2H7zP4jMYDXuKLPU6v0vNDBR27/G09Ez/nGyxA= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=jbuJkI6n DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A843A4BA2E0E Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-493bfe9f886so3225585e9.0 for ; Wed, 01 Jul 2026 05:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782909237; x=1783514037; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=OS6KzzUiuqVJZDiI+mY4Xb2OJAxIopvgFIFUV+Hgnvo=; b=jbuJkI6nVpenqGDozKW0861aTkr+Sk/kdlQOeFUUvztvdZoZ6YBwQwiAmrUdBBT3Ws BmNr/fYNrz+pND/VjdGFtZ8xmew7/QWd7jhJPaTkZuYS6yu6yN5Nt5z3eGwrI7SHcOT8 dNT2hCuXmtaIdq4KusiuyR7GXYtJAYwUEd+dsQUsp6IoX2WIMGQ2FsqnyZTnyBjUMAet f5X23y3r4hvSIK5WQpEYvjvbePuDUH/1wOH8I5aq70VM7bEkDBZUc9jr+KdkgQHw6ggk vdWhnnTEa+7A7WWERbU4o9slktDm06XgHrZrDuMNeHluyEJihf0IAFvDXBqJ+bcilJpy Dhag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782909237; x=1783514037; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OS6KzzUiuqVJZDiI+mY4Xb2OJAxIopvgFIFUV+Hgnvo=; b=ozHH5TP3j1YNzGhVNLrDmNtPtmSpGFP9e9P3osTUz02hrKL9UxZULMXlce0OdLM/yw Ww+dnHv02nzuKED2aP5KAkN+luYJZ2nc/U0UgOlzzrPpPvXgGODG64FnbdKXgOHXp2pl XbO1kD/YqDy4oY1gn3B5sbVfhJFVMQo2sUkGVi6ILPw4Kb4n9uX/ZGPq2Ka2WfTg9GB6 MTRCDMfdTd63mZILVVoC/zig/pywPfVFLBGoFKVAFPQ5pnHNfGOufH/NoH+RiiCtvI8M u6pdPHSbOBOpyUgpvtrJtm7nnFpUajIpqg4d3mEUsppjX28be3o2LMPzBIQDkZRjiHuR GJ+Q== X-Forwarded-Encrypted: i=1; AFNElJ+oPhqYfOC/WQK6to3XJu+cAsP6RrzKd4diceYgOvSiquVdYXNkr+kB36mUXN1XRKQdI4w7LaEGCvODKQ==@sourceware.org X-Gm-Message-State: AOJu0YzDIOIgeCiQ60lfIgKKURu2Tnvi+o+qTDIPhZKT+bLKK8zVKHn2 Up+j4R4kP44XGxhlIc5ttb0TQd9fQGJ2GFJb/QdafWTMcUCyGpEbsOip X-Gm-Gg: AfdE7cmbCr42C5jyuBeO+EksUw5ErqzDeMc3OzKAulOwpI5fd1x8W30NZ2P71lL/N2l KetOnNCH9qYUQgVTrhUQIfsRwfd+cUCIvfZp5AyYQ7sWRuEN1q8eOy/+acFBU6CqWGxMNhU2CLU PVdIyysYvNJUXZknIVFdRzHqqT8sCFBtUabLWHCHZ//Jhnf+p0yvSiqg82u9T0YDu3STG5o1fmh RwSasSm68jZxKykcM/jnvOZ76RjsKvlSeMYg2IpkCh4G9a5I5iXq+gIrF8J2k15Q4UB5yDrtK5k ex1a3hlqZ+TlZpsD1lt+NzUWqwgHVvlxkw416zs+NR15xHXyfIbp9MoHMCBDGb74fqOwFnnxVAD EBtqj/ZNqoweYJlWLx6ej+QeflRTPbNJLRnjrUapgTkv+7CC61aF5eK0RWQKIhyO0yuBpPnlBnd 1JSlnxuScQ6ZuG3+rAEFfmMsxmIQ== X-Received: by 2002:a7b:c38b:0:b0:493:aa24:792b with SMTP id 5b1f17b1804b1-493c2b7f3b0mr13152485e9.22.1782909237273; Wed, 01 Jul 2026 05:33:57 -0700 (PDT) Received: from [192.168.0.38] ([86.12.216.189]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493be4bfd47sm100669035e9.2.2026.07.01.05.33.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jul 2026 05:33:56 -0700 (PDT) Message-ID: Date: Wed, 1 Jul 2026 13:33:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb questions: fallback on maps still relevant today ? To: Matthieu Longo , gdb-patches@sourceware.org Cc: Luis Machado , Thiago Jung Bauermann , Andrew Burgess References: <20260701121706.110679-1-matthieu.longo@arm.com> Content-Language: en-US From: Luis In-Reply-To: <20260701121706.110679-1-matthieu.longo@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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 Hi, On 01/07/2026 13:17, Matthieu Longo wrote: > I am wondering whether the fallback on maps when reading smaps is still > relevant nowadays. /proc/$PID/smaps has been around since 2005. I doubt > that anyone using an older Linux kernel version out there would use the > latest version of GDB. > I propose to remove this fallback logic in linux_find_memory_regions_full. That´d be fine by me. We might want to do the deprecation dance and then drop from a future release. > > Additionnally, reading from smaps file is tested against NULL. Why ? > Is there such a valid case where the result of target_fileio_read_stralloc() > could be null, and at the same time, GDB is attached to a process, local > or remote via gdbserver, or while reading a coredump ? > In my understanding, all those cases ensures that the smaps file is always > present and so, I propose to replace this check with a gdb_assert instead. There are error cases. And this file isn´t something static on disk but rather a dynamically-created file on request. Due to that, bad things can happen and a read may fail. We don´t want to assert on a temporary hiccup as it will completely kill gdb during a debug session. If this error ever happens the user gets a warning or error message and can take action. That isn´t the case with assertions. > > Why do I care about the above ? > I would like to wrap the reading and parsing code in a class to avoid > the duplication of all the boiler plates in different places. Can´t you accomplish that already regardless of whether reading smaps fails or not? > Please let me know your thoughts ? I'm all for tidying things up. And I'm OK with dropping the fallback too.