From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id D1F373858D3C for ; Mon, 20 May 2024 16:54:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D1F373858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none 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 D1F373858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716224095; cv=none; b=IrZJUSU69rFnz5IV3h5IbGlVLtNjCANWYpHStTD6wyvvHfh9/fvHQXhHuVfqPA3wD2fBlJerPiAFc0CRR4OGb4f4LrSm9vkQk4+xsnJ26T/cq4iEiq9cihKIGFI1yWpUuskQZ/DqdKC9uuKBZ/lPeSQVDlDJDFxzaoQd/8qSfio= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716224095; c=relaxed/simple; bh=YQsun12UZVmETUbpSUN7uNzSAoKOm5pxKsuHOihK+us=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=OZdR8iZho6c+1KRwMgE0FIuHcyWw18Ul1Q8YxyedwWlx9WjdGLWVGXgcwjImFGkwUEiN3jEfUwB5DodJS0ym+2tk4Tx4fICpUsmkW7UpYGWUnB+HfHcsn2S/7VIAQS+VmxCsO27njfi2v9opF3Fqpvft/KxRPHpAdJ02n6a1uMM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716224093; 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=FulW7WsOBTclPIuLTc6yXT8kOyMjcApks6r+8F6u9EU=; b=d9ot9Ut+R0LzaID+atj82z5pcGa4RQvSd3FsdcgTHZxabq7b2yxgQapk4BTL+oq77T6scV 7otgjZv/VqjpOL5LpJFZMPRvWmkrykUHwnIsNhgK5a5ly76+8Tv8EDSpZoks79ENbWbA81 0MQnIeyhFskz1eNxuwPZItCfuWmtnsA= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-83--ycWXQrFPKygOQ65w32XQA-1; Mon, 20 May 2024 12:54:51 -0400 X-MC-Unique: -ycWXQrFPKygOQ65w32XQA-1 Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-2b33fb417f3so9887983a91.0 for ; Mon, 20 May 2024 09:54:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716224090; x=1716828890; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FulW7WsOBTclPIuLTc6yXT8kOyMjcApks6r+8F6u9EU=; b=FLXu/VqPNYJvSIP2W9UTUbIWdTqHcAmyuJ2NHXWi5sYR3aAKw6hkrkPC9yiUEGY+1l EquFxr80FOymyNWzwWB4D3lscQnXVTTT1swOgkS5h9fqT/BOie0V2Zv3Y2ZyiJ50vlQA BmYItaaaLB0Y0yvkwPq4WKZkQjB5E0UKR/AZOwFuQJeihsaRYqwT3Tj6LzVzHv0OjzNW jI1A2+0kt7GiF1qwgG1D+ZnLJGr2f3UQABaCVQvzcEM6lFcxRkr1O1TZmyXwapS9KOGR MdH/Ub8qOW/Rof/1xNi4y3lHNXxrlnGM9U6ufK764FkgHMklxFbPetT3QifWK1ianxRk SLCA== X-Gm-Message-State: AOJu0Ywy0UpPi0WqvRWwY5OQ91WVEBBnxX6nhiCuiXNMgVy7sK/QsS5a bZe22ntwuVl5SHrs4IhhXZwLTk24LrJZ42jbkHOwzq37g3TMsqi3yUOXvTJDKECHOkxfCOUCZ41 SR3MD0LdXkPBy0dKQ6dCv4lEHNzxN/wtDEA8G7eSXP8UH6XhbbDLlsS4iuViA0pM7HFs= X-Received: by 2002:a17:90b:f0b:b0:2b6:215b:bac8 with SMTP id 98e67ed59e1d1-2b6ccd80138mr27420657a91.40.1716224089875; Mon, 20 May 2024 09:54:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwZamEhDpws2y96tfVjgUYmse803AqBASs8SQEESzug2oi7+Zq1svw67p24kNkZecL6VISKg== X-Received: by 2002:a17:90b:f0b:b0:2b6:215b:bac8 with SMTP id 98e67ed59e1d1-2b6ccd80138mr27420639a91.40.1716224089448; Mon, 20 May 2024 09:54:49 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:92c5::1001? ([2804:14d:8084:92c5::1001]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f070c54e45sm150997885ad.99.2024.05.20.09.54.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 May 2024 09:54:49 -0700 (PDT) Message-ID: <33eace6b-33aa-4439-9145-a7fc322a9800@redhat.com> Date: Mon, 20 May 2024 13:54:45 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdbserver: add client_state destructor To: Simon Marchi , Pedro Alves , Tom Tromey Cc: gdb-patches@sourceware.org References: <20240503122906.3808986-1-blarsen@redhat.com> <87bk5ndntn.fsf@tromey.com> <04192a28-b4aa-4e07-878e-bde3f6472b20@redhat.com> <877cgaexgi.fsf@tromey.com> <44147aa3-e614-4fee-b95f-b69fe58b474b@simark.ca> From: Guinevere Larsen In-Reply-To: <44147aa3-e614-4fee-b95f-b69fe58b474b@simark.ca> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 List-Id: On 5/3/24 14:00, Simon Marchi wrote: > > On 2024-05-03 12:14, Pedro Alves wrote: >> On 2024-05-03 16:17, Tom Tromey wrote: >>>>> At some point we went through the tree and removed all these IIRC. >>> Guinevere> I think I have a case of friday brains. You mean removed all nullptr >>> Guinevere> checks, or removed unnecessary xfrees? >>> >>> Sorry. All the checks of null before free were removed at some point. >>> >>> Though I see that gdb-xfree.h still does the check. Lol. >>> IIRC, the gnulib folks looked into this and concluded that no existing >>> system requires the check before a call to free. >> That is the original point of xfree existing. It was needed on some ancient >> Solaris, IIRC. It's free didn't work right with a null argument. >> >> Note that bfd uses xmalloc, but does not use xfree, so all such hosts are surely >> gone. >> >> Nowadays, having xfree is still important for the POD checking, of course, >> and it's nice to have xmalloc/xfree for balance IMHO, thought that's of course >> debatable. > We delete free for !IsFreeable types: > > template >>> > void free (T *ptr) = delete; > > So I guess that xfree isn't technically necessary for that. > > Anyway, our goal should be for free/xfree to never be called manually :) I'm somewhat confused about this comment. Does this mean you don't want this patch in? > > Simon > -- Cheers, Guinevere Larsen She/Her/Hers