From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by sourceware.org (Postfix) with ESMTPS id 6CD6C3898537 for ; Tue, 19 May 2020 18:59:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6CD6C3898537 Received: by mail-qv1-xf33.google.com with SMTP id er16so154942qvb.0 for ; Tue, 19 May 2020 11:59:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cfJU2+m7dQgb5OYg8Qi1tMeKYgUpB45nJMhYmbuksbg=; b=UrdzbsE4b3CQE4OWUx8Bb43sk/ed2YJ9LGOijPnW2PHn2e/n6hjB5hjRvhPHqinUzv Uj/OcItfRoLtEvk0byOjLusYKiWlGXAAyRDdQdbR/wRPJvkdLX3OqbzEpwWhgLfZGl6+ Ss1sJKvoBmEuJT4jiKnIungoj+z5r+dfsYenqzuf3tw/fzpf3DM458pqRdxbylNGA/wD +yy/UCIOF/jFoGdPpcMKvQU2kKFG7p9+QHCps23bwU2uosz8RVbACIrrXwuOfpRDg3Hb L0ohhe2XpQULvqastZU2oYhQ631/mqOaNg3FV1IHmxnbYOsUxC8lgy1u5+9OWtlscrKV 0vkQ== X-Gm-Message-State: AOAM531N4Cug0p3D0fc9htNiQoLMYbIBXGDW78R54L3JF6XCj/6VZQ3w lKQSma7qJvomNz9Mf2vdh9bA+ienqZN4w/wlQdzJ0g== X-Google-Smtp-Source: ABdhPJxNTRK5CcIizKFK+HFT08p3IdHrMBEeL3vdhyr5mIN1AHQ8EDD2IvCNn+IC6fjwGWaQ4+xQqfqg4KdhuPBoOzA= X-Received: by 2002:a0c:b992:: with SMTP id v18mr1085043qvf.223.1589914763677; Tue, 19 May 2020 11:59:23 -0700 (PDT) MIME-Version: 1.0 References: <20200519043205.GT1088@bubble.grove.modra.org> <111d8c5d-d615-e0ae-36de-519c43a51139@simark.ca> In-Reply-To: From: Christian Biesinger Date: Tue, 19 May 2020 13:58:46 -0500 Message-ID: Subject: Re: PR25993, read of freed memory To: Simon Marchi Cc: Alan Modra , binutils@sourceware.org, gdb-patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-18.9 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 19 May 2020 18:59:25 -0000 On Tue, May 19, 2020 at 12:27 PM Simon Marchi wrote: > > On 2020-05-19 1:25 p.m., Christian Biesinger wrote: > > On Tue, May 19, 2020 at 8:27 AM Simon Marchi wrote: > >> Can you please change `char *name` to be `gdb::optional`? > >> > >> The caller that passes a name should use string_printf to build the string, as mentioned > >> above. The caller that does not pass a name can pass `{}`, to pass an empty optional. > > > > We may want to add C++17's std::nullopt to gdb::optional, to make it > > clearer what's going on there. Then you could pass gdb::nullopt > > instead of {}. > > If it's technically possible, I completely agree. Yep, it is. Sent a patch to add it. Christian