On Wed, Aug 16, 2023 at 5:55 PM Andrew Burgess via Gdb-patches < gdb-patches@sourceware.org> wrote: > This commit makes two related changes. The goal of the commit is to > update the 'remote exec-file' setting to work correctly in a > multi-inferior setup. To do this I have switched from the older > style add_setshow_* function, which uses a single backing variable, to > the newer style add_setshow_* functions that uses a get/set callback. > > The get/set callbacks now directly access the state held in the > progspace which ensures that the correct value is always returned. > > However, the new get/set API requires that the get callback return a > reference to the setting's value, which in this case needs to be a > std::string. > > Currently the 'remote exec-file' setting is stored as a 'char *' > string, which isn't going to work. > > And so, this commit also changes 'remote exec-file' to be stored as a > std::string within the progspace. > > Now, when switching between multiple inferiors, GDB can correctly > inform the user about the value of the 'remote exec-file' setting. > > Looks super reasonable.