PR25993, read of freed memory

Simon Marchi simark@simark.ca
Tue May 19 17:26:58 GMT 2020


On 2020-05-19 1:25 p.m., Christian Biesinger wrote:
> On Tue, May 19, 2020 at 8:27 AM Simon Marchi <simark@simark.ca> wrote:
>> Can you please change `char *name` to be `gdb::optional<std::string>`?
>>
>> 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.

Simon


More information about the Gdb-patches mailing list