diff options
author | Tom de Vries <tdevries@suse.de> | 2024-11-22 17:34:50 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-11-22 17:34:50 +0100 |
commit | 8a7f13063a6d5314cfde5b4f1dc49afa2922cf8c (patch) | |
tree | 2c1d23a7ef8efb6bc3b227ae28e66c44c047003e /gdbserver/netbsd-low.cc | |
parent | 461248c1433714584060fd3a41efe28088aa855b (diff) | |
download | binutils-8a7f13063a6d5314cfde5b4f1dc49afa2922cf8c.zip binutils-8a7f13063a6d5314cfde5b4f1dc49afa2922cf8c.tar.gz binutils-8a7f13063a6d5314cfde5b4f1dc49afa2922cf8c.tar.bz2 |
[gdb/python] Ensure locale is restored in do_start_initialization
I noticed in do_start_initialization:
...
std::string oldloc = setlocale (LC_ALL, NULL);
setlocale (LC_ALL, "");
...
if (count == (size_t) -1)
{
fprintf (stderr, "Could not convert python path to string\n");
return false;
}
setlocale (LC_ALL, oldloc.c_str ());
...
that the old locale is not restored if the "return false" is triggered.
Fix this by using SCOPE_EXIT.
Tested on aarch64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdbserver/netbsd-low.cc')
0 files changed, 0 insertions, 0 deletions