aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-09-01 11:01:33 -0600
committerTom Tromey <tromey@adacore.com>2023-11-27 12:55:14 -0700
commit602971b3863dcecf2daa5ffc0853a75a3131446c (patch)
treee6965aecdcad64bf33e19a5927618a06be17d2a1 /gdb/nat
parent4dda9cc4b03788d1cf0416b39a3ab3780caf27fd (diff)
downloadgdb-602971b3863dcecf2daa5ffc0853a75a3131446c.zip
gdb-602971b3863dcecf2daa5ffc0853a75a3131446c.tar.gz
gdb-602971b3863dcecf2daa5ffc0853a75a3131446c.tar.bz2
Introduce throw_winerror_with_name
This introduces throw_winerror_with_name, a Windows analog of perror_with_name, and changes various places in gdb to call it. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30770
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/windows-nat.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c
index bf4c438..7951bc3 100644
--- a/gdb/nat/windows-nat.c
+++ b/gdb/nat/windows-nat.c
@@ -206,8 +206,7 @@ windows_process_info::get_exec_module_filename (char *exe_name_ret,
if (len == 0)
{
unsigned err = (unsigned) GetLastError ();
- error (_("Error getting executable filename (error %u): %s"),
- err, strwinerror (err));
+ throw_winerror_with_name (_("Error getting executable filename"), err);
}
if (cygwin_conv_path (CCP_WIN_W_TO_POSIX, pathbuf, exe_name_ret,
exe_name_max_len) < 0)
@@ -219,8 +218,7 @@ windows_process_info::get_exec_module_filename (char *exe_name_ret,
if (len == 0)
{
unsigned err = (unsigned) GetLastError ();
- error (_("Error getting executable filename (error %u): %s"),
- err, strwinerror (err));
+ throw_winerror_with_name (_("Error getting executable filename"), err);
}
#endif