aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-12-20 00:58:14 +0000
committerYao Qi <yao@codesourcery.com>2012-12-20 00:58:14 +0000
commitdfc7bb5b17b462701fb92325c79671eee417a16a (patch)
tree51eeede00cd4e1fe85debfe7f494dca397285898
parent463133ca3ac3381f8a536089f908ddc09d2cbfbf (diff)
downloadgdb-dfc7bb5b17b462701fb92325c79671eee417a16a.zip
gdb-dfc7bb5b17b462701fb92325c79671eee417a16a.tar.gz
gdb-dfc7bb5b17b462701fb92325c79671eee417a16a.tar.bz2
gdb/
2012-12-20 Yao Qi <yao@codesourcery.com> * maint.c (_initialize_maint_cmds): Move code to ... * psymtab.c (_initialize_psymtab): ... here. New. Include "gdbcmd.h". (maintenance_print_psymbols): Make it static. (maintenance_info_psymtabs, maintenance_check_symtabs): Likewise. * symtab.h (maintenance_print_psymbols): Remove declaration. (maintenance_check_symtabs, maintenance_info_psymtabs): Likewise.
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/maint.c16
-rw-r--r--gdb/psymtab.c29
-rw-r--r--gdb/symtab.h6
4 files changed, 36 insertions, 25 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1cbfd25..d26bfc8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,13 @@
+2012-12-20 Yao Qi <yao@codesourcery.com>
+
+ * maint.c (_initialize_maint_cmds): Move code to ...
+ * psymtab.c (_initialize_psymtab): ... here. New.
+ Include "gdbcmd.h".
+ (maintenance_print_psymbols): Make it static.
+ (maintenance_info_psymtabs, maintenance_check_symtabs): Likewise.
+ * symtab.h (maintenance_print_psymbols): Remove declaration.
+ (maintenance_check_symtabs, maintenance_info_psymtabs): Likewise.
+
2012-12-19 Maxim Kuvyrkov <maxim@codesourcery.com>
* MAINTAINERS: Add myself to write-after-approval maintainers.
diff --git a/gdb/maint.c b/gdb/maint.c
index afb9968..4c7a588 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -833,12 +833,6 @@ Entries in the minimal symbol table are dumped to file OUTFILE.\n\
If a SOURCE file is specified, dump only that file's minimal symbols."),
&maintenanceprintlist);
- add_cmd ("psymbols", class_maintenance, maintenance_print_psymbols, _("\
-Print dump of current partial symbol definitions.\n\
-Entries in the partial symbol table are dumped to file OUTFILE.\n\
-If a SOURCE file is specified, dump only that file's partial symbols."),
- &maintenanceprintlist);
-
add_cmd ("objfiles", class_maintenance, maintenance_print_objfiles,
_("Print dump of current object file definitions."),
&maintenanceprintlist);
@@ -850,12 +844,6 @@ linetables --- just the symbol table structures themselves.\n\
With an argument REGEXP, list the symbol tables whose names that match that."),
&maintenanceinfolist);
- add_cmd ("psymtabs", class_maintenance, maintenance_info_psymtabs, _("\
-List the partial symbol tables for all object files.\n\
-This does not include information about individual partial symbols,\n\
-just the symbol table structures themselves."),
- &maintenanceinfolist);
-
add_cmd ("statistics", class_maintenance, maintenance_print_statistics,
_("Print statistics about internal gdb state."),
&maintenanceprintlist);
@@ -866,10 +854,6 @@ Print the internal architecture configuration.\n\
Takes an optional file parameter."),
&maintenanceprintlist);
- add_cmd ("check-symtabs", class_maintenance, maintenance_check_symtabs,
- _("Check consistency of psymtabs and symtabs."),
- &maintenancelist);
-
add_cmd ("translate-address", class_maintenance,
maintenance_translate_address,
_("Translate a section name and address to a symbol."),
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 027ad38..2b4d9f9 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -35,6 +35,7 @@
#include "dictionary.h"
#include "language.h"
#include "cp-support.h"
+#include "gdbcmd.h"
#ifndef DEV_TTY
#define DEV_TTY "/dev/tty"
@@ -1815,7 +1816,7 @@ discard_psymtab (struct objfile *objfile, struct partial_symtab *pst)
-void
+static void
maintenance_print_psymbols (char *args, int from_tty)
{
char **argv;
@@ -1864,7 +1865,7 @@ print-psymbols takes an output file name and optional symbol file name"));
}
/* List all the partial symbol tables whose names match REGEXP (optional). */
-void
+static void
maintenance_info_psymtabs (char *regexp, int from_tty)
{
struct program_space *pspace;
@@ -1970,7 +1971,7 @@ maintenance_info_psymtabs (char *regexp, int from_tty)
/* Check consistency of psymtabs and symtabs. */
-void
+static void
maintenance_check_symtabs (char *ignore, int from_tty)
{
struct symbol *sym;
@@ -2083,3 +2084,25 @@ map_partial_symbol_filenames (symbol_filename_ftype *fun, void *data,
need_fullname);
}
}
+
+extern initialize_file_ftype _initialize_psymtab;
+
+void
+_initialize_psymtab (void)
+{
+ add_cmd ("psymbols", class_maintenance, maintenance_print_psymbols, _("\
+Print dump of current partial symbol definitions.\n\
+Entries in the partial symbol table are dumped to file OUTFILE.\n\
+If a SOURCE file is specified, dump only that file's partial symbols."),
+ &maintenanceprintlist);
+
+ add_cmd ("psymtabs", class_maintenance, maintenance_info_psymtabs, _("\
+List the partial symbol tables for all object files.\n\
+This does not include information about individual partial symbols,\n\
+just the symbol table structures themselves."),
+ &maintenanceinfolist);
+
+ add_cmd ("check-symtabs", class_maintenance, maintenance_check_symtabs,
+ _("Check consistency of psymtabs and symtabs."),
+ &maintenancelist);
+}
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 2ab41f4..dcf85de 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1162,18 +1162,12 @@ extern void resolve_sal_pc (struct symtab_and_line *);
void maintenance_print_symbols (char *, int);
-void maintenance_print_psymbols (char *, int);
-
void maintenance_print_msymbols (char *, int);
void maintenance_print_objfiles (char *, int);
void maintenance_info_symtabs (char *, int);
-void maintenance_info_psymtabs (char *, int);
-
-void maintenance_check_symtabs (char *, int);
-
/* Symbol-reading stuff in symfile.c and solib.c. */
extern void clear_solib (void);