From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id G10INXsmaWn2EAUAWB0awg (envelope-from ) for ; Thu, 15 Jan 2026 12:40:11 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=g1IB4y7V; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C852A1E0E1; Thu, 15 Jan 2026 12:40:11 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 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_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 616D71E070 for ; Thu, 15 Jan 2026 12:40:11 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 011DE4BA23CA for ; Thu, 15 Jan 2026 17:40:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 011DE4BA23CA Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=g1IB4y7V Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id E10314BA2E22 for ; Thu, 15 Jan 2026 17:39:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E10314BA2E22 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E10314BA2E22 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768498785; cv=none; b=EDPwq2NuAv6UdXeOR/WTIvjDh0Ryu7Dt6abTDFQn+81JSjiKTvqulYlqGwU07GIPbLMUZz56I6W0id6s3OQqc4iB3ECkPBM1qzKX19M7QZjr/IZnzpDLa3+2VsUqdEh8xo/MaUtgXANnlPvIm0QqLg6RyXxuASWGkj7QtF7eWB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768498785; c=relaxed/simple; bh=C6wvDhqDizSTQwjxsdt6SAmRNKozXa1kKF0/2/KvSnQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=EDglXBeILsMPxXmZUxRZ4eq+9Wuuw9nSjM/DdovhKSKeBuV30Vi30dbri12KxFA73e/zHccjfED3jUu5p0S80Z3N959er0nLMNNqcYj55+H1Q5DlFgtiGzT/V/wpc1ZLTMLKGMip8vX9RmGLSgDV0ydZVYbU7va8PCS5wZ6Hoeo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E10314BA2E22 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768498784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0Vl5mM74Nb2Cm1sD2FYo5UQjhTYQ/AI3dy7qjkqPIxs=; b=g1IB4y7V4HXTlAVOmH+eXFz7rDibn4oJpCHTql6itrJd/kw3GZgQ2+VlfuUFd6F0Q62W04 A6KQkxaiAbv2qnIQQ6rLr39UKemZJx4K4avi1x4Zpp6Ap3khSmaP3O5Kw7nz48GTICVgY0 Vx6bby5Mh8aAAQZ5NRspvwWyHuNdwLY= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-558-XSaa-PmUNs2dajPS9X116w-1; Thu, 15 Jan 2026 12:39:43 -0500 X-MC-Unique: XSaa-PmUNs2dajPS9X116w-1 X-Mimecast-MFC-AGG-ID: XSaa-PmUNs2dajPS9X116w_1768498783 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-88a43d4cd2bso13539716d6.1 for ; Thu, 15 Jan 2026 09:39:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768498782; x=1769103582; h=content-transfer-encoding:in-reply-to:from:content-language :references: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=0Vl5mM74Nb2Cm1sD2FYo5UQjhTYQ/AI3dy7qjkqPIxs=; b=UvDP2Xt+mJN5wgjKgrzk8sruZWkrEXKKKMvzh08RR2c6gns3Fu0XiYtsrPiFg31hJQ TvttlQ15DMCuLSZ7lGVJ5MRzdkyNj0u+/Tbi/vesbb/ym48+I2O423AYvhfLVyxEHRZL PgMPx7lZbAuPMHLVPXHJbgKhzcZablZG2MQHjRnWun0XlF4FLZ0iVtrq2IiTzAeymOXs ZtHIn2va94NGUmnwwMgA3zAuoHkrQevCGkWdP3Ytqhvl13j7aPzVfN+4PR9XRav8hPnn KBxekJiU4W5dZZ2R91U1CctJQNqd0bLHqrMvzuExOqNT2LzcqEiUYG6O3klRwdjMH4UZ m+tg== X-Forwarded-Encrypted: i=1; AJvYcCW80u62nNXpIoCvmOVsy5vIvi8GmUDLeszMEAgOYR6ljBkc/zWrWCAyPPp4wyFpuo5tIbeH/pnH3scRNw==@sourceware.org X-Gm-Message-State: AOJu0Yz68F2izGDYPV1q7e3JfJ2DhEuorU4A88orlZqZpFI7qwicMvjh dJ53PhanERPowXswTaZxcjhzr6fIuwjnAGCRJg/fUTbaJr1X4QxIlgnOH0twuSIcKL5xIshPsm/ KBpUiqcKycdLbJ36WgZORNUQkV4e6WgJfMEN4dopFSlivR2GJDqf/XGS9zOkKTs3dsjmbRZs= X-Gm-Gg: AY/fxX5p98DXYM5abokKVawDhYxDnQhLh1CcqnZxA7xsO15e9LLzblm/bQn0M8l9Wp/ 5cVGN0XdWPh70K7+ulLpZdmBhahYY+WafWuiNLgH3VQyB0UCGX+kj9QHga1czbpc3pe+EcJBnqS vC49JJBl9Zmyy9Wze3RUkj1ru0rPMRqmErzb1hOEk8EvZPwdDfOnNgGa4c6TErp8ItdpZQEN/+q OiZCbi3xKNLJJTvxOLOxItoIuSkvIKxurdwCqSijyHBF0uVM60m6f6pT9vaMQ4N2xmh4q236v2l UlXr78oOyeyYnSyvUyy8GeiNdnNojaCV86bRSIRo7YSPQTJVqkSolV9YQCR+UCU6m1CEelq8cX4 VbZL6AzsQL+sMXgM7g8jaig== X-Received: by 2002:ad4:5aa4:0:b0:890:2df9:c6a3 with SMTP id 6a1803df08f44-8942dd8c3c3mr3163376d6.50.1768498782512; Thu, 15 Jan 2026 09:39:42 -0800 (PST) X-Received: by 2002:ad4:5aa4:0:b0:890:2df9:c6a3 with SMTP id 6a1803df08f44-8942dd8c3c3mr3163086d6.50.1768498782078; Thu, 15 Jan 2026 09:39:42 -0800 (PST) Received: from ?IPV6:2804:14d:8084:a5b1::1001? ([2804:14d:8084:a5b1::1001]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-502a1ed3256sm241531cf.16.2026.01.15.09.39.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jan 2026 09:39:41 -0800 (PST) Message-ID: <3bf1b983-e7c6-4d76-8c87-9a0d3523d8b3@redhat.com> Date: Thu, 15 Jan 2026 14:39:38 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/2] More uses of make_unique_xstrdup To: Tom Tromey , gdb-patches@sourceware.org References: <20260115-xstrdup-v1-0-72e13ba99851@adacore.com> From: Guinevere Larsen In-Reply-To: <20260115-xstrdup-v1-0-72e13ba99851@adacore.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 6qvFSMkvP1l2-o6joMBGs6_WQWq_1Bq7i77PMpoV-U0_1768498783 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 1/15/26 2:33 PM, Tom Tromey wrote: > This replaces some uses of '.reset(xstrdup())' with > '= make_unique_xstrdup()'. I think explicit uses of reset > should be avoided when possible. > > Regression tested on x86-64 Fedora 41. > > Signed-off-by: Tom Tromey This makes me wonder... is there any reason to prefer xmalloc/xstrdup instead of using std::string? My preference is to use stdlib stuff when possible, but maybe I'm misjudging the size of the refactor or there's a reason to prefer the current memory strategy. -- Cheers, Guinevere Larsen It/she > --- > Tom Tromey (2): > Use make_unique_xstrdup in more places > Use make_unique_xstrdup in tracepoint > > gdb/breakpoint.c | 4 ++-- > gdb/buildsym.h | 8 +++++--- > gdb/cli/cli-dump.c | 2 +- > gdb/mi/mi-cmd-env.c | 2 +- > gdb/python/py-framefilter.c | 2 +- > gdb/python/py-function.c | 2 +- > gdb/python/py-lazy-string.c | 5 ++++- > gdb/python/py-param.c | 2 +- > gdb/solib.c | 4 ++-- > gdb/source.c | 4 ++-- > gdb/stack.c | 16 +++++++++++----- > gdb/tracectf.c | 4 ++-- > gdb/tracepoint.c | 10 ++++------ > gdb/tracepoint.h | 12 ++++++------ > 14 files changed, 43 insertions(+), 34 deletions(-) > --- > base-commit: 44c39324673cd9bb18db67234253f288497d66a1 > change-id: 20260115-xstrdup-00eb39b61e16 > > Best regards,