<Ulf.Lunde@kvatro.no> and Dag H. Wanvik <Dag.H.Wanvik@kvatro.no>.
* coffread.c (getfilename): Eliminate COFF_NO_LONG_FILE_NAMES
test, which is apparently left over from when we used native
include files and couldn't depend on the member names being there.
* tm-3b1.h, tm-altos.h, tm-i386v.h: Don't set it.
ALso fix this in tm-i860.h which isn't ChangeLogged since it's sanitized out
for lack of paperwork.
* Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c,
m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c.
* Makefile.in (HFILES): Add valprint.h.
* Makefile.in (OBS): Add typeprint.o, c-typeprint.o,
m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o.
* typeprint.c, typeprint.h: New files for language independent
type printing functions.
* c-typeprint.c, m2-typeprint.c: New files for language dependent
type printing functions and definitions.
* valprint.h: New include file for language independent value
printing definitions.
* c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language
dependent value printing functions.
* c-exp.y (production ptype): Add range_type variable and use new
create_range_type function.
* c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab),
infcmd.c (path_var_name), language.c (unk_op_print_tab),
m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent
"const static" to ANSI-conformant "static const".
* c-exp.y (c_create_fundamental_type): Remove unused nbytes.
* c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type,
and c_val_print.
* c-lang.h (c_print_type, c_val_print): Add prototypes.
* coffread.c (decode_type): Add range_type variable and call to
new create_range_type function.
* complaints.c (complain): Remove unused val variable.
* complaints.c (_initialize_complaints): Make it void.
* convex-tdep.c (value_of_trapped_internalvar): Add range_type
variable and call new create_range_type function.
* defs.h (enum val_prettyprint): Move enum from value.h to here
so we can avoid having to include value.h just for prototypes that
need the enum (thanks ANSI).
* dwarfread.c (struct_type): Local anonymous_size variable is
only used if !BITS_BIG_ENDIAN.
* dwarfread.c (decode_subscript_data_item): Add rangetype
variable and call new create_range_type function.
* elfread.c (elf_symfile_read): Remove unused dbx and text_sect
variables.
* eval.c (evaluate_subexp): Remove unused local variable name
and the statement with no side effects that initializes it.
* expprint.c (print_subexp): Change local_printstr to
LA_PRINT_STRING.
* gdbtypes.c (create_range_type): New function that creates
a range type using code fragments from object file readers as
an example of what has to be initialized.
* gdbtypes.c (create_array_type): Removed index_type, low_bound,
and high_bound parameters, replaced with a single range_type
parameter. Change function body to use passed in range_type
rather than handcrafting one.
* gdbtypes.h (create_range_type): Add prototype.
* gdbtypes.h (create_array_type): Change prototype parameters.
* infrun.c (normal_stop): Remove unused local variables tem and c.
* infrun.c (hook_stop_stub): Return 0 rather than random value.
* language.c (unk_lang_print_type, unk_lang_val_print): Add
stub functions that call error if called.
* language.c (unknown_language_defn, auto_language_defn,
local_language_defn): Add initializers unk_lang_print_type and
unk_lang_val_print.
* language.h (struct language_defn): Reformat for larger
comments, add la_print_type and la_val_print members. Add
LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar
to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING.
* m2-lang.c (m2_create_fundamental_type): Remove unused local
variable nbytes.
* m2-lang.c (m2_language_defn): Add initializers m2_print_type
and m2_val_print.
* m2-lang.h (m2_print_type, m2_val_print): Add prototypes.
* main.c (execute_command): Remove unused local variable cmdlines.
* main.c (echo_command), stabsread.c (read_type), printcmd.c
(clear_displays), symmisc.c (block_depth), values.c
(clear_value_history):
Make testing of truth value of assignment result explicit.
* mipsread.c (upgrade_type): Update FIXME to include future use
of create_range_type.
* printcmd.c (ptype_command, ptype_eval, whatis_command,
whatis_exp, maintenance_print_type): Move prototypes and functions
to new typeprint.c.
* printcmd.c (_initialize_printcmd): Move add_com calls for
ptype_command and whatis_command to new typeprint.c.
* ser-bsd.c (serial_open): Remove unused variable sgttyb.
* source.c (find_source_lines): Local variable c only used
when LSEEK_NOT_LINEAR is defined.
* stabsread.c (read_array_type): Use new create_range_type
function.
* stabsread.c (read_range_type): Add new index_type variable and
call new create_range_type function rather than handcrafting
range types.
* symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE.
* symtab.c (typedef_print usages): Use c_typedef_print, renamed.
* symtab.c (type_print_base usages): Use c_type_print_base.
* symtab.c (type_print_varspec_prefix usages): Use
c_type_print_varspec_prefix.
* symtab.c (type_print_method_args usages): Use
cp_type_print_method_args.
* valprint.c: Completely ripped apart and the fragments used
to create c-valprint.c, cp-valprint.c, m2-valprint.c, and
valprint.h. Remaining stuff is language independent.
* value.h (struct fn_field): Forward declare for prototypes.
* value.h (type_print_1): Remove prototype.
* value.h (enum val_prettyprint): Moved to defs.h.
* value.h (typedef_print): Prototype renamed to c_typedef_print.
* value.h (baseclass_offset): Add prototype.
**** start-sanitize-chill ****
* Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c.
* Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o.
* ch-typeprint.c: New file for language dependent type printing.
* ch-valprint.c: New file for language dependent value printing.
* ch-exp.y (parse_number): Remove prototype and stub function.
* ch-exp.y (decode_integer_literal): Removed unused digits and
temp variables.
* ch-exp.y (convert_float): Completely ifdef out for now.
* ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5),
ch-lang.c (chill_op_print_tab):
Change from ANSI-obsolescent "const static" to ANSI-conformant
"static const".
* ch-exp.y (yylex): Add unhandled storage class enumeration
literals to switch statement for completeness.
* ch-lang.c (chill_create_fundamental_types): Remove unused
nbytes variable. Change dummy type to 2 bytes to match int.
Handle FT_VOID types gratuituously added to chill DWARF by
compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR
type rather than a one byte TYPE_CODE_INT type.
* ch-lang.c (chill_language_defn): Add chill_print_type and
chill_val_print.
* ch-lang.h (chill_print_type, chill_val_print): Add prototypes.
**** end-sanitize-chill ****
bfd_get_symbol_leading_char instead.
* coffread.c (EXTERNAL_NAME): New macro for removing possible
leading character from names.
(read_coff_symtab): Use BFD's FILE *, don't open a second one.
(read_coff_symtab): Complain() about .bb/.eb mismatch, don't error().
(process_coff_symbol, coff_read_struct_type, coff_read_enum_type):
Replace NAMES_HAVE_UNDERSCORE with EXTERNAL_NAME.
* kdb-start.c (main): Remove NAMES_HAVE_UNDERSCORE.
* minsyms.c (install_minimal_symbols): Replace NAMES_HAVE_UNDERSCORE.
Remove SOME_NAMES_HAVE_DOT support (apparently unused).
* partial-stab.h: Replace NAMES_HAVE_UNDERSCORE.
* solib.c: Replace NAMES_HAVE_UNDERSCORE.
* stabsread.h: Remove NAMES_HAVE_UNDERSCORE and HASH_OFFSET.
* symfile.c (syms_from_objfile): Insert debugging check to test
NAMES_HAVE_UNDERSCORE setting against the BFD support. FIXME,
remove this (and all tm-*.h NAMES_HAVE_UNDERSCORE) soon.
* doc/gdbint.texinfo (Host Conditionals): Remove
NAMES_HAVE_UNDERSCORE, SOME_NAMES_HAVE_DOT, document
MEM_FNS_DECLARED.
(Target Conditionals): Remove all of the above.
* coffread.c (decode_type): catch negative tagndx fields generated
by SCO 3.2v4 cc.
* exec.c: comment out string following #endif.
* configure.in (i[34]86-*-sco3.2v4*): use host i386sco4.
* xm-i386sco.h: include <sys/types.h> and <sys/dir.h>, required by
<sys/user.h>.
* config/i386sco4.mh: new file; like i386sco.mh, but don't require
gcc, and define const to empty to avoid SCO 3.2v4 cc bug.
* complaints.c (complain): Made into a varargs function.
* complaints.h: New file, code moved from symfile.h.
* Makefile.in (SFILES_MAINDIR): Add complaints.c.
* Makefile.in (HFILES): Add complaints.h.
* Makefile.in (OBS): Add complaints.o.
* symfile.c (complaint_root, stop_whining, complaint_series,
complain, clear_complaints, add_show_from_set for stop_whining):
Moved to complaints.c.
* symfile.h (struct complaint, complaint_root decl, complain
prototype, clear_complaints prototype): Moved to complaints.h.
* buildsym.c, coffread.c, dbxread.c, dwarfread.c, elfread.c,
gdbtypes.c, mipsread.c, stbsread.c, symfile.c: Include
complaints.h. Remove casts from arguments to complain(),
which is now a varargs function, and remove unnecessary
placeholder zero args.
* defs.h (begin_line): Add prototype.
* defs.h (vprintf_filtered): Add prototype.
* dwarfread.c (varargs.h): Remove, no longer needed.
* dwarfread.c (dwarfwarn): Remove prototype and function.
* dwarfread.c (complaints): Define a bunch of complaints.
* dwarfread.c (SQUAWK): Remove macro defs, convert all
usages to standard complain() calls.
* utils.c (begin_line): New function that ensures that
whatever gets filter-printed next starts on its own line.
* utils.c (vprintf_filtered): New func, like vfprintf_filtered,
but to stdout (calls vfprintf_filtered internally).
a optional type to decorate as an array type, the type of the
index, and the bounds of the array. Records this additional info
in the array type for use with languages with nonzero array
bounds.
* gdbtypes.h (enum type_code): Update comment for TYPE_CODE_ARRAY
to note that arrays may have bounds.
* gdbtypes.h (create_array_type): Update prototype.
* c-exp.y (ptype production): Adjust for new create_array_type
calling conventions.
* coffread.c (decode_type): Call create_array_type rather than
handcrafting array types.
* convex-tdep.c (value_type): Remove, now use create_array_type.
* convex-tdep.c (value_of_trapped_internalvar): Convert calls to
vector_type into calls to create_array_type.
* dwarfread.c (decode_subscr_data): Name changed to
decode_subscript_data_item throughout.
* dwarfread.c (decode_subscript_data_item): Rewrite to use
create_array_type. Now records index type and range as well.
* dwarfread.c (dwarf_read_array_type): Rewrite as part of
change to use create_array_type.
* dwarfread.c (read_subroutine_type): Test existing user defined
types before decorating them, to ensure they are blank, and
complain about it if they are not.
* dwarfread.c (decode_fund_type): For unrecognized types, always
return some valid type (type integer). If the unrecognized type
cannot be an implementation defined type, complain as well.
* m88k-tdep.c (pushed_size): Update comment for TYPE_CODE_ARRAY.
* m88k-tdep.c (store_param): Update comment for TYPE_CODE_ARRAY.
* mipsread.c (upgrade_type): Add FIXME comment that code to
handcraft arrays should be replaced with call to create_array_type.
* stabsread.c (read_array_type): Replace code to handcraft
array types with call to create_array_type.
* valprint.c (type_print_varspec_prefix): Minor formatting
change, join lines that don't need to be split.
symtab.h, tm-i386v4.h, valprint.c, values.c: Lint.
* breakpoint.c, c-exp.y, coffread.c, command.c, environ.c, eval.c,
findvar.c, infcmd.c, infptrace.c, infrun.c, m2-exp.y, parse.c,
putenv.c, solib.c, sparc-xdep.c, symtab.c, tm-i386v.h, tm-sparc.h,
utils.c, valarith.c, valops.c, valprint.c, values.c:
Replace bcopy() use with memcpy(), which is more standard and can
take advantage of gcc's builtin functions for increased performance.
* breakpoint.c, buildsym.c, coffread.c, dbxread.c, i386-tdep.c,
ieee-float.c, infcmd.c, sparc-tdep.c, stack.c, symtab.c, symtab.h,
target.c, values.c:
Replace bzero() use with memset(), which is more standard and can
take advantage of gcc's builtin functions for increased performance.
* i386-tdep.c, main.c, valprint.c:
Replace bcmp() use with memcmp(), which is more standard and can
take advantage of gcc's builtin functions for increased performance.
* coffread.c (coff_end_symtab): Cast 2nd arg of complain() to
correct type.
* defs.h (NORETURN): Define away for Lucid compiler.
* remote.c (remote_timer, remote_interrupt): Signal handlers
take one int arg.
* ser-termios.c (serial_write, serial_close): Return whatever
value the write/close call returns, rather than falling off end.
* inferior.h (PTRACE_ARG3_TYPE): Third arg to ptrace is int on
more systems than it is "char *". Define PTRACE_ARG3_TYPE to
default to int.
* infptrace.c, hppabsd-xdep.c, hppahpux-xdep.c, i386-xdep.c,
inferior.h (call_ptrace): Use PTRACE_ARG3_TYPE to declare type
of third arg.
* a68v-xdep.c, arm-xdep.c, convex-xdep.c, hp300ux-xdep.c, infrun.c,
m88k-xdep.c, mach386-xdep.c, mips-xdep.c, os68k-xdep.c, pyr-tdep.c,
pyr-xdep.c, rs6000-xdep.c, sparc-xdep.c, sun3-xdep.c, sun386-xdep.c,
symm-xdep.c, ultra3-xdep.c: Use PTRACE_ARG3_TYPE to cast ptrace
argument 3.
* sparc-xdep.c, a68v-xdep.c (fetch_inferior_registers,
store_inferior_registers): Supply missing fourth argument to
ptrace().
* coffread.c (record_minimal_symbol): Pass the minsym type to it.
Callers changed.
(coff_end_symtab): Sort blocks if needed. Complain if misordered.
(read_coff_symtab): Move patch_opaque_types call from
coff_symfile_read. Restrict it to symtabs from this objfile.
(process_coff_symbol: C_TPDEF): Don't put ordinary foward
references on opaque type chain; just let coff_lookup_type handle 'em.
(decode_type): Complain about tagndx values on
non-struct/union/enum types, which the EPI compiler tends to produce.
* symtab.c (list_symbols): Make minimal symbol variable-finding work.
* tm-68k.h (FIX_CALL_DUMMY): Avoid alignment and byte order
dependency.
* elfread.c (elf_symfile_read): Update bfd_elf_find_section
usage to match new prototype. Include libbfd.h to get prototype.
elfread.c (coff_symfile_finish): Add function, prototype, and
add to the xxxx_sym_fns struct for each file type. Also reformat
the xxxx_sym_fns vector to a standard format and add comments.
* coffread.c, mipsread.c, xcoffread.c, coffread.c, dbxread.c,
elfread.c (xxx_symfile_new_init, xxx_symfile_init, xxx_symfile_read):
Pass pointer to struct objfile rather than pointer to sym_fns.
Change references inside each function accordingly. Allocate any
symbol file specific info in the per-objfile memory region.
* dbxread.c (free_and_init_header_files): Break function into
free_header_files(), called from dbx_symfile_finish(), and
init_header_files(), called from dbx_new_init().
* dbxread.c (dbx_new_init): Move deallocation things to new
dbx_symfile_finish function.
* elfread.c (elf_new_init): Call buildsym_new_init().
* objfiles.c (free_objfile): Call the appropriate symfile_finish()
routine for the objfile before deallocating other stuff.
* sparc-tdep.c (get_longjmp_target): Cast target_read_memory arg.
* symfile.h: Move struct sym_fns to before struct objfile def.
Add sym_finish function pointer and change prototypes of other
function pointers to reflect passing struct objfile pointer rather
than struct sym_fns pointer.
* symfile.c: Remove now obsolete symtab_fns pointer.
* symfile.c (symfile_init): Renamed to find_sym_fns, and now only
locates the correct sym_fns struct for the given objfile.
* symfile.c (syms_from_objfile, symbol_file_add): Restructured
for better support of mapped symbol tables.
* symfile.c (symbol_file_command): Remove obsolete code using
symfile_fns.
* symfile.h: Remove duplicate declarations for symfile_objfile,
entry_point, and object_files.
* target.c (target_info): Compare symfile_objfile to NULL.
* xcoffread.c (aixcoff_new_init): Move deallocation stuff to
aixcoff_symfile_finish().
Complain if no auxents on .bf and .ef FCN symbols, and assume
lots of line numbers.
(init_linenos, enter_linenos): Use a sentinel at the end of the
read-in linenos, to make for a fast, safe loop-end test.
(add_symbol_file): Call it to do the real work.
(syms_from_bfd): Initialize entry_point before calling symfile_init.
* symtab.h, symfile.c, coffread.c, mipsread.c, dwarfread.c:
Avoid declaring or setting entry_point (symfile.h & symfile.c cope).
* configure.in, Makefile.in: Avoid rebuilding "depend" as much.
Avoid declaring Makefile dependencies, because GNU Make stupidly
tries to update it if we do.
* coffread.c: Revise for minor changes to bfd internal coff
indexes.
* configure: If -template= is given a relative path, make it
absolute before recurring in subdirectories.
Get getopt and obstack from -liberty rather than compiling them here.
* coffread.c: turn a printf into a complain(), and try to deal more
gracefully with botched-looking lineno pointers.
* dbxread.c: Use bfd_get_symcount rather than bfd_get_symcount_upper_bound.
Don't coredump on files with zero symbols in them (a BFD bug showed this one).
* environ.c: Pass GNUTARGET into the parent (gdb) as well as the child.
a file, once a new symtab has been read for it.
* symtab.h (GLOBAL_BLOCK, STATIC_BLOCK, FIRST_LOCAL_BLOCK): New
defines for the blocks of a blockvector that contain global and
file-static symbols and the first of the smaller scope contours.
* symtab.c (lookup_symbol, find_pc_symtab, find_pc_line,
decode_line_1, make_symbol_completion_list): Use the above.
* coffread.c (end_symtab, patch_opaque_types): Ditto.