aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/errors.cc
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 /gdbsupport/errors.cc
parent4dda9cc4b03788d1cf0416b39a3ab3780caf27fd (diff)
downloadfsf-binutils-gdb-602971b3863dcecf2daa5ffc0853a75a3131446c.zip
fsf-binutils-gdb-602971b3863dcecf2daa5ffc0853a75a3131446c.tar.gz
fsf-binutils-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 'gdbsupport/errors.cc')
-rw-r--r--gdbsupport/errors.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdbsupport/errors.cc b/gdbsupport/errors.cc
index b48ce10..59f934c 100644
--- a/gdbsupport/errors.cc
+++ b/gdbsupport/errors.cc
@@ -144,4 +144,12 @@ strwinerror (ULONGEST error)
return buf;
}
+/* See errors.h. */
+
+void
+throw_winerror_with_name (const char *string, ULONGEST err)
+{
+ error (_("%s (error %d): %s"), string, err, strwinerror (err));
+}
+
#endif /* USE_WIN32API */