gdb: make set/show cwd work with $_gdb_setting_str
authorAndrew Burgess <aburgess@redhat.com>
Fri, 28 Apr 2023 21:14:53 +0000 (22:14 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Fri, 28 Apr 2023 21:50:46 +0000 (22:50 +0100)
commit94e6c5641234c4ced9cb3fa0ccc2aaaa6b7b62ea
tree6d01ae3d20ba8fad600ec7174fd02474f70425e4
parentcc09d372f664410aea226bfaa246aeb74fee8126
gdb: make set/show cwd work with $_gdb_setting_str

The previous commit fixed set/show args when used with
$_gdb_setting_str, this commit fixes set/show cwd.

Instead of using a scratch variable which is then pushed into the
current inferior from a set callback, move to the API that allows for
getters and setters, and store the value directly within the current
inferior.

Update the existing test to check the cwd setting.
gdb/infcmd.c
gdb/testsuite/gdb.multi/gdb-settings.exp