[PATCH 21/21] gdb: make top_level_interpreter a method of struct ui

Simon Marchi simon.marchi@efficios.com
Tue Sep 12 17:54:12 GMT 2023


>> @@ -185,6 +184,13 @@ struct ui : public intrusive_list_node<ui>
>>       Throws an error if NAME is not a known interpreter or the interpreter fails
>>       to initialize.  */
>>    void set_top_level_interpreter (const char *name);
>> +
>> +  /* Return this UI's top level interpreter.  */
>> +  interp *top_level_interpreter ()
>> +  { return m_top_level_interpreter; }
> 
> I think this function should be marked const.
If we want things to be const-correct, then I guess a const version of
this method should return a const interp.  And that would be a bunch
more work (if even possible).  But I guess that marking the method const
and returning a non-const interp doesn't have downsides versus what I
have above, so let's add const.

Simon



More information about the Gdb-patches mailing list