aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-06-10 21:48:04 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-06-10 21:48:04 +0000
commit44b13c5a41d3b0fc2f122071e8c64987564dbf21 (patch)
treee151362865543474a1b08449bee91967fd38f77b
parent6c30d220f19d7f4fe197fa5f62a472b2e5e84d7c (diff)
downloadgdb-44b13c5a41d3b0fc2f122071e8c64987564dbf21.zip
gdb-44b13c5a41d3b0fc2f122071e8c64987564dbf21.tar.gz
gdb-44b13c5a41d3b0fc2f122071e8c64987564dbf21.tar.bz2
gdb/
Code cleanup. * dwarf2read.c (dw2_map_symbol_filenames): Use symbol_filename_ftype for fun. * psymtab.c (map_symbol_filenames_psymtab) (map_partial_symbol_filenames): Likewise. * psymtab.h: Include symfile.h. (map_partial_symbol_filenames): Use symbol_filename_ftype for fun. * symfile.h (symbol_filename_ftype): New. (struct quick_symbol_functions): Use symbol_filename_ftype for fun of map_symbol_filenames, clarify more the naming in comment.
-rw-r--r--gdb/ChangeLog13
-rw-r--r--gdb/dwarf2read.c3
-rw-r--r--gdb/psymtab.c8
-rw-r--r--gdb/psymtab.h6
-rw-r--r--gdb/symfile.h13
5 files changed, 27 insertions, 16 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e88f1c4..8962f1a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,16 @@
+2011-06-10 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Code cleanup.
+ * dwarf2read.c (dw2_map_symbol_filenames): Use symbol_filename_ftype
+ for fun.
+ * psymtab.c (map_symbol_filenames_psymtab)
+ (map_partial_symbol_filenames): Likewise.
+ * psymtab.h: Include symfile.h.
+ (map_partial_symbol_filenames): Use symbol_filename_ftype for fun.
+ * symfile.h (symbol_filename_ftype): New.
+ (struct quick_symbol_functions): Use symbol_filename_ftype for fun of
+ map_symbol_filenames, clarify more the naming in comment.
+
2011-06-07 Doug Evans <dje@google.com>
* cc-with-index.sh: Fix typos in comment.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 29ca473..399d593 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2720,8 +2720,7 @@ dw2_find_pc_sect_symtab (struct objfile *objfile,
}
static void
-dw2_map_symbol_filenames (struct objfile *objfile,
- void (*fun) (const char *, const char *, void *),
+dw2_map_symbol_filenames (struct objfile *objfile, symbol_filename_ftype *fun,
void *data)
{
int i;
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index ea690ef..fd8bb7d 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1082,9 +1082,7 @@ read_psymtabs_with_filename (struct objfile *objfile, const char *filename)
static void
map_symbol_filenames_psymtab (struct objfile *objfile,
- void (*fun) (const char *, const char *,
- void *),
- void *data)
+ symbol_filename_ftype *fun, void *data)
{
struct partial_symtab *ps;
@@ -1917,9 +1915,7 @@ expand_partial_symbol_names (int (*fun) (const char *, void *), void *data)
}
void
-map_partial_symbol_filenames (void (*fun) (const char *, const char *,
- void *),
- void *data)
+map_partial_symbol_filenames (symbol_filename_ftype *fun, void *data)
{
struct objfile *objfile;
diff --git a/gdb/psymtab.h b/gdb/psymtab.h
index 086ff2f..4d7f6d6 100644
--- a/gdb/psymtab.h
+++ b/gdb/psymtab.h
@@ -20,6 +20,8 @@
#ifndef PSYMTAB_H
#define PSYMTAB_H
+#include "symfile.h"
+
/* A bcache for partial symbols. */
struct psymbol_bcache;
@@ -31,9 +33,7 @@ extern struct bcache *psymbol_bcache_get_bcache (struct psymbol_bcache *);
void expand_partial_symbol_names (int (*fun) (const char *, void *),
void *data);
-void map_partial_symbol_filenames (void (*) (const char *, const char *,
- void *),
- void *);
+void map_partial_symbol_filenames (symbol_filename_ftype *fun, void *data);
extern const struct quick_symbol_functions psym_functions;
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 9c0bb75..cc65a14 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -116,6 +116,11 @@ struct symfile_segment_data
int *segment_info;
};
+/* Callback for quick_symbol_functions->map_symbol_filenames. */
+
+typedef void (symbol_filename_ftype) (const char *filename,
+ const char *fullname, void *data);
+
/* The "quick" symbol functions exist so that symbol readers can
avoiding an initial read of all the symbols. For example, symbol
readers might choose to use the "partial symbol table" utilities,
@@ -283,12 +288,10 @@ struct quick_symbol_functions
int warn_if_readin);
/* Call a callback for every file defined in OBJFILE whose symtab is
- not already read in. FUN is the callback. It is passed the file's name,
- the file's full name, and the DATA passed to this function. */
+ not already read in. FUN is the callback. It is passed the file's
+ FILENAME, the file's FULLNAME, and the DATA passed to this function. */
void (*map_symbol_filenames) (struct objfile *objfile,
- void (*fun) (const char *, const char *,
- void *),
- void *data);
+ symbol_filename_ftype *fun, void *data);
};
/* Structure to keep track of symbol reading functions for various