This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/9] [gdbserver] Split a new utils.h file out of server.h.
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 3 Sep 2013 21:26:33 +0100
- Subject: [PATCH 3/9] [gdbserver] Split a new utils.h file out of server.h.
- Authentication-results: sourceware.org; auth=none
- References: <1378239999-15533-1-git-send-email-palves at redhat dot com>
gdb/gdbserver/
2013-09-03 Pedro Alves <palves@redhat.com>
* server.h (perror_with_name, error, fatal, warning, paddress)
(pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
include it.
* utils.h: New file.
---
gdb/gdbserver/server.h | 12 +-----------
gdb/gdbserver/utils.h | 32 ++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 11 deletions(-)
create mode 100644 gdb/gdbserver/utils.h
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 4f13cd9..45c2ae3 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -274,18 +274,8 @@ extern void hostio_last_error_from_errno (char *own_buf);
#include "remote-utils.h"
-/* Functions from utils.c */
#include "common-utils.h"
-
-void perror_with_name (const char *string);
-void error (const char *string,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
-void fatal (const char *string,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
-void warning (const char *string,...) ATTRIBUTE_PRINTF (1, 2);
-char *paddress (CORE_ADDR addr);
-char *pulongest (ULONGEST u);
-char *plongest (LONGEST l);
-char *phex_nz (ULONGEST l, int sizeof_l);
-char *pfildes (gdb_fildes_t fd);
+#include "utils.h"
#include "gdb_assert.h"
diff --git a/gdb/gdbserver/utils.h b/gdb/gdbserver/utils.h
new file mode 100644
index 0000000..7f5f1d9
--- /dev/null
+++ b/gdb/gdbserver/utils.h
@@ -0,0 +1,32 @@
+/* General utility routines for the remote server for GDB.
+ Copyright (C) 1993-2013 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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/>. */
+
+#ifndef UTILS_H
+#define UTILS_H
+
+void perror_with_name (const char *string);
+void error (const char *string,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
+void fatal (const char *string,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
+void warning (const char *string,...) ATTRIBUTE_PRINTF (1, 2);
+char *paddress (CORE_ADDR addr);
+char *pulongest (ULONGEST u);
+char *plongest (LONGEST l);
+char *phex_nz (ULONGEST l, int sizeof_l);
+char *pfildes (gdb_fildes_t fd);
+
+#endif /* UTILS_H */
--
1.7.11.7