diff options
author | John Gilmore <gnu@cygnus> | 1992-03-29 23:26:47 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1992-03-29 23:26:47 +0000 |
commit | be772100b5002a9d942ebea6e597787ea878932a (patch) | |
tree | d5cf30ef76c85c6e4ee0fdf6824ea25df14fcf47 /gdb | |
parent | 3414e4eb38123381ceb0a04ae0fd7fbb3de7e2db (diff) | |
download | gdb-be772100b5002a9d942ebea6e597787ea878932a.zip gdb-be772100b5002a9d942ebea6e597787ea878932a.tar.gz gdb-be772100b5002a9d942ebea6e597787ea878932a.tar.bz2 |
Lint
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/.Sanitize | 1 | ||||
-rw-r--r-- | gdb/ChangeLog | 81 | ||||
-rw-r--r-- | gdb/c-exp.y | 8 | ||||
-rw-r--r-- | gdb/command.c | 8 | ||||
-rw-r--r-- | gdb/core.c | 2 | ||||
-rw-r--r-- | gdb/cplus-dem.c | 1 | ||||
-rw-r--r-- | gdb/elfread.c | 22 | ||||
-rw-r--r-- | gdb/exec.c | 125 | ||||
-rw-r--r-- | gdb/gdbtypes.h | 3 | ||||
-rw-r--r-- | gdb/language.c | 4 | ||||
-rw-r--r-- | gdb/m2-exp.y | 8 | ||||
-rw-r--r-- | gdb/mips-tdep.c | 8 | ||||
-rw-r--r-- | gdb/parse.c | 4 | ||||
-rw-r--r-- | gdb/partial-stab.h | 10 | ||||
-rw-r--r-- | gdb/saber.suppress | 18 | ||||
-rw-r--r-- | gdb/solib.c | 34 | ||||
-rw-r--r-- | gdb/sparc-xdep.c | 4 | ||||
-rw-r--r-- | gdb/utils.c | 2 | ||||
-rw-r--r-- | gdb/values.c | 12 |
19 files changed, 258 insertions, 97 deletions
diff --git a/gdb/.Sanitize b/gdb/.Sanitize index 0377eff..50a1dcd 100644 --- a/gdb/.Sanitize +++ b/gdb/.Sanitize @@ -54,6 +54,7 @@ breakpoint.h buildsym.c buildsym.h c-exp.y +call-cmds.h coffread.c command.c command.h diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 803ef39..e9edd52 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,84 @@ +Sat Mar 28 22:22:06 1992 John Gilmore (gnu at cygnus.com) + + Create and use macros for iterating on symtabs, psymtabs, msymbols. + + * minsyms.c (iterate_over_msymbols): Remove; clunky and slow. + * symfile.h, symtab.h (iterate_over_msymbols): Remove prototype + * coffread.c (coff_symfile_read): iterate_over_symtabs => ALL_SYMTABS. + (patch_opaque_types): Avoid dummy args and result. + * objfiles.c (have_partial_symbols, have_full_symbols, + have_minimal_symbols): explicit iteration => ALL_OBJFILES; simplify. + (iterate_over_objfiles, iterate_over_symtabs, + iterate_over_psymtabs): Remove, clunky and slow. + * objfiles.h: Replace iterate_over_* prototypes with ALL_SYMTABS, + ALL_PSYMTABS, and ALL_MSYMBOLS macros. + * symmisc.c (dump_symtab, dump_psymtab, dump_msymbols, + dump_objfile): Remove dummy args and results. Move filename + comparisons to callers. + (printsyms_command, printpsyms_command, printmsyms_command, + printobjfiles_command): iterate_over_* => ALL_*. Compare filenames. + * symtab.c (lookup_symtab_1, lookup_symtab, lookup_partial_symtab, + lookup_symbol, find_main_psymtab, find_pc_symtab, sources_info, + list_symbols, make_symbol_completion_list): Replace explicit + iteration with ALL_SYMTABS, ALL_PSYMTABS, or ALL_MSYMBOLS. + Eliminate Dijkstra flag crap, break out of loops with gotos. + (lookup_symtab_1): Protect '/' tests from short filenames. + (cplus_mangled_symbol): Move inline into lookup_symbol. + * xcoffexec.c (relocate_objfile_msymbols): Remove poor hack. + (relocate_minimal_symbol): Move inline to vmap_symtab. + (vmap_symtab): Replace iteration with ALL_OBJFILES, + iterate_over_msymbols with ALL_MSYMBOLS. + + Misc cleanup prior to release. + + * Makefile.in (VERSION): Roll to 4.4.7. + (HFILES): Add call-cmds.h. + * call-cmds.h: New header for command fns called by other files. + * breakpoint.c (watchpoints_info): Remove, same as breakpoints_info. + (breakpoint_1): Remove unused type arg. Change callers. + + * dwarfread.c (dwarf_build_psymtabs): Remove mainline test. + * mipsread.c (compare_symtabs, compare_psymtabs): Remove, unused. + * mipsread.c: Add prototypes for all static functions. + + * symmisc.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, + dump_blockvector, dump_block, dump_addrchass, dump_namespace, + dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove, unused. + * xcoffread.c (dump_symtab_lines, dump_symtabs, dump_last_symtab, + dump_blockvector, dump_block, dump_addrchass, dump_namespace, + dump_symbol, dump_type, dump_linetable, dump_strtbl): Remove 2nd + unused copy! + + * buildsym.c (define_symbol): Handle global register variables + (from Pierre Willard). Complain if register numbers are too large. + * target.c (nomemory): Now that higher levels examine errno, give EIO. + * tm-sparc.h: Don't #include <sun4/reg.h>. + * sparc-tdep.c (sparc_frame_chain, frame_saved_pc): Remove + dependency on <sun4/reg.h>. Start to handle cross-byte-order. + + * language.h: Avoid forward enum declaration. + * configure.in, tm-sun4os5.h, xm-sun4os5.h, config/sun4os5.mh, + config/sun4os5.mt: New host and target. + * defs.h (errno): #include <errno.h> rather than assuming int. + From Pierre Willard. + + * breakpoint.c, breakpoint.h, buildsym.c, coffread.c, cplus-dem.c, + dbxread.c, dwarfread.c, elfread.c, infcmd.c, infrun.c, inftarg.c, + language.c, main.c, mem-break.c, mips-tdep.c, mipsread.c, + partial-stab.h, remote.c, saber.suppress, symfile.c, symtab.c, + valops.c, valprint.c, xcoffread.c, c-exp.y, m2-exp.y, blockframe.c, + command.c, core.c, exec.c, gdbtypes.h, parse.c, printcmd.c, solib.c, + sparc-xdep.c, utils.c, value.h, values.c: Lint. + +Sat Mar 28 02:43:26 1992 John Gilmore (gnu at cygnus.com) + + * buildsym.c (read_range_type): Avoid int overflow by using unsigned. + * dbxread.c (dbx_symfile_init): Remove bogus `lvalue cast'. + * language.h (enum exp_opcode): Avoid forward enum def. + * main.c (define_command, user_defined_command): Lint. + * mem-break.c, xcoffread.c: Lint. + * solib.c: Only #include <a.out.h> on SunOS, not SVR4. + Sun Mar 29 14:16:22 1992 Per Bothner (bothner@cygnus.com) * Merged in latest RS6000 diffs from Metin G. Ozisik. diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 7183fe7..865b021 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -75,10 +75,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define yyval c_val #define yylloc c_lloc -static void -__yy_bcopy PARAMS ((char *, char *, int)); - -int yyparse PARAMS ((void)); int @@ -807,7 +803,7 @@ array_mod: '[' ']' func_mod: '(' ')' { $$ = 0; } | '(' nonempty_typelist ')' - { free ($2); $$ = 0; } + { free ((PTR)$2); $$ = 0; } ; type : ptype @@ -821,7 +817,7 @@ type : ptype | type '(' typebase COLONCOLON '*' ')' '(' nonempty_typelist ')' { $$ = lookup_member_type (lookup_function_type ($1), $3); - free ($8); } + free ((PTR)$8); } ; typebase diff --git a/gdb/command.c b/gdb/command.c index f39600e..f5e0cec 100644 --- a/gdb/command.c +++ b/gdb/command.c @@ -262,7 +262,7 @@ delete_cmd (name, list) while (*list && !strcmp ((*list)->name, name)) { p = (*list)->next; - free (*list); + free ((PTR)*list); *list = p; } @@ -272,7 +272,7 @@ delete_cmd (name, list) if (!strcmp (c->next->name, name)) { p = c->next->next; - free (c->next); + free ((PTR)c->next); c->next = p; } else @@ -415,7 +415,7 @@ print_doc_line (stream, str) if (p - str > line_size - 1) { line_size = p - str + 1; - free (line_buffer); + free ((PTR)line_buffer); line_buffer = (char *) xmalloc (line_size); } strncpy (line_buffer, str, p - str); @@ -921,7 +921,7 @@ complete_on_cmdlist (list, text) if (matches == 0) { - free (matchlist); + free ((PTR)matchlist); matchlist = 0; } else @@ -83,7 +83,7 @@ core_close (quitting) CLEAR_SOLIB (); #endif if (core_ops.to_sections) { - free (core_ops.to_sections); + free ((PTR)core_ops.to_sections); core_ops.to_sections = NULL; core_ops.to_sections_end = NULL; } diff --git a/gdb/cplus-dem.c b/gdb/cplus-dem.c index 4c5a2f6..bc3b27c 100644 --- a/gdb/cplus-dem.c +++ b/gdb/cplus-dem.c @@ -443,7 +443,6 @@ cplus_demangle (type, arg_mode) p += 1; { int r, i; - int non_empty = 0; string tname; string trawname; diff --git a/gdb/elfread.c b/gdb/elfread.c index 99cf1ad..db66a25 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -40,6 +40,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "symtab.h" #include "symfile.h" #include "objfiles.h" +#include "buildsym.h" #define STREQ(a,b) (strcmp((a),(b))==0) @@ -63,7 +64,7 @@ static void elf_symfile_finish PARAMS ((struct objfile *)); static void -elf_symtab_read PARAMS ((bfd *, CORE_ADDR, int, struct objfile *)); +elf_symtab_read PARAMS ((bfd *, CORE_ADDR, struct objfile *)); static void record_minimal_symbol PARAMS ((char *, CORE_ADDR, enum minimal_symbol_type, @@ -86,8 +87,8 @@ elf_locate_sections PARAMS ((bfd *, asection *, PTR)); FIXME: The section names should not be hardwired strings. */ static void -elf_locate_sections (abfd, sectp, eip) - bfd *abfd; +elf_locate_sections (ignore_abfd, sectp, eip) + bfd *ignore_abfd; asection *sectp; PTR eip; { @@ -173,7 +174,7 @@ LOCAL FUNCTION SYNOPSIS - void elf_symtab_read (bfd *abfd, CORE_ADDR addr, int mainline, + void elf_symtab_read (bfd *abfd, CORE_ADDR addr, struct objfile *objfile) DESCRIPTION @@ -186,10 +187,9 @@ DESCRIPTION */ static void -elf_symtab_read (abfd, addr, mainline, objfile) +elf_symtab_read (abfd, addr, objfile) bfd *abfd; CORE_ADDR addr; - int mainline; struct objfile *objfile; { unsigned int storage_needed; @@ -287,7 +287,7 @@ elf_symfile_read (objfile, addr, mainline) /* Process the normal ELF symbol table first. */ - elf_symtab_read (abfd, addr, mainline, objfile); + elf_symtab_read (abfd, addr, objfile); /* Now process the DWARF debugging information, which is contained in special ELF sections. We first have to find them... */ @@ -326,8 +326,8 @@ elf_symfile_read (objfile, addr, mainline) just a stub. */ static void -elf_new_init (objfile) - struct objfile *objfile; +elf_new_init (ignore) + struct objfile *ignore; { buildsym_new_init (); } @@ -357,8 +357,8 @@ elf_symfile_finish (objfile) just a stub. */ static void -elf_symfile_init (objfile) - struct objfile *objfile; +elf_symfile_init (ignore) + struct objfile *ignore; { } @@ -1,5 +1,5 @@ /* Work with executable files, for GDB. - Copyright 1988, 1989, 1991 Free Software Foundation, Inc. + Copyright 1988, 1989, 1991, 1992 Free Software Foundation, Inc. This file is part of GDB. @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <stdio.h> #include "defs.h" #include "frame.h" #include "inferior.h" @@ -37,9 +36,24 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <ctype.h> #include <sys/stat.h> -extern char *getenv(); -extern void child_create_inferior (), child_attach (); -extern void symbol_file_command (); +/* Prototypes for local functions */ + +static void +add_to_section_table PARAMS ((bfd *, sec_ptr, PTR)); + +static void +exec_close PARAMS ((int)); + +static void +file_command PARAMS ((char *, int)); + +static void +set_section_command PARAMS ((char *, int)); + +static void +exec_files_info PARAMS ((struct target_ops *)); + +extern int info_verbose; /* The Binary File Descriptor handle for the executable file. */ @@ -61,7 +75,7 @@ CORE_ADDR text_end = 0; extern struct target_ops exec_ops; /* ARGSUSED */ -void +static void exec_close (quitting) int quitting; { @@ -69,18 +83,27 @@ exec_close (quitting) bfd_close (exec_bfd); exec_bfd = NULL; } - if (exec_ops.sections) { - free (exec_ops.sections); - exec_ops.sections = NULL; - exec_ops.sections_end = NULL; + if (exec_ops.to_sections) { + free ((PTR)exec_ops.to_sections); + exec_ops.to_sections = NULL; + exec_ops.to_sections_end = NULL; } } +/* Process the first arg in ARGS as the new exec file. + + Note that we have to explicitly ignore additional args, since we can + be called from file_command(), which also calls symbol_file_command() + which can take multiple args. */ + void -exec_file_command (filename, from_tty) - char *filename; +exec_file_command (args, from_tty) + char *args; int from_tty; { + char **argv; + char *filename; + target_preopen (from_tty); /* Remove any previous exec file. */ @@ -88,12 +111,27 @@ exec_file_command (filename, from_tty) /* Now open and digest the file the user requested, if any. */ - if (filename) + if (args) { char *scratch_pathname; int scratch_chan; - filename = tilde_expand (filename); + /* Scan through the args and pick up the first non option arg + as the filename. */ + + if ((argv = buildargv (args)) == NULL) + { + nomem (0); + } + make_cleanup (freeargv, (char *) argv); + + for (; (*argv != NULL) && (**argv == '-'); argv++) {;} + if (*argv == NULL) + { + error ("no exec file name was specified"); + } + + filename = tilde_expand (*argv); make_cleanup (free, filename); scratch_chan = openp (getenv ("PATH"), 1, filename, @@ -110,8 +148,8 @@ exec_file_command (filename, from_tty) error ("\"%s\": not in executable format: %s.", scratch_pathname, bfd_errmsg (bfd_error)); - if (build_section_table (exec_bfd, &exec_ops.sections, - &exec_ops.sections_end)) + if (build_section_table (exec_bfd, &exec_ops.to_sections, + &exec_ops.to_sections_end)) error ("Can't find the file sections in `%s': %s", exec_bfd->filename, bfd_errmsg (bfd_error)); @@ -120,7 +158,7 @@ exec_file_command (filename, from_tty) (29K springs to mind) need this info for now. */ { struct section_table *p; - for (p = exec_ops.sections; p < exec_ops.sections_end; p++) + for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++) if (!strcmp (".text", bfd_section_name (p->bfd, p->sec_ptr))) { text_start = p->addr; @@ -146,7 +184,7 @@ exec_file_command (filename, from_tty) What a novelty. Why did GDB go through four major releases before this command was added? */ -void +static void file_command (arg, from_tty) char *arg; int from_tty; @@ -162,11 +200,11 @@ file_command (arg, from_tty) table_pp_char is a char * to get it through bfd_map_over_sections; we cast it back to its proper type. */ -void +static void add_to_section_table (abfd, asect, table_pp_char) bfd *abfd; sec_ptr asect; - char *table_pp_char; + PTR table_pp_char; { struct section_table **table_pp = (struct section_table **)table_pp_char; flagword aflag; @@ -184,6 +222,9 @@ add_to_section_table (abfd, asect, table_pp_char) (*table_pp)++; } +/* Builds a section table, given args BFD, SECTABLE_PTR, SECEND_PTR. + Returns 0 if OK, 1 on error. */ + int build_section_table (some_bfd, start, end) bfd *some_bfd; @@ -195,7 +236,7 @@ build_section_table (some_bfd, start, end) if (count == 0) abort(); /* return 1? */ if (*start) - free (*start); + free ((PTR)*start); *start = (struct section_table *) xmalloc (count * sizeof (**start)); *end = *start; bfd_map_over_sections (some_bfd, add_to_section_table, (char *)end); @@ -234,7 +275,7 @@ xfer_memory (memaddr, myaddr, len, write, target) boolean res; struct section_table *p; CORE_ADDR nextsectaddr, memend; - boolean (*xfer_fn) (); + boolean (*xfer_fn) PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); if (len <= 0) abort(); @@ -243,7 +284,7 @@ xfer_memory (memaddr, myaddr, len, write, target) xfer_fn = write? bfd_set_section_contents: bfd_get_section_contents; nextsectaddr = memend; - for (p = target->sections; p < target->sections_end; p++) + for (p = target->to_sections; p < target->to_sections_end; p++) { if (p->addr <= memaddr) if (p->endaddr >= memend) @@ -289,24 +330,39 @@ xfer_memory (memaddr, myaddr, len, write, target) #endif /* REG_STACK_SEGMENT */ #endif FIXME -static void -exec_files_info () +void +print_section_info (t, abfd) + struct target_ops *t; + bfd *abfd; { struct section_table *p; - printf_filtered ("\t`%s', ", bfd_get_filename(exec_bfd)); + printf_filtered ("\t`%s', ", bfd_get_filename(abfd)); wrap_here (" "); - printf_filtered ("file type %s.\n", bfd_get_target(exec_bfd)); + printf_filtered ("file type %s.\n", bfd_get_target(abfd)); - for (p = exec_ops.sections; p < exec_ops.sections_end; p++) { + for (p = t->to_sections; p < t->to_sections_end; p++) { printf_filtered ("\t%s", local_hex_string_custom (p->addr, "08")); - printf_filtered (" - %s is %s\n", - local_hex_string_custom (p->endaddr, "08"), - bfd_section_name (exec_bfd, p->sec_ptr)); + printf_filtered (" - %s", local_hex_string_custom (p->endaddr, "08")); + if (info_verbose) + printf_filtered (" @ %s", + local_hex_string_custom (p->sec_ptr->filepos, "08")); + printf_filtered (" is %s", bfd_section_name (p->bfd, p->sec_ptr)); + if (p->bfd != abfd) { + printf_filtered (" in %s", bfd_get_filename (p->bfd)); + } + printf_filtered ("\n"); } } static void +exec_files_info (t) + struct target_ops *t; +{ + print_section_info (t, exec_bfd); +} + +static void set_section_command (args, from_tty) char *args; int from_tty; @@ -328,13 +384,14 @@ set_section_command (args, from_tty) /* Parse out new virtual address */ secaddr = parse_and_eval_address (args); - for (p = exec_ops.sections; p < exec_ops.sections_end; p++) { + for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++) { if (!strncmp (secname, bfd_section_name (exec_bfd, p->sec_ptr), seclen) && bfd_section_name (exec_bfd, p->sec_ptr)[seclen] == '\0') { offset = secaddr - p->addr; p->addr += offset; p->endaddr += offset; - exec_files_info(); + if (from_tty) + exec_files_info(&exec_ops); return; } } @@ -357,7 +414,7 @@ Specify the filename of the executable file.", 0, 0, /* insert_breakpoint, remove_breakpoint, */ 0, 0, 0, 0, 0, /* terminal stuff */ 0, 0, /* kill, load */ - 0, 0, /* call fn, lookup sym */ + 0, /* lookup sym */ child_create_inferior, 0, /* mourn_inferior */ file_stratum, 0, /* next */ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 293b417..3594f8f 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -540,6 +540,9 @@ lookup_template_type PARAMS ((char *, struct type *, struct block *)); extern struct type * lookup_fundamental_type PARAMS ((struct objfile *, int)); +extern void +fill_in_vptr_fieldno PARAMS ((struct type *)); + /* printcmd.c */ extern void diff --git a/gdb/language.c b/gdb/language.c index 01ed270..3ad4136 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -992,8 +992,8 @@ set_check (ignore, from_tty) } static void -show_check (arg, from_tty) - char *arg; +show_check (ignore, from_tty) + char *ignore; int from_tty; { cmd_show_list(showchecklist, from_tty, ""); diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index c68ca6b..2657eb9 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -76,8 +76,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define yyval m2_val #define yylloc m2_lloc +#if 0 static char * make_qualname PARAMS ((char *, char *)); +#endif static int parse_number PARAMS ((int)); @@ -88,9 +90,6 @@ yylex PARAMS ((void)); static void yyerror PARAMS ((char *)); -static void -__yy_bcopy PARAMS ((char *, char *, int)); - int yyparse PARAMS ((void)); @@ -1141,6 +1140,7 @@ yylex () } } +#if 0 /* Unused */ static char * make_qualname(mod,ident) char *mod, *ident; @@ -1152,7 +1152,7 @@ make_qualname(mod,ident) strcat(new,ident); return new; } - +#endif /* 0 */ static void yyerror(msg) diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 2a21b88..ef22101 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -247,7 +247,7 @@ find_proc_desc(pc, next_frame) /* IF this is the topmost frame AND * (this proc does not have debugging information OR * the PC is in the procedure prologue) - * THEN create a "hueristic" proc_desc (by analyzing + * THEN create a "heuristic" proc_desc (by analyzing * the actual code) to replace the "official" proc_desc. */ proc_desc = (struct mips_extra_func_info *)sym->value.value; @@ -289,7 +289,8 @@ FRAME_ADDR mips_frame_chain(frame) { mips_extra_func_info_t proc_desc; CORE_ADDR saved_pc = FRAME_SAVED_PC(frame); - if (current_objfile->ei.entry_file_lowpc) + + if (symfile_objfile->ei.entry_file_lowpc) { /* has at least the __start symbol */ if (saved_pc == 0 || inside_entry_file (saved_pc)) return 0; } @@ -767,7 +768,8 @@ fill_fpregset (fpregsetp, regno) itself if the code at PC does not look like a function prologue, PC+4 if it does (our caller does not need anything more fancy). */ -CORE_ADDR mips_skip_prologue(pc) +CORE_ADDR +mips_skip_prologue(pc) CORE_ADDR pc; { struct symbol *f; diff --git a/gdb/parse.c b/gdb/parse.c index 334733c..c8fc9b7 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -92,7 +92,7 @@ end_arglist () register struct funcall *call = funcall_chain; funcall_chain = call->next; arglist_len = call->arglist_len; - free (call); + free ((PTR)call); return val; } @@ -107,7 +107,7 @@ free_funcalls () for (call = funcall_chain; call; call = next) { next = call->next; - free (call); + free ((PTR)call); } } diff --git a/gdb/partial-stab.h b/gdb/partial-stab.h index ba4a307..554fe1a 100644 --- a/gdb/partial-stab.h +++ b/gdb/partial-stab.h @@ -234,8 +234,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ psymtab_include_list = (char **) alloca ((includes_allocated *= 2) * sizeof (char *)); - bcopy (orig, psymtab_include_list, - includes_used * sizeof (char *)); + memcpy ((PTR)psymtab_include_list, (PTR)orig, + includes_used * sizeof (char *)); } #endif /* DBXREAD_ONLY */ @@ -278,8 +278,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ psymtab_include_list = (char **) alloca ((includes_allocated *= 2) * sizeof (char *)); - bcopy (orig, psymtab_include_list, - includes_used * sizeof (char *)); + memcpy ((PTR)psymtab_include_list, (PTR)orig, + includes_used * sizeof (char *)); } continue; @@ -525,7 +525,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ (struct partial_symtab **) alloca ((dependencies_allocated *= 2) * sizeof (struct partial_symtab *)); - bcopy (orig, dependency_list, + memcpy ((PTR)dependency_list, (PTR)orig, (dependencies_used * sizeof (struct partial_symtab *))); #ifdef DEBUG_INFO diff --git a/gdb/saber.suppress b/gdb/saber.suppress index 7ea1a86..2ad0c38 100644 --- a/gdb/saber.suppress +++ b/gdb/saber.suppress @@ -190,6 +190,8 @@ suppress 70 on fatal /* Passing illegal enumeration value */ suppress 70 on error /* Passing illegal enumeration value */ +suppress 80 on first_link_map_member +/* Returning invalid pointer */ suppress 110 in printf_filtered /* Signed/unsigned memory retrieval */ suppress 110 in fprintf_filtered @@ -246,6 +248,8 @@ suppress 529 in do_registers_info /* Statement not reached */ suppress 529 in value_from_register /* Statement not reached */ +suppress 529 in solib_create_inferior_hook +/* Constant in conditional */ suppress 530 /* Empty body of statement */ suppress 546 in net_quit @@ -262,6 +266,8 @@ suppress 546 in value_equal /* Function exits through bottom */ suppress 546 in unpack_long /* Function exits through bottom */ +suppress 558 in solib_create_inferior_hook +/* Constant in conditional */ suppress 558 in read_range_type /* Constant in conditional */ suppress 558 in process_one_symbol @@ -280,6 +286,16 @@ suppress 558 in do_registers_info /* Constant in conditional */ suppress 558 in value_from_register /* Constant in conditional */ +suppress 558 in add_enum_psymbol +/* Constant in conditional */ +suppress 558 in add_partial_symbol +/* Constant in conditional */ +suppress 558 mfree.c +/* Constant in conditional */ +suppress 558 mmalloc.c +/* Constant in conditional */ +suppress 558 mrealloc.c +/* Constant in conditional */ suppress 560 in solib_address /* Assignment within conditional */ suppress 560 in solib_info @@ -396,7 +412,7 @@ suppress 590 on ignore_symbols /* Formal param not used */ suppress 590 on signo /* Formal param not used */ -suppress 652 in ../bfd/libaout.h +suppress 652 /* The declaration has no effect */ suppress 442 in ../bfd/archive.c /* Escape sequence in string literal has null value */ diff --git a/gdb/solib.c b/gdb/solib.c index f2f646d..6dc6572 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -26,11 +26,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <link.h> #include <sys/param.h> #include <fcntl.h> -#include <a.out.h> + +#ifndef SVR4_SHARED_LIBS + /* SunOS shared libs need the nlist structure. */ +#include <a.out.h> +#endif #include "symtab.h" #include "bfd.h" #include "symfile.h" +#include "objfiles.h" #include "gdbcore.h" #include "command.h" #include "target.h" @@ -124,16 +129,18 @@ first_link_map_member PARAMS ((void)); static CORE_ADDR locate_base PARAMS ((void)); +static void +solib_map_sections PARAMS ((struct so_list *)); + +#ifdef SVR4_SHARED_LIBS + static int look_for_base PARAMS ((int, CORE_ADDR)); static CORE_ADDR bfd_lookup_symbol PARAMS ((bfd *, char *)); -static void -solib_map_sections PARAMS ((struct so_list *)); - -#ifndef SVR4_SHARED_LIBS +#else static void solib_add_common_symbols PARAMS ((struct rtc_symb *, struct objfile *)); @@ -287,6 +294,8 @@ solib_add_common_symbols (rtc_symp, objfile) #endif /* SVR4_SHARED_LIBS */ +#ifdef SVR4_SHARED_LIBS + /* LOCAL FUNCTION @@ -329,8 +338,8 @@ bfd_lookup_symbol (abfd, symname) if (storage_needed > 0) { - symbol_table = (asymbol **) bfd_xmalloc (storage_needed); - back_to = make_cleanup (free, symbol_table); + symbol_table = (asymbol **) xmalloc (storage_needed); + back_to = make_cleanup (free, (PTR)symbol_table); number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table); for (i = 0; i < number_of_symbols; i++) @@ -430,6 +439,8 @@ look_for_base (fd, baseaddr) return (1); } +#endif + /* LOCAL FUNCTION @@ -867,14 +878,14 @@ clear_solib() { if (so_list_head -> sections) { - free (so_list_head -> sections); + free ((PTR)so_list_head -> sections); } if (so_list_head -> so_bfd) { bfd_close (so_list_head -> so_bfd); } next = so_list_head -> next; - free(so_list_head); + free((PTR)so_list_head); so_list_head = next; } debug_base = 0; @@ -1106,11 +1117,6 @@ FIXME void solib_create_inferior_hook() { - CORE_ADDR debug_addr; - int in_debugger; - CORE_ADDR in_debugger_addr; - CORE_ADDR breakpoint_addr; - int i, j; if ((debug_base = locate_base ()) == 0) { diff --git a/gdb/sparc-xdep.c b/gdb/sparc-xdep.c index 7fabdab..327388e 100644 --- a/gdb/sparc-xdep.c +++ b/gdb/sparc-xdep.c @@ -242,11 +242,11 @@ store_inferior_registers (regno) } void -fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) +fetch_core_registers (core_reg_sect, core_reg_size, which, ignore) char *core_reg_sect; unsigned core_reg_size; int which; - unsigned int reg_addr; /* Unused in this version */ + unsigned int ignore; /* reg addr, unused in this version */ { if (which == 0) { diff --git a/gdb/utils.c b/gdb/utils.c index 974f2ce..e4e7bed 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -144,7 +144,7 @@ discard_cleanups (old_chain) while ((ptr = cleanup_chain) != old_chain) { cleanup_chain = ptr->next; - free (ptr); + free ((PTR)ptr); } } diff --git a/gdb/values.c b/gdb/values.c index 3dc1acc..998c42e 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -312,9 +312,9 @@ clear_value_history () { for (i = 0; i < VALUE_HISTORY_CHUNK; i++) if (val = value_history_chain->values[i]) - free (val); + free ((PTR)val); next = value_history_chain->next; - free (value_history_chain); + free ((PTR)value_history_chain); value_history_chain = next; } value_history_count = 0; @@ -450,7 +450,7 @@ set_internalvar (var, val) SET_TRAPPED_INTERNALVAR (var, val, 0, 0, 0); #endif - free (var->value); + free ((PTR)var->value); var->value = value_copy (val); release_value (var->value); } @@ -474,9 +474,9 @@ clear_internalvars () { var = internalvars; internalvars = var->next; - free (var->name); - free (var->value); - free (var); + free ((PTR)var->name); + free ((PTR)var->value); + free ((PTR)var); } } |