diff options
author | Tom Tromey <tromey@redhat.com> | 2010-07-13 20:52:52 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-07-13 20:52:52 +0000 |
commit | dd78685836dcecb25b85b2166b2b5c04b54cdd14 (patch) | |
tree | 40e6283bbd9d66cc25accb88778721396c8972dd | |
parent | 9291a0cd80ce4d50cbe531a872b7b00e3e67e3c9 (diff) | |
download | gdb-dd78685836dcecb25b85b2166b2b5c04b54cdd14.zip gdb-dd78685836dcecb25b85b2166b2b5c04b54cdd14.tar.gz gdb-dd78685836dcecb25b85b2166b2b5c04b54cdd14.tar.bz2 |
* symfile.c (set_initial_language): Update.
(deduce_language_from_filename): Argument type now const.
* symtab.h (find_main_filename): Update.
(deduce_language_from_filename): Update.
* symtab.c (find_main_filename): Make result const.
* dwarf2read.c (dw2_find_symbol_file): Change return type.
* psymtab.c (find_symbol_file_from_partial): Change return type.
* symfile.h (struct quick_symbol_functions) <find_symbol_file>:
Make result const.
-rw-r--r-- | gdb/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 5 | ||||
-rw-r--r-- | gdb/psymtab.c | 2 | ||||
-rw-r--r-- | gdb/symfile.c | 4 | ||||
-rw-r--r-- | gdb/symfile.h | 2 | ||||
-rw-r--r-- | gdb/symtab.c | 6 | ||||
-rw-r--r-- | gdb/symtab.h | 4 |
7 files changed, 24 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index feb33a0..43de1d9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,17 @@ 2010-07-13 Tom Tromey <tromey@redhat.com> + * symfile.c (set_initial_language): Update. + (deduce_language_from_filename): Argument type now const. + * symtab.h (find_main_filename): Update. + (deduce_language_from_filename): Update. + * symtab.c (find_main_filename): Make result const. + * dwarf2read.c (dw2_find_symbol_file): Change return type. + * psymtab.c (find_symbol_file_from_partial): Change return type. + * symfile.h (struct quick_symbol_functions) <find_symbol_file>: + Make result const. + +2010-07-13 Tom Tromey <tromey@redhat.com> + * breakpoint.c (save_cmdlist): No longer static. * gdbcmd.h (save_cmdlist): Declare. * symfile.c (symbol_file_add_with_addrs_or_offsets): Set diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index f390ef5..0a8190d 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2150,7 +2150,7 @@ dw2_expand_symtabs_with_filename (struct objfile *objfile, } } -static char * +static const char * dw2_find_symbol_file (struct objfile *objfile, const char *name) { struct dwarf2_per_cu_data *cu; @@ -2176,8 +2176,7 @@ dw2_find_symbol_file (struct objfile *objfile, const char *name) if (!cu->v.quick->lines) return NULL; - return (char *) cu->v.quick->file_names[cu->v.quick->lines->num_file_names - - 1]; + return cu->v.quick->file_names[cu->v.quick->lines->num_file_names - 1]; } static void diff --git a/gdb/psymtab.c b/gdb/psymtab.c index ca06130..c120894 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -949,7 +949,7 @@ psymtab_to_fullname (struct partial_symtab *ps) return NULL; } -static char * +static const char * find_symbol_file_from_partial (struct objfile *objfile, const char *name) { struct partial_symtab *pst; diff --git a/gdb/symfile.c b/gdb/symfile.c index af1b42c..babe9cf 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1538,7 +1538,7 @@ symbol_file_command (char *args, int from_tty) void set_initial_language (void) { - char *filename; + const char *filename; enum language lang = language_unknown; filename = find_main_filename (); @@ -2665,7 +2665,7 @@ init_filename_language_table (void) } enum language -deduce_language_from_filename (char *filename) +deduce_language_from_filename (const char *filename) { int i; char *cp; diff --git a/gdb/symfile.h b/gdb/symfile.h index d0fbb65..5815354 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -210,7 +210,7 @@ struct quick_symbol_functions /* Return the file name of the file holding the symbol in OBJFILE named NAME. If no such symbol exists in OBJFILE, return NULL. */ - char *(*find_symbol_file) (struct objfile *objfile, const char *name); + const char *(*find_symbol_file) (struct objfile *objfile, const char *name); /* This method is specific to Ada. It walks the partial symbol tables of OBJFILE looking for a name match. WILD_MATCH and diff --git a/gdb/symtab.c b/gdb/symtab.c index 4e48e48..07910db 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1617,14 +1617,16 @@ basic_lookup_transparent_type (const char *name) /* FIXME: What about languages without main() or specially linked executables that have no main() ? */ -char * +const char * find_main_filename (void) { struct objfile *objfile; - char *result, *name = main_name (); + char *name = main_name (); ALL_OBJFILES (objfile) { + const char *result; + if (!objfile->sf) continue; result = objfile->sf->qf->find_symbol_file (objfile, name); diff --git a/gdb/symtab.h b/gdb/symtab.h index 5f676bf..62e9ce4 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1136,7 +1136,7 @@ extern char **make_source_files_completion_list (char *, char *); int matching_obj_sections (struct obj_section *, struct obj_section *); -extern char *find_main_filename (void); +extern const char *find_main_filename (void); extern struct symtab *find_line_symtab (struct symtab *, int, int *, int *); @@ -1149,7 +1149,7 @@ extern void skip_prologue_sal (struct symtab_and_line *); extern void clear_symtab_users (void); -extern enum language deduce_language_from_filename (char *); +extern enum language deduce_language_from_filename (const char *); /* symtab.c */ |