* minsyms.c (compare_minimal_symbols): If addresses are identical,
then compare on names. Sorted list should have symbols with
identical addresses AND names adjacent, so dups can be discarded.
Except for the two m32r modules, this checkin is for
overlay support.
* blockframe.c: blockvector_for_pc_sect(), block_for_pc_sect(),
find_pc_sect_function(), find_pc_sect_partial_function(): new
functions for debugging overlays; pc without section is ambiguous.
* breakpoint.[ch]: add section pointer to breakpoint struct;
add section argument to check_duplicates(); check section as well
as pc in [breakpoint_here_p(), breakpoint_inserted_here_p(),
breakpoint_thread_match(), bpstat_stop_status()];
add section argument to describe_other_breakpoints();
use INIT_SAL() macro to zero-out new sal structures;
make resolve_sal_pc() fix up the sal's section as well as its pc;
match on section + pc in clear_command() and delete_breakpoint();
account for overlay sections in insert_breakpoints(),
remove_breakpoint() and breakpoint_re_set_one();
all this to support overlays where a PC is not unique.
* exec.c: change xfer_memory() to handle overlay sections.
* findvar.c: change read_var_value() to handle overlay sections.
* frame.h: declaration for block_for_pc_sect() [blockframe.c].
* infcmd.c: jump_command() warns against jumping into an overlay
that's not in memory. Also use INIT_SAL() to initialize sals.
* infrun.c: wait_for_inferior() sets a flag to invalidate cached
overlay state information; Also use INIT_SAL() to init sals.
* m32r-rom.c: modify load routines to use LMA instead of VMA.
* m32r-stub.c: mask exit value down to 8 bits; screen out any
memory read/writes in the range 600000 to a00000, and ff680000
to ff800000 (hangs because nothing is mapped there); fix strcpy().
* maint.c: maintenance command "translate-address" supports overlays.
* minsyms.c: lookup_minimal_symbol_by_pc_sect() supports overlays.
* objfiles.[ch]: add ovly_mapped field to the obj_section struct;
this constitutes gdb's internal overlay mapping table. Add macro
ALL_OBJSECTIONS() to loop thru the obj_structs and look at overlays.
Add function find_pc_sect_section().
* printcmd.c: modify print_address_symbolic() with overlay smarts;
modify address_info() with overlay smarts; add function sym_info()
to support the INFO SYMBOL command (translate address to symbol(s));
modify disassemble_command() to work on unmapped overlays.
* source.c: use INIT_SAL() to initialize sals.
* symfile.[ch]: change generic_load() to use section's LMA address
instead of VMA address, for overlay sections.
Add numerous functions for finding a PC's section / overlay,
translating between VMA and LMA address ranges, determining if an
overlay section is mapped, etc. Add several user commands for
overlay debugging. Add support for a "generic" form of automatically
reading overlay mapping info from the inferior (based on the default
(simple) overlay manager which Cygnus provides as an example).
* symtab.[ch]: add functions find_pc_sect_symtab(),
find_pc_sect_psymtab(), find_pc_sect_psymbol(), find_pc_sect_line()
for lookup; modify lookup_symbol and decode_line_1() to use them;
modify find_function_start_sal() to account for overlay sections;
add macro INIT_SAL() for initializing struct symtab_and_line.
* target.c: fix a comment in the declaration of target_ops.
ENABLE_OBS, and THREAD_DB_OBS. These are consolidated into LIBS
and CONFIG_OBS.
* configure configure.in: Clean up test cases around thread support.
start-sanitize-v850
* configure.tgt (v850-*-*): Include v850ice.o and v850.lib if
host is Windows.
end-sanitize-v850
* c-valprint.c ch-valprint.c cp-valprint.c eval.c expprint.c
printcmd.c valops.c value.h values.c: Add bfd_section arg to
value_at and value_at_lazy.
* coffread.c dbxread.c elfread.c mdebugread.c minsyms.c symtab.h:
Add bfd_section arg to prim_record_minimal_symbol_and_info.
* corefile.c gdbcore.h printcmd.c valops.c: Use read_memory_section
instead of read_memory. It takes a bfd_section arg.
* coffread.c dbxread.c elfread.c gdb-stabs.h objfiles.h: Remove
unnecessary cast for assignment of struct dbx_symfile_info.
Struct objfile now uses a real pointer instead of PTR for this
element.
* dbxread.c (dbx_symfile_init): Stash bfd section pointers for
text, data and bss into dbx_symfile_info.
* exec.c (xfer_memory): Handle transfers for user-specified
sections.
* findvar.c (read_var_value locate_var_value): Copy bfd section
from the symbol to the value.
* gdb-stabs.h: Add section pointers for text, data and bss
sections.
* maint.c (translate address command): Add test code for overlay
address translation.
* printcmd.c (do_examine do_one_display): Now takes a bfd section
arg.
* (print_formatted x_command): Record current section along with
current address for repeated commands.
* sparc-nat.c (fetch_inferior_registers): Change
target_xfer_memory to target_{read write}_memory to allow changes
to target_xfer_memory interface for section info.
* symmisc.c (dump_msymbols print_symbol): Print section
assocaited with symbol.
* symtab.c (fixup_symbol_section): New routine to
add section info to symbols returned by lookup_symbol.
* symtab.h (struct general_symbol_info): Add bfd section to
symbols.
* target.c target.h (target_xfer_memory): Add bfd section to
args.
* (target_read_memory_section): New routine to read data from a
specific section.
* (target_memory_bfd_section): New global variable to pass bfd
section in to targets.
* valarith.c (value_add value_addr value_array): Preserve bfd
section when computing new value.
* value.h (struct value): Add bfd section to values.
* values.c (allocate_value value_copy): Initialize/preserve bfd
section.
* (unpack_double): Clean up _MSC_VER conditionals to remove
duplicate code.
start-sanitize-v850
* v850ice.c: New module to support communication with NEC's
PC-based ICE.
* config/v850/tm-v850.h (REGISTER_NAMES): Replace sp, gp, fp, and
ep names with rxx names. sp and fp are renamed via a different
mechanism.
end-sanitize-v850
* coffread.c (record_minimal_symbol): Don't presave name string
on symbol_obstack before passing to prim_record_minimal_symbol.
It now handles saving the string itself.
* dbxread.c (read_dbx_dynamic_symtab): Ditto.
* mipsread.c (read_alphacoff_dynamic_symtab): Ditto.
* os9kread.c (record_minimal_symbol): Ditto.
* solib.c (solib_add_common_symbols): Ditto.
* coffread.c (coff_symtab_read): Don't presave name string on
symbol_obstack before passing to prim_record_minimal_symbol_and_info.
It now handles saving the string itself.
* dbxread.c (record_minimal_symbol): Ditto.
* elfread.c (record_minimal_symbol_and_info): Ditto.
* dstread.c (record_minimal_symbol): Remove static function that just
called prim_record_minimal_symbol with the same args (after change to
prim_record_minimal_symbol to do it's own name string saves).
* nlmread.c (record_minimal_symbol): Ditto.
* somread.c (record_minimal_symbol): Ditto.
* hpread.c (hpread_read_enum_type): Save symbol name on symbol obstack.
(hpread_read_function_type): Ditto.
(hpread_process_one_debug_symbol): Ditto.
* mdebugread.c (parse_symbol): Ditto.
(new_symbol): Ditto.
* minsyms.c (prim_record_minimal_symbol_and_info): Ditto.
* coffread.c (process_coff_symbol): Use obsavestring to save
SYMBOL_NAME, rather than obstack_copy0.
* dstread.c (create_new_symbol): Ditto
* symfile.c (obconcat): Ditto.
* stabsread.c (patch_block_stabs): Ditto.
* xcoffread.c (SYMNAME_ALLOC): Ditto.
* symfile.c (obsavestring): Update comments
* solib.c (solib_add_common_symbols): Remove local var origname.
Add FUNCTION_START_OFFSET only if func_start is non-zero.
* minsyms.c (lookup_minimal_symbol_by_pc): Return NULL if
pc is not in a known section.
* stack.c (print_frame_info): Remove check for fi->pc in known
section, now handled by lookup_minimal_symbol_by_pc.
before testing against reg_ptr.
* eval.c (evaluate_subexp_standard): Cast type of
TYPE_FN_FIELD_VOFFSET to int.
* findvar.c (extract_signed_integer, extract_unsigned_integer,
extract_long_unsigned_integer): Cast type of sizeof to int.
* values.c (unpack_field_as_long, modify_field): Ditto.
* valops.c (value_assign, call_function_by_hand): Ditto.
* infcmd.c (do_registers_info): Ditto.
* ser-tcp.c (tcp_open): Ditto
* remote.c (putpkt): Ditto.
* dcache.c (dcache_peek): Ditto.
* dcache.c (dcache_poke): Ditto.
* m2-exp.y (yylex): Ditto.
* gnu-regex.c (re_match_2): Ditto.
* f-lang.c (ADD_BF_SYMNUM, saved_bf_list_end, tmp_bf_ptr): Ifdef
out unused macro definition and variables.
* inftarg.c (proc_wait): Move from main.c to here, and make static.
* valprint.c (val_print_string): Change bufsize from int to unsigned.
* main.c (wait.h): Include
* top.c (command_line_input): Remove unused variable "c".
* f-typeprint.c (f_type_print_varspec_prefix): Add missing enum
value TYPE_CODE_TYPEDEF to switch statement.
(f_type_print_varspec_suffix): Add missing enum value
TYPE_CODE_TYPEDEF to switch statement.
* ch-exp.c (parse_primval): Add remaining enumeration values to
switch statement, with no specific action.
(ch_lex): Add LOC_UNRESOLVED in switch statement.
(pushback_token): Ifdef out, since code using it is ifdef'd out.
* stabsread.c (cleanup_undefined_types): Remove unused label
"badtype".
* objfiles.h (print_symbol_bcache_statistics): Add prototype.
* maint.c (objfiles.h): Include.
(maintenance_print_statistics): Remove unused variable "temp".
* minsyms.c (lookup_minimal_symbol_solib_trampoline): Remove
unused variable "found_file_symbol".
* m2-exp.y (yylex): Add LOC_UNRESOLVED case to switch.
* language.c (lang_bool_type): Use existing function local type
variable rather than create block local variables.
* solib.c (disable_break): Enclose in ifndef SVR4_SHARED_LIBS.
* infptrace.c (wait.h, command.h): Include.
* ser-tcp.c (gdb_string.h): Include
* i386-tdep.c (codestream_seek): Change "place" to CORE_ADDR.
(i386_get_frame_setup): Change "pc" from int to CORE_ADDR.
* command.c (complete_on_enum): Make assignment used as truth value
explictly check against NULL.
(wait.h): Include.
* infrun.c (wait_for_inferior): Ifdef out prologue_pc since code
that uses it is ifdef'd out.
* parser-defs.h: Add prototype for write_dollar_variable.
* infrun.c: Add prototype for write_pc_pid.
* breakpoint.h: Add prototype for re_enable_breakpoints_in_shlibs.
* symmisc.c (bcache.h): Include.
* bcache.h: Add prototype for print_bcache_statistics.
* symfile.c: Include <time.h>.
* printcmd.c (print_scalar_formatted): Change len to unsigned int.
* valarith.c (value_equal): Cast result of TYPE_LENGTH to int.
* valarith.c (value_binop): Change result_len, promoted_len1,
and promoted_len2 to unsigned int.
* valarith.c (value_subscripted_rvalue): Change elt_offs and
elt_size to unsigned int.
* valops.c (value_array): Change typelength to unsigned int.
(destructor_name_p): Change len to unsigned int.
* scm-lang.h (scm_parse): Add prototype for scm_unpack.
* symfile.c (decrement_reading_symtab): Change return type to void.
* valarith.c (value_subscript): Remove unused variable "word".
(value_subscript): Remove unused variable "tint".
* valops.c (auto_abandon): Ifdef out, since code using it is also
ifdef'd out.
* eval.c (init_array_element): Remove unused variable "val".
* Makefile.in (values.o): Depends on scm-lang.h.
(command.o): Depends upon wait_h.
(ser-tcp.o): Depends upon gdb_string.h.
(infptrace.o): Depends upon wait_h and command_h.
(maint.o): Depends on objfiles.h and symfile.h.
* values.c (allocate_repeat_value): Remove unused variable
"element_type".
(scm-lang.h): Include.
* breakpoint.c (create_longjmp_breakpoint): Enclose in
GET_LONGJMP_TARGET define, unused otherwise.
* config/i386/nm-linux.h: Add prototypes for i386_insert_watchpoint,
i386_remove_watchpoint and i386_stopped_by_watchpoint.
All references changed.
* breakpoint.c (bpstat_what): Add shlib_event to the class types.
Update state table. Reformat so that it's still readable.
When we hit the shlib_event breakpoint, set the calss of shlib_event.
(breakpoint_1): Add "shlib events" as a breakpoint type.
Print the shlib_event breakpoint like other breakpoints.
(create_solib_event_breakpoint): New function.
(breakpoint_re_set_one): Handle solib_event breakpoints.
* breakpoint.h (enum bytype): Add bp_shlib_event breakpoint type.
(enum bpstat_what_main_action): Add BPSTAT_WHAT_CHECK_SHLIBS
action.
(create_solib_event_breakpoint): Declare.
* infrun.c (wait_for_inferior): Handle CHECK_SHLIBS bpstat.
(normal_stop): Inform the user when the inferior stoped due
to a shared library event.
(_initialize_infrun): Add new set/show variable "stop_on-solib-events"
to control whether or not gdb continues the inferior or stops it when
a shared library event occurs.
* minsyms.c (lookup_minimal_symbol_solib_trampoline): New function.
* somsolib.c (TODO list): Update.
(som_solib_create_inferior_hook): Arrange for gdb to be notified
when significant shared library events occur.
* hppa-tdep.c (find_unwind_entry): No longer static.
First cut at the machine independent changes for 7363. Also includes
code to automatically track shl_load/shl_unload calls on hpux.
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.
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".
for text symbol only.
* breakpoint.c (create_longjmp_breakpoint): call
lookup_minimal_symbol_text instead of lookup_minimal_symbol.
* symtab.h: add lookup_minimal_symbol_text prototype.
for Sun acc 3.0 under SunOS4.
Changes to improve handling of runtime common symbols
under SunOS4.
* minsyms.c (get_symbol_leading_char): New routine to determine
the leading symbol character for an objfile.
(prim_record_minimal_symbol_and_info, install_minimal_symbols):
Use it.
* objfiles.h (rt_common_objfile): New global, points to objfile
containing the runtime common minimal symbols.
* objfiles.c (free_objfile): Mark rt_common_objfile as
unallocated before freeing it.
* solib.c (allocate_rt_common_objfile): New routine to allocate
an objfile for the runtime common minimal symbols.
(solib_add_common_symbols): Allocate an objfile for the runtime
common symbols if necessary and put common symbols into it.
Clean up code and comments.
(solib_add, special_symbol_handling): Cleanup comments regarding
runtime common symbols.
* stabsread.c (scan_file_globals_1): New routine, contains
old scan_file_globals code. Checks if there are any unresolved
global symbols before starting the expensive minimal symbol table
search.
(scan_file_globals): Now calls scan_file_globals_1 for the passed
objfile and eventually for the runtime common objfile. Complains
about any unresolved global symbols and removes them from the
global symbol chain to avoid dangling pointers into the symbol
table if the symbol table is reread.
objfile not symfile_objfile.
* symtab.h, minsyms.c (minsyms_sort): New function.
* objfiles.c (objfile_relocate): Call it.
* remote-vx.c (vx_add_symbols): Call breakpoint_re_set.
* objfiles.c, objfiles.h (objfile_to_front): New function.
* remote-vx.c (vx_add_symbols): Call it.
* coffread.c (coff_symtab_read): Handle common symbols the same
way that partial-stab.h does.
are in the .plt section.
* minsyms.c (lookup_solib_trampoline_symbol_by_pc,
find_solib_trampoline_target): New functions for handling
stepping into -g compiled shared libraries.
* symtab.h (lookup_solib_trampoline_symbol_by_pc,
find_solib_trampoline_target): Add prototypes.
* config/tm-sunos.h (IN_SOLIB_TRAMPOLINE, SKIP_TRAMPOLINE_CODE):
Define to handle stepping into -g compiled shared libraries.
* config/tm-sysv4.h (SKIP_TRAMPOLINE_CODE): Define to handle
stepping into -g compiled shared libraries.
* configure.in: Add mips-*-sysv4* support.
* config/mips/mipsv4.mh, config/mips/mipsv4.mt,
config/mips/tm-mipsv4.h, config/mips/xm-mipsv4.h, mipsv4-nat.c:
New files for MIPS SVR4 support.
* Makefile.in: Update for new mipsv4 files.
* alpha-tdep.c (heuristic_proc_desc, find_proc_desc): Use
read_next_frame_reg to obtain the frame relative stack pointer.
* mips-tdep.c (heuristic_proc_desc): Use read_next_frame_reg to
obtain the frame relative stack pointer.
* mdebugread.c (parse_partial_symbols, psymtab_to_symtab1):
Handle stStatic and stStaticProc symbols in stabs-in-ecoff output
by entering them into the minimal symbol table.
* printcmd.c (print_scalar_formatted): Do not try to unpack to
a long for float formats.
* solib.c: Include "elf/mips.h" only if DT_MIPS_RLD_MAP does not
get defined in <link.h>.
* solib.c (solib_add): Add shared library sections to the section
table of the target before adding the symbols.
* partial-stab.h: Relocate static and global functions.
* dbxread.c (read_dbx_symtab): Remove unused variable
end_of_text_address. Relocate text_addr when passing it
to end_psymtab.
For Alpha OSF/1 targets, enable gdb to set breakpoints in shared
library functions before the executable is run. Retrieve dynamic
symbols from stripped executables.
* mipsread.c (read_alphacoff_dynamic_symtab): New function.
* mipsread.c (mipscoff_symfile_read): Use it. Issue warning message
if no debugging symbols were found.
* alpha-tdep.c (alpha_skip_prologue): Silently return the unaltered
pc if memory at the pc is not accessible and GDB_TARGET_HAS_SHARED_LIBS
is defined.
* config/alpha/nm-alpha.h (GDB_TARGET_HAS_SHARED_LIBS): Define,
OSF/1 has shared libraries.
* alpha-tdep.c: Gobs of changes (many imported from mips-tdep) to
improve remote debugging efficiency. Also fixed problems with
doing function calls for programs with no entry points.
* infcmd.c (run_stack_dummy): Use CALL_DUMMY_ADDRESS instead of
entry_point_address.
* inferior.h (PC_IN_CALL_DUMMY): ditto.
* mdebugread.c (parse_symbol, parse_procedure, parse_external,
parse_lines): Pass section_offsets info to these routines so that
we can relocate symbol table entries upon readin.
* (psymtab_to_symtab_1): Set symtab->primary to tell
objfile_relocate to do relocations for our symbols.
* (ecoff_relocate_efi): New routine to relocate adr field of PDRs
(which hang off of the symbol table).
* Use prim_record_minimal_symbols_and_info instead of
prim_record_minimal_symbols to supply section info to make minimal
symbol relocations work.
* minsyms.c (prim_record_minimal_symbols_and_info): If section is
-1, try to deduce it from ms_type.
* objfiles.c (objfile_relocate): Use ALL_OBJFILE_SYMTABS where
appropriate. Handle relocation of MIPS_EFI symbols special. Also,
add code to relocate objfile->sections data structure.
* remote.c (get_offsets): Use new protocol message to acquire
section offsets from the target.
* (remote_wait): Get rid of relocation stuff. That's all handled
by objfile_relocate now.
* config/alpha/alpha-nw.mt (TM_FILE): Use tm-alphanw.h.
* config/alpha/tm-alpha.h: Define CALL_DUMMY_ADDRESS, and
VM_MIN_ADDRESS.
* config/alpha/tm-alphanw.h: DECR_PC_AFTER_BREAK=0, VM_MIN_ADDRESS=0.
library functions before the executable is run. Retrieve dynamic
symbols from stripped executables.
* symtab.h (minimal_symbol_type): Add mst_solib_trampoline type.
* parse.c (write_exp_msymbol), symmisc.c (dump_msymbols),
symtab.c (list_symbols): Handle mst_solib_trampoline.
* minsyms.c (lookup_minimal_symbol): Handle mst_solib_trampoline
for all targets, remove IBM6000_TARGET dependencies.
* dbxread.c (read_dbx_dynamic_symtab): New function.
* dbxread.c (dbx_symfile_read): Use it.
* dbxread.c (SET_NAMESTRING): Set namestring to
"<bad string table index>" instead of "foo" if the string index is
corrupt.
* xcoffread.c (read_xcoff_symtab): Use mst_solib_trampoline instead
of mst_unknown.
* symtab.c (list_symbols): Take from_tty as parameter and pass it
to break_command. Handle mst_file_* minimal symbol types.
gone now.
* c-exp.y, ch-exp.y, core.c, corelow.c, eval.c, fork-child.c,
m2-exp.y, minsyms.c, nlmread.c, parse.c, putenv.c, regex.c
remote-utils.c, stabsread.c: Include <string.h>.
* regex.c: Include "defs.h", change re_comp argument to const char *.
* infptrace.c (fetch_register, store_inferior_registers): Change
regaddr to type CORE_ADDR.
* config/alpha/alpha-nw.mt, config/alpha/alpha-osf1.mt (MT_CFLAGS):
Remove, no longer necessary now that we use bfd_vma for a CORE_ADDR.
from here . . .
* symtab.h: . . . to here.
* dbxread.c (record_minimal_symbol): Move check for gcc{,2}_compiled.
and __gnu_compiled* from here . . .
* minsyms.c (prim_record_minimal_symbol_and_info): . . . to here.
* minsyms.c (prim_record_minimal_symbol): Call
prim_record_minimal_symbol_and_info rather than duplicating code.
consider there may be a file compiled without -g screwing things up
(e.g. we are looking for the minimal symbol for "main" and we get the
one for "start" instead).
This is the change I mean:
* minsyms.c, symtab.h (lookup_next_minimal_symbol): New function.
* dbxread.c (process_one_symbol): Use it.
* tm-sysv4.h (CPLUS_MARKER): By default, g++ uses '.' as the
CPLUS_MARKER for all SVR4 systems, so follow suit.
* defs.h (strdup_demangled): Remove prototype.
* dwarfread.c (enum_type, synthesize_typedef): Use new macro
SYMBOL_INIT_LANGUAGE_SPECIFIC.
* dwarfread.c (new_symbol): Use SYMBOL_INIT_DEMANGLED_NAME.
* minsyms.c (install_minimal_symbols, prim_record_minimal_symbol,
prim_record_minimal_symbol_and_info): Use new macro
SYMBOL_INIT_LANGUAGE_SPECIFIC.
* minsyms.c (install_minimal_symbols): Use new macro
SYMBOL_INIT_DEMANGLED_NAME.
* stabsread.c (define_symbol): Use new macro
SYMBOL_INIT_DEMANGLED_NAME.
* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list):
Use new macro SYMBOL_INIT_DEMANGLED_NAME.
* symfile.h (ADD_PSYMBOL_VT_TO_LIST): Use new macro
SYMBOL_INIT_DEMANGLED_NAME.
* symmisc.c (dump_msymbols, dump_symtab, print_partial_symbol):
SYMBOL_DEMANGLED_NAME now tests language itself.
* symtab.c (COMPLETION_LIST_ADD_SYMBOL): SYMBOL_DEMANGLED_NAME
now tests language itself.
* symtab.h (SYMBOL_CPLUS_DEMANGLED_NAME): New macro that does
what SYMBOL_DEMANGLED_NAME used to do, directly access the C++
mangled name member in the language dependent portion of a symbol.
* symtab.h (SYMBOL_DEMANGLED_NAME): New macro that returns the
mangled name member appropriate for a symbol's language.
* symtab.h (SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME,
SYMBOL_MATCHES_NAME, SYMBOL_MATCHES_REGEXP):
SYMBOL_DEMANGLED_NAME now tests language itself.
* symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC): New macro that
initializes language dependent portion of symbol.
* symtab.h (SYMBOL_INIT_DEMANGLED_NAME): New macro that
demangles and caches the demangled form of symbol names.
* utils.c (fputs_demangled, fprint_symbol): Use current language
to select an appropriate demangling algorithm.
* utils.c (strdup_demangled): Remove, no longer used.
**** start-sanitize-chill ****
* symtab.h (SYMBOL_CHILL_DEMANGLED_NAME): New macro that directly
access the Chill mangled name member in the language dependent
portion of a symbol.
* ch-lang.c (chill_demangle): New function, simple demangler.
* defs.h (chill_demangle): Add prototype.
* symtab.h (language_dependent_info): Add struct for Chill.
**** end-sanitize-chill ****
* defs.h (demangle_and_match): Remove prototype.
* dwarfread.c (STREQ, STREQN): Remove macros, replaced with STREQ
and STREQN defined in defs.h.
* dwarfread.c (set_cu_language): For completely unknown languages,
try to deduce the language from the filename. Retain behavior
that for known languages we don't know how to handle, we use
language_unknown.
* dwarfread.c (enum_type, symthesize_typedef): Initialize language
and demangled name fields in symbol.
* dwarfread.c, mipsread.c, partial-stab.h: For all usages of
ADD_PSYMBOL_TO_LIST, add language and objfile parameters.
* dwarfread.c (new_symbol): Attempt to demangle C++ symbol names
and cache the results in SYMBOL_DEMANGLED_NAME for the symbol.
* elfread.c (STREQ): Remove macro, use STREQ defined in defs.h.
Replace usages throughout.
* elfread.c (demangle.h): Include.
* elfread.c (record_minimal_symbol): Remove prototype and function.
* gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES,
B_CLRALL): Moved from symtab.h to gdbtypes.h.
* infcmd.c (jump_command): Remove code to demangle name and add
it to a cleanup list. Now just use SYMBOL_DEMANGLED_NAME.
* minsyms.c (demangle.h): Include.
* minsyms.c (lookup_minimal_symbol): Indent comment to match code.
* minsyms.c (install_minimal_symbols): Attempt to demangle symbol
names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME.
* mipsread.c (psymtab_language): Add static variable.
* stabsread.c (demangle.h): Include.
* stabsread.c (define_symbol): Attempt to demangle C++ symbol
names and cache them in the SYMBOL_DEMANGLED_NAME field.
* stack.c (return_command): Remove explicit demangling of name
and use of cleanups. Just use SYMBOL_DEMANGLED_NAME.
* symfile.c (demangle.h): Include.
* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list): Fix
to match macros in symfile.h and allow them to be compiled
if INLINE_ADD_PSYMBOL is not true.
* symfile.h (INLINE_ADD_PSYMBOL): Default to true if not set.
* symfile.h (ADD_PSYMBOL_*): Add language and objfile parameters.
Add code to demangle and cache C++ symbol names. Use macro form
if INLINE_ADD_PSYMBOL is true, otherwise use C function form.
* symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list):
Remove, also defined in symfile.c, which we already fixed.
* symtab.c (expensive_mangler): Remove prototype and function.
* symtab.c (find_methods): Remove physnames parameter and fix
prototype to match.
* symtab.c (completion_list_add_symbol): Name changed to
completion_list_add_name.
* symtab.c (COMPLETION_LIST_ADD_SYMBOL): New macro, adds both
the normal symbol name and the cached C++ demangled name.
* symtab.c (lookup_demangled_partial_symbol,
lookup_demangled_block_symbol): Remove prototypes and functions.
* symtab.c (lookup_symbol): Remove use of expensive_mangler,
use lookup_block_symbol instead of lookup_demangled_block_symbol.
Remove code to try demangling names and matching them.
* symtab.c (lookup_partial_symbol, lookup_block_symbol):
Fix to try matching the cached demangled name if no match is
found using the regular symbol name.
* symtab.c (find_methods): Remove unused physnames array.
* symtab.c (name_match, NAME_MATCH): Remove function and macro,
replaced with SYMBOL_MATCHES_REGEXP from symtab.h.
* symtab.c (completion_list_add_symbol): Rewrite to use cached
C++ demangled symbol names.
* symtab.h: Much reformatting of structures and such to add
whitespace to make them more readable, and make them more
consistent with other gdb structure definitions.
* symtab.h (general_symbol_info): New struct containing fields
common to all symbols.
* symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME,
SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME,
SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE): New macros.
* symtab. (struct minimal_symbol, struct partial_symbol, struct
symbol): Use general_symbol_info struct.
* utils.c (demangle_and_match): Remove, no longer used.
* valops.c (demangle.h): Include.
* xcoffexec.c (eq): Remove macro, replace usages with STREQ.
* blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c,
infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c,
symmisc.c, symtab.c, valops.c: Replace references to minimal
symbol fields with appropriate macros.
* breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c,
coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c,
demangle.c, elfread.c, energize.c, environ.c, exec.c,
gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c,
main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c,
remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c,
sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c,
symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h,
tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c: Replace strcmp
and strncmp usages with STREQ, STREQN, or STRCMP as appropriate.
* breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c,
mipsread.c, printcmd.c, source.c, stabsread.c, stack.c,
symmisc.c, tm-29k.h, valops.c, values.c: Replace SYMBOL_NAME
references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as
appropriate.
* buildsym.c (start_subfile, patch_subfile_names): Default the
source language to what can be deduced from the filename.
* buildsym.c (end_symtab): Update the source language in the
allocated symtab to match what we have been using.
* buildsym.h (struct subfile): Add a language field.
* c-typeprint.c (c_print_type): Remove code to do explicit
demangling.
* dbxread.c (psymtab_language): Add static variable.
* dbxread.c (start_psymtab): Initialize psymtab_language using
deduce_language_from_filename.
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.
* minsyms.c (lookup_minimal_symbol_by_pc): subtract 1, not 2, from
minimal_symbol_count, because the NULL symbol is not included in
the count. This prevented this function from finding the last
symbol in the table.
* buildsym.c (read_sun_builtin_type, read_sun_floating_type): New.
(define_symbol): Skip arg types in function entries. Resolve
overloaded 'P' which acc uses for prototypes of functions called
by this file.
(read_type: 'b', 'r'): Handle Solaris2 builtin types.
* minsyms.c (prim_record_minimal_symbol_and_info): Hack to
save size of ELF symbols. FIXME.
* tm-sun4os5.h: Rename to tm-sun4sol2.h. Update defines for Sol2.
* xm-sun4os5.h: Rename to xm-sun4sol2.h. Hack more defines.
* config/sun4os5.m[ht]: Rename to config/sun4sol2.m[ht]; new xm, tm.
basis. See comments in objfiles.h and details in ChangeLog. Also remove
redundant definitions of FRAME_CHAIN_VALID from most of the tm-* files and
use a default definition in frame.h.
* All GDB files that #include defs.h: Removed stdio.h.
(defs.h): #include stdio.h.
This has been tested by building GDBs for all targets hosted on Sun4.
None of the build problems were related to stdio.h inclusion. (n.b.
many configurations don't build for other reasons.)
* minsyms.c (install_minimal_symbols): Add bunches to any
existing minsyms in the objfile. Avoid extra mallocation
by working directly in the obstack. Remove ignored `mainline' parm.
* coffread.c, dbxread.c, elfread.c, mipsread.c, solib.c, symtab.h,
xcoffread.c: Change all callers.
* FIXME: We should be able to eliminate MAINLINE from all the
symbol readers now, with a small bit of work.
* valops.c, value.h: Lint.
* remote-vx.c: Add missing break; statement. Bugfix by
Michael Sclafani, <sclafani@src.dec.com>.