Hi Tom and community members,

Thank you for your feedback Tom. I have made corrections as per your inputs and sent a v3 patch.

>>    desc = openp (search_path, flags, file_name, O_RDONLY | O_BINARY,
>> -             &absolute_name, per_bfd->captured_cwd.c_str ());
>> +             &absolute_name, per_bfd->captured_cwd.has_value () ?
>> +             per_bfd->captured_cwd->c_str () : nullptr);

>gdb style is to put operators at the start of a new line.
>For "?:" in particular I would also move the condition to a new line.

Done in v3.

>> diff --git a/gdb/testsuite/gdb.base/getcwd-fail-helper.c b/gdb/testsuite/gdb.base/getcwd-fail-helper.c
>> new file mode 100644
>> index 00000000000..a5e8fe80cbf
>> --- /dev/null
>> +++ b/gdb/testsuite/gdb.base/getcwd-fail-helper.c
>> @@ -0,0 +1,67 @@
>> +/* Helper to reproduce getcwd failure by deleting cwd via child process.  */
>> +#include <stdio.h>

>New files should have a copyright header.

>This applies to the other files as well.

Done in v3.

Referred,
bash-5.3# head -25 gdb.tui/tailcall-msym.exp
# Copyright 2026 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.


>> +catch {file delete -force $temp_dir}

>Deleting this is probably undesirable.  It's normally good if running a
>test leaves the test environment around.

Sure, done in v3 of the patch.

Thanks and regards,
Aditya.