Based on patch from Daniel Berlin <dberlin@dberlin.org>.
* buildsym.c: Include "demangle.h" for SYMBOL_INIT_DEMANGLED_NAME.
(finish_block) For non-function blocks, hash the symbol table. For
function blocks, mark the symbol table as unhashed.
* minsyms.c (msymbol_hash): Return hash value without taking modulus.
(msymbol_hash_iw): Likewise.
(add_minsym_to_hash_table): Take modulus of msymbol_hash's return
value.
(add_minsym_to_demangled_hash_table): Likewise for msymbol_hash_iw.
(lookup_minimal_symbol): Likewise for both.
* symtab.h (struct block): Add `hashtable' flag. Comment the
hashtable.
(BLOCK_HASHTABLE, BLOCK_BUCKETS, BLOCK_BUCKET): New macro.
(ALL_BLOCK_SYMBOLS): Update.
(BLOCK_SHOULD_SORT): Do not sort hashed blocks.
(struct symbol): Add `hash_next' pointer.
* symtab.c (lookup_block_symbol): Search using the hash table when
possible.
(find_pc_sect_symtab): Use ALL_BLOCK_SYMBOLS.
(search_symbols, find_addr_symbol): Likewise.
* dstread.c (process_dst_block): Clear hashtable bit for new block.
(read_dst_symtab): Likewise.
* jv-lang.c (get_java_class_symtab): Likewise.
* mdebugread.c: Include "gdb_assert.h".
(shrink_block): Assert that the block being modified is not hashed.
* coffread.c (patch_opaque_types): Use ALL_BLOCK_SYMBOLS.
* symmisc.c (free_symtab_block): Walk the hash table when freeing
symbols.
(dump_symtab): Recognize hashed blocks.
* printcmd.c (print_frame_args): Assert that function blocks do not
have hashed symbol tables.
* ada-lang.c (symtab_for_sym): Use ALL_BLOCK_SYMBOLS.
(fill_in_ada_prototype, debug_print_block): Likewise.
(ada_add_block_symbols): Use ALL_BLOCK_SYMBOLS. Handle hash tables.
in them yet.
* symtab.h (struct symtab): New member: `macro_table'.
* buildsym.h (pending_macros): New global variable.
* buildsym.c: #include "macrotab.h".
(buildsym_init): Initialize `pending_macros'.
(end_symtab): If we found macro information while reading a CU's
debugging info, do build a symtab structure for it. Make the
symtab point to the macro information, and clear the
`pending_macros' pointer which held it while we were reading the
debug info.
(really_free_pendings): Free any pending macro table.
* objfiles.h (struct objfile): New member: `macro_cache'.
* objfiles.c (allocate_objfile): Set allocate and free functions
for the macro cache's objstack.
(free_objfile): Empty the macro cache's obstack.
* symfile.c (reread_symbols): Empty the macro cache's obstack, and
set new allocate and free functions for it.
* solib-sunos.c (allocate_rt_common_objfile): Set allocate and
free functions for the macro cache's objstack. (Why is this
function building its own objfile?)
* symmisc.c (print_objfile_statistics): Print statistics on the
macro bcache.
* Makefile.in: Note that buildsym.o depends on macrotab.h.
(top-level): #include filenames.h.
* dwarf2read.c (dwarf2_start_subfile): Use IS_ABSOLUTE_PATH and
FILENAME_CMP, to DTRT on non-Posix platforms.
(top-level): #include filenames.h.
CUR_SYMBOL_VALUE as CORE_ADDR instead of long
* buildsym.[ch]: export pending_blocks list
* tm-txvu.h: define TARGET_READ_SP and TARGET_WRITE_SP
* txvu-tdep.c: rewrite symtabs to support N_FUN symbols in overlays.
(Actually, the last version did this for N_SLINE symbols).
(txvu_read_sp,txvu_write_sp): new
source files.
* breakpoint.c (resolve_sal_pc): Prevent crash when pc isn't
associated with a function.
* buildsym.c (record_line start_symtab end_symtab): Don't delete
symtabs which only have line numbers (but no other debug symbols).
* dbxread.c (read_dbx_symtab end_psymtab): Ditto.
* remote-sim.c: New functions gdbsim_insert/remove_breakpoint. Use
intrinsic simulator breakpoints if available, otherwise do it the
hard way.
* configure.tgt: Add d30v.
* d30v-tdep.c: New file.
* config/d30v/d30v.mt, config/d30v/tm-d30v.h: New files.
reading stabs extensions for live range information.
* stabsread.h, partial-stab.h: Add prototypes for new functions.
* symtab.h: Add structure for storing live range information.
(record_debugformat): Declare global function.
* buildsym.c (start_subfile): Initialize debugformat member
to NULL.
(record_debugformat): New function to record the format.
(end_symtab): Copy format into symtab debugformat member.
(end_symtab): Free subfile debugformat member.
* symmisc.c (free_symtab): Free debugformat when freeing
symtab.
* symfile.c (allocate_symtab): Initialize the new debugformat
member for new symtabs.
* symtab.h (struct symtab): Add debugformat member.
* source.c (source_info): Print the debug format.
* os9kread.c (os9k_process_one_symbol): Call record_debugformat
with "OS9".
* hpread.c (hpread_expand_symtab): Call record_debugformat
with "HP".
(hpread_process_one_debug_symbol): Ditto.
* dbxread.c (process_one_symbol): Call record_debugformat
with "stabs".
* coffread.c (coff_start_symtab): Call record_debugformat
with "COFF".
* xcoffread.c (read_xcoff_symtab): Call record_debugformat
with "XCOFF".
* dwarfread.c (read_file_scope): Call record_debugformat
with "DWARF 1".
* dwarf2read.c (read_file_scope): Call record_debugformat
with "DWARF 2".
* dstread.c (dst_end_symtab): Set debugformat to be
"Apollo DST".
* mdebugread.c (new_symtab): Set debugformat to be "ECOFF".
from being sent to 32-bit targets by masking off upper bits.
* mips-tdep.c (heuristic_proc_start): Mask off upper 32 bits
of PC on 32-bit targets.
(mips16_heuristic_proc_desc): Recognize 'addiu s1,sp,n' as a
frame setup instruction.
(mips32_heuristic_proc_desc): Fix warning found by gcc -Wall.
(mips16_skip_prologue): Recognize 'addiu s1,sp,n' as a valid
prologue instruction. Fix warnings and bugs found by gcc -Wall.
* buildsym.c (finish_block): Improve handling of overlapping blocks;
fixes problem on MIPS16 printing function arguments.
LOC_LOCAL_ARG as arguments so that GDB will know about function
args declared this way. Mostly affects dwarf.
* dwarfread.c (decode_die_type): Change default type from int to
void. This allows GDB to recognize void functions.
* (new_symbol): If AT_PROTOTYPED is present, set a flag in the
type structure.
* findvar.c (extract_floating store_floating): Clean up comments
to reflect reality.
* gdbtypes.h: Add TYPE_FLAG_PROTOTYPED so that we can tell if a
function has a prototype. Currently, only dwarf supports this.
* utils.c (floatformat_from_doublest): Fix logic error with
converting from double to float. (It wasn't shifting mant_long if
it had a hidden bit.)
* v850-tdep.c: Add support for function calling. Fix some
problems with debugging code w/o debug symbols.
* config/v850/tm-v850.h: Ditto.
* dbxread.c (dbx_symfile_read): Call free_pending_blocks rather
than poking global variable (which is now static).
* hpread.c (hpread_build_psymtabs): Ditto.
* os9kread.c (os9k_symfile_read): Ditto.
* xcoffread.c (xcoff_initial_scan): Ditto.
* buildsym.h (free_pending_blocks): Declare here.
(pending_blocks): Remove declaration of global symbol.
(free_pendings): Remove declaration of global symbol.
(make_blockvector): Declare here.
(record_pending_block): Declare here.
* dstread.c (make_blockvector): Remove static copy that was old
clone of version in buildsym.c.
(process_dst_block): Call record_pending_block rather than doing
it by hand.
(read_dst_symtab): Ditto.
* buildsym.c (make_blockvector): Make global rather than static,
(record_pending_block): New function, code moved from finish_block.
(finish_block): Use record_pending_block.
(free_pending_blocks): New function.
(really_free_pendings): Call free_pending_blocks.
(pending_blocks): Make static instead of global.
(free_pendings): Make static instead of global.
print the addresses as part of the complaint. Add a complaint for
cases where the block end address is smaller than the block start
address, in case any such conditions slip through our fixup mechanism.
* symmisc.c (dump_symtab): Only print blockvector for primary
symtabs, to avoid massive duplication of output due to secondary
symtabs that point to same blockvector. Also do some minor
formatting tweaks.
for passing to add_com.
* scm-exp.c (scm_lreadr): Ensure svalue is not used uninitialized.
* buildsym.c (compare_line_numbers): Change function to match
prototype and also what qsort expects.
arguments. Sorting is now dependent on OBJF_REORDERED. All
callers/references changed.
* dbxread.c (read_ofile_symtab): Correctly determine value for
last_source_start_addr for reordered executables.
(process_one_symbol): Handle N_FUN with no name as an end of
function marker.
* partial-stab.h (case N_FN, N_TEXT): Don't assume CUR_SYMBOL_VALUE
is the high text address for a psymtab.
(case N_SO): Likewise.
(case N_FUN): Handle N_FUN with no name as an end of function
marker.
* minsyms.c (lookup_minimal_symbol_by_pc): Examine all symbols
at the same address rather than a random subset of them.
* coffread.c (coff_symfile_init): Set OBJF_REORDERED.
* elfread.c (elf_symfile_init): Similarly.
* somread.c (som_symfile_init): Similarly.
* xcoffread.c (xcoff_symfile_init): Similarly.
Support for debugging reordered executables. Remaining mentor vm
changes.
a location whose address has to be resolved via the minimal
symbol table.
* buildsym.c (finish_block), findvar.c (symbol_read_needs_frame,
read_var_value), printcmd.c (address_info),
symmisc.c (print_symbol, print_partial_symbol): Handle
LOC_UNRESOLVED.
* stabsread.c (scan_file_globals): Change unresolved LOC_STATIC
symbols to LOC_UNRESOLVED. Remove rt_common_objfile lookup
kludge, global common symbols are now handled by LOC_UNRESOLVED.
(scan_file_globals_1): Move code back to scan_file_globals,
delete.
to char, since everything passed in and out of dcache is char or casted
to appropriate type anyway.
(dcache_alloc): Move assignment of db out of test and combine separate
tests into if-else.
(dcache_peek_byte): Change ptr from unsigned char* to char*.
(dcache_peek_byte): Remove now unnecessary cast in read_memory call.
(dcache_peek): Change cast of incoming data arg.
(dcache_poke): Change cast of addr of incoming data arg.
(dcache_info): Mask data passed to printf_filtered to lsbyte only.
(dcache_info): Change printf_filtered arg from "% 2x" to " %2x".
* target.c (debug_to_thread_alive): Change return type to int and
return zero, for type compatibility with other *_thread_alive funcs.
(cleanup_target): Change cast of ignore function to match type of the
to_thread_alive member.
* defs.h (error_hook): Add ATTR_NORETURN.
* defs.h (NORETURN, ATTR_NORETURN): Switch from volatile to
__attribute__ method with gcc 2.7, to avoid gcc 2.6.3 bug.
* remote.c (remote_wait): Cast first arg to strtol, strchr, and strncmp
to "const char *" from "unsigned char *".
(remote_wait): Cast arg to putpkt and strcpy from "unsigned char *" to
"char *".
(remote_wait): Change printf format for long arg from "%d" to "%ld".
(getpkt): Remove unused variable "bp".
(remote_fetch_word, remote_store_word): Ifdef out apparently unused
functions.
* breakpoint.c (watchpoint_check): Removed unused variables
"saved_level" and "saved_frame".
* valops.c (value_arg_coerce): Add other enum TYPE_CODE_* and
default cases to switch for completeness.
* infrun.c (wait_for_inferior): Enclose "have_waited" label
in #ifdef that matches the one in which it is referenced.
* ser-unix.c (hardwire_noflush_set_tty_state): Enclose otherwise
unused variable "state" in #ifdef that matches one in which it is
referenced.
* eval.c (evaluate_subexp_standard): Remove unused variable "var".
* eval.c (evaluate_subexp_standard): Remove unused variable "tmp_symbol".
* valarith.c (value_subscript): Remove unused variable "lowerbound",
which is redeclared in a nested scope prior to use.
* printcmd.c (print_frame_nameless_args): Use "%ld" to print long
arg, not "%d".
* {mem-break.c, remote-pa.c, remote.c, saber.suppress}:
Remove unused static var "check_break_insn_size".
* buildsym.c (finish_block): Add other enum LOC_* and default
cases to switch for completeness.
ch-lang.c (type_lower_upper): Removed unused label "retry".
Add other enum TYPE_* and default cases to switch for completeness.
* f-typeprint.c (f_type_print_args): Ifdef out unused function
that may be used someday when Fortran support is complete.
* ch-valprint.c (chill_print_type_scalar): Add other enum
TYPE_* and default cases to switch for completeness.
(chill_val_print): Remove unused local var "high_bound" that
is redeclared in a nested scope prior to use.
(chill_var_print): Use "%ld" to print long arg, not "%d".
* regex.c (re_compile_fastmap, re_match_2): Add remaining enum types
and default to switches for completeness.
* minsyms.c (lookup_minimal_symbol_text): Delete unused variable
"trampoline_symbol".
(prim_record_minimal_symbol_and_info): Return NULL rather than trash.
* elfread.c (elf_symtab_read): Don't dereference NULL returns from
record_minimal_symbol_and_info.
* f-lang.c (saved_function_list_end): Ifdef out unused variable
that may be used someday.
* f-valprint.c (f_val_print): Remove unused local variable "straddr".
with the real source file name.
* dbxread.c (end_psymtab): Handle static functions in the
SOFUN_ADDRESS_MAYBE_MISSING case by passing pst->filename
to lookup_minimal_symbol.
(process_one_symbol): Ignore extra outermost context from
SunPRO cc and acc.
* stabsread.c (define_symbol): Do not complain for SunPRO
static variable encoding if STATIC_TRANSFORM_NAME is defined.
* sparc-tdep.c, config/sparc/tm-sun4sol2.h
(sunpro_static_transform_name): Renamed from
solaris_static_transform_name.
* config/sparc/tm-sun4os4.h (STATIC_TRANSFORM_NAME):
Define to sunpro_static_transform_name for acc 3.0 compiled
executables.
* procfs.c, config/alpha/nm-osf2.h (PROCFS_DONT_TRACE_FAULTS):
Renamed from PROCFS_DONT_TRACE_IFAULT, don't trace any faults
if defined.
* procfs.c (info_proc_siginfo): Cast sip->si_addr to
`unsigned long' and use `lx' format for printing it.
parameter type info, set that from parameter symbols.
* c-typeprint.c (c_type_print_varspec_suffix): For TYPE_CODE_FUNC,
print parameter types, if available.
* ch-typeprint.c (chill_type_print_base): Likewise.
* gdbtypes.h (struct type): Remove function type field.
(TYPE_FUNCTION_TYPE): Remove macro. We can't as simply re-use
function types now that we're also storing parameter types.
And the payoff is much less.
* gdbtypes.c (make_function_type): Don't use/set TYPE_FUNCTION_TYPE.
(recursive_dump_type): Don't print TYPE_FUNCTION_TYPE.
* dwarfread.c (read_subroutine_type): Don't set TYPE_FUNCTION_TYPE.
(set_demangling_style, set_demangling_command): Use savestring not
strdup. We were not dealing properly with a NULL return from
strdup, and were not declaring strdup (the system header may or
may not have it).
various miscellaneous things discovered in the process:
* printcmd.c, defs.h (print_address_numeric): New function.
* c-valprint.c (c_val_print), ch-valprint.c (chill_val_print)
breakpoint.c (describe_other_breakpoints, breakpoint_1, mention),
cp-valprint.c (cplus_print_value), infcmd.c (jump_command),
printcmd.c, stack.c, symfile.c, symmisc.c, valprint.c:
Use it.
* utils.c, defs.h (gdb_print_address): New function.
* expprint (dump_expression), gdbtypes.h: Use it.
* breakpoint.c (describe_other_breakpoints),
symmisc.c (dump_symtab, print_symbol):
Use filtered not unfiltered I/O.
(remove_breakpoints): Remove BREAKPOINT_DEBUG code. Might as well
just run gdb under a debugger for this (and it had problems with
printing addresses, how to print b->shadow, etc.).
* buildsym.c (make_blockvector), core.c (memory_error),
exec.c (print_section_info), maint.c (print_section_table),
mdebugread.c (parse_procedure), solib.c, source.c, symfile.c,
symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c:
Add comments saying code is broken. Marked with "FIXME-32x64".
* dbxread.c (process_one_symbol), partial-stab.h (default),
remote-vx.c (vx_run_files_info):
Don't cast int being passed to local_hex_string.
* symmisc.c (print_symbol): Don't cast long being passed to %lx.
* symtab.h (general_symbol_info): Add comment about SYMBOL_VALUE
only being a long.
* symmisc.c (print_symbol): Print "offset" in message for LOC_ARG
and LOC_LOCAL.
* printcmd.c (print_address): Remove #if 0 code with ADDR_BITS_REMOVE.
* source.c: Include <sys/types.h> regardless of USG.