From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [COMMIT PATCH] Make functions in cli-dump.c static and remove cli-dump.h.
Date: Fri, 09 Aug 2013 15:44:00 -0000 [thread overview]
Message-ID: <20130809154417.9097.34165.stgit@brno.lan> (raw)
I noticed the functions declared in cli-dump.h aren't used anywhere
outside cli-dump.c.
The original patch that introduced cli-dump.c didn't include this header:
http://sourceware.org/ml/gdb-patches/2002-03/msg00518.html
But for some reason that I couldn't find from reading the archives around
that patch's discussion, cli-dump.h was introduced in the final checkin,
at:
http://sourceware.org/ml/gdb-patches/2002-03/msg00596.html
There seems to be no point in keeping this around nowadays.
gdb/
2013-08-09 Pedro Alves <palves@redhat.com>
* cli/cli-dump.c: Don't include cli/cli-dump.h.
(scan_expression_with_cleanup, scan_filename_with_cleanup)
(fopen_with_cleanup, add_dump_command): Make static.
* cli/cli-dump.h: Delete file.
* Makefile.in (HFILES_NO_SRCDIR): Remove reference to
cli/cli-dump.h.
---
gdb/Makefile.in | 2 +-
gdb/cli/cli-dump.c | 9 ++++-----
gdb/cli/cli-dump.h | 34 ----------------------------------
3 files changed, 5 insertions(+), 40 deletions(-)
delete mode 100644 gdb/cli/cli-dump.h
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 8f4ee9e..9171940 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -794,7 +794,7 @@ exec.h m32r-tdep.h osabi.h gdbcore.h solib-som.h amd64bsd-nat.h \
i386bsd-nat.h xml-support.h xml-tdesc.h alphabsd-tdep.h gdb_obstack.h \
ia64-tdep.h ada-lang.h ada-varobj.h varobj.h frv-tdep.h nto-tdep.h serial.h \
c-lang.h d-lang.h go-lang.h frame.h event-loop.h block.h cli/cli-setshow.h \
-cli/cli-decode.h cli/cli-cmds.h cli/cli-dump.h cli/cli-utils.h \
+cli/cli-decode.h cli/cli-cmds.h cli/cli-utils.h \
cli/cli-script.h macrotab.h symtab.h common/version.h \
gnulib/import/string.in.h gnulib/import/str-two-way.h \
gnulib/import/stdint.in.h remote.h remote-notif.h gdb.h sparc-nat.h \
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index 208916c..9e202b6 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -25,7 +25,6 @@
#include "cli/cli-cmds.h"
#include "value.h"
#include "completer.h"
-#include "cli/cli-dump.h"
#include "gdb_assert.h"
#include <ctype.h>
#include "target.h"
@@ -38,7 +37,7 @@
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-char *
+static char *
scan_expression_with_cleanup (char **cmd, const char *def)
{
if ((*cmd) == NULL || (**cmd) == '\0')
@@ -62,7 +61,7 @@ scan_expression_with_cleanup (char **cmd, const char *def)
}
-char *
+static char *
scan_filename_with_cleanup (char **cmd, const char *defname)
{
char *filename;
@@ -97,7 +96,7 @@ scan_filename_with_cleanup (char **cmd, const char *defname)
return fullname;
}
-FILE *
+static FILE *
fopen_with_cleanup (const char *filename, const char *mode)
{
FILE *file = gdb_fopen_cloexec (filename, mode);
@@ -389,7 +388,7 @@ call_dump_func (struct cmd_list_element *c, char *args, int from_tty)
d->func (args, d->mode);
}
-void
+static void
add_dump_command (char *name, void (*func) (char *args, char *mode),
char *descr)
diff --git a/gdb/cli/cli-dump.h b/gdb/cli/cli-dump.h
deleted file mode 100644
index 585d4d7..0000000
--- a/gdb/cli/cli-dump.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Dump-to-file commands, for GDB, the GNU debugger.
-
- Copyright (C) 2001-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 CLI_DUMP_H
-#define CLI_DUMP_H
-
-extern void add_dump_command (char *name,
- void (*func) (char *args, char *mode),
- char *descr);
-
-/* Utilities for doing the dump. */
-extern char *scan_filename_with_cleanup (char **cmd, const char *defname);
-
-extern char *scan_expression_with_cleanup (char **cmd, const char *defname);
-
-extern FILE *fopen_with_cleanup (const char *filename, const char *mode);
-
-#endif
reply other threads:[~2013-08-09 15:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130809154417.9097.34165.stgit@brno.lan \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).