* symtab.c (symbol_init_language_specific): New function.
* symtab.h (SYMBOL_INIT_LANGUAGE_SPECIFIC): Simplify macro, by
turning most of it into a function.
(symbol_init_language_specific): Export.
current_source_line static.
(list_command): Moved to cli/cli-cmds.c.
(ambiguous_line_spec): Moved to cli/cli-cmds.c.
(get_first_line_listed): New accessor function.
(get_lines_to_list): New accessor function.
(get_current_source_symtab_and_line): New function. Retrieves the
position in the source code that we consider current.
(get_current_or_default_source_symtab_and_line): New function.
Like the above but attempts to determine a default position if one
is not currently defined.
(set_current_source_symtab_and_line): New function. Sets the source
code position considered current and returns the previously set one.
(clear_current_source_symtab_and_line): Reset stored information about
a current source line.
(_initialize_source): Remove registration for the "list" command and
its alias.
* source.h: Add declarations for the new functions above.
* symtab.h: Remove declarations for the global variables mentioned
above.
* breakpoint.c (parse_breakpoint_sals): Use accessor functions to
obtain current source line.
* linespec.c (decode_line_1): Ditto.
* macroscope.c (default_macro_scope): Ditto.
* scm-lang.c (scm_unpac): Ditto.
* stack.c (print_frame_info_base): Ditto.
* symfile.c (clear_symtab_users): Ditto.
* symtab.c (decode_line_spec): Ditto.
* cli/cli-cmds.c (list_command): Moved here from source.c.
(ambiguous_line_spec): Moved here from source.c.
(_init_cli_cmds): Add definition for "list" and its alias.
* Makefile.in: Update dependencies.
minimal symbol of an appropriate name and use its address to
select a symtab to read and search, use `name' (as passed to us)
as the demangled name when searching the symtab's global and
static blocks, not the minsym's name.
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.
* symtab.c (remove_params): New function.
(make_symbol_overload_list): Use it instead of cplus_demangle.
(overload_list_add_symbol): Likewise. Reorder. Fix memory leak.
* stack.c (get_selected_block): Add new argument `addr_in_block',
used to return the exact code address we used to select the block,
not just the block.
* blockframe.c (get_frame_block, get_current_block): Same.
* frame.h (get_frame_block, get_current_block,
get_selected_block): Update declarations.
* linespec.c, stack.c, blockframe.c, breakpoint.c, findvar.c,
linespec.c, varobj.c, printcmd.c, symtab.c: Callers changed.
gdb/mi/ChangeLog:
* mi-cmd-stack.c (list_args_or_locals): Pass new arg to
get_frame_block. (See entry in gdb/ChangeLog.)
a function; leave this macro here to invoke that function.
(symbol_init_mangled_name): Declaration for that function.
* symtab.c (symbol_init_mangled_name): New function.
* symtab.h (lookup_block_symbol): Add mangled_name argument
to prototype.
* symmisc.c (maintenance_check_symtabs): Call lookup_block_symbol
with new mangled_name argument.
* linespec.c (decode_line_1): Likewise.
* valops (value_of_this): Likewise.
* symtab.c (lookup_transparent_type): Likewise.
(lookup_symbol_aux): Likewise. Accept new mangled_name argument.
(lookup_symbol): If we are given a mangled name, pass it down
to lookup_symbol_aux.
(lookup_block_symbol): If we are given a mangled name to check
against, only return symbols which match it.
2002-02-21 Fred Fish <fnf@redhat.com>
* dbxread.c (process_one_symbol): When finding an N_FUN symbol
that marks the end of the range of a function, enter a line number
entry that has a line number of zero and a PC offset that matches
the end of the function. This starts a range of PC's for which no
line number information is known.
* symtab.c (find_pc_sect_line): If our best fit is in a range of
PC's for which no line number info is found (line number is zero)
then we didn't find any valid line information.
* symtab.h: Document use of zero line number entry.
* symtab.c (compare_search_syms): New function.
(sort_search_symbols): New function.
(search_symbols): Sort symbols after searching rather than
before.
2002-02-10 Daniel Jacobowitz <drow@mvista.com>
* generic/gdbtk-cmds.c (gdb_listfuncs): Don't call
BLOCK_SHOULD_SORT.
* library/browserwin.itb (BrowserWin::_fill_funcs_combo): Sort
the output of gdb_listfuncs.
* symtab.c (find_pc_sect_psymtab): Do not search psymtabs for
data symbols, since we search based on textlow and texthigh.
(find_pc_sect_symtab): Likewise.
* configure.in: Check for realpath.
* defs.h (gdb_realpath): Declare.
* symtab.h (partial_symtab): Added fullname field.
* source.c (openp): Use gdb_realpath.
(forget_cached_source_info): Clear full name of each partial
symtab.
* utils.c (gdb_realpath): New function.
* symtab.c (lookup_symtab): Removed.
(lookup_symtab_1): Renamed to lookup_symtab.
(lookup_symtab): Look for real path.
(lookup_partial_symtab): Likewise.
* symtab.c (find_pc_sect_line): If we can't find the function
containing PC, we certainly won't have line number information for
that location, so return zero immediately.
* symtab.c (operator_chars): Allow '*' and '[' to be quoted in
operator names, to avoid regexp expansion.
(search_symbols): Alloca buffer is too small, may get clobbered.
(line_completion_function): If we are completing on locations,
back up the start of word pointer past all characters which can
appear in a location spec.
(location_completer): New function.
* completer.h: Add prototype for location_completer.
* symtab.c (make_source_files_completion_list)
(add_filename_to_list, not_interesting_fname): New functions.
(filename_seen): New function, body extracted from
output_source_filename.
(output_source_filename): Call filename_seen to check if the file
was already printed.
(make_symbol_completion_list): If TEXT includes a
double-quoted string, return an empty list, not NULL.
(make_file_symbol_completion_list): New function, similar to
make_symbol_completion_list but with an additional argument
SRCFILE.
* symtab.h (make_file_symbol_completion_list)
(make_source_files_completion_list): Add prototypes.
* breakpoint.c (_initialize_breakpoint): Make location_completer
be the completion function for all commands which set breakpoints
and watchpoints.
(top-level): #include "completer.h".
* tracepoint.c (_initialize_tracepoint): Make location_completer
be the completion function for the "trace" command.
(top-level): #include "completer.h".
* printcmd.c (_initialize_printcmd): Make location_completer be
the completion function for the "print", "inspect", "call", and
"disassemble" commands.
(top-level): #include "completer.h".
* infcmd.c (_initialize_infcmd): Make location_completer be the
completion function for the "go", "jump", and "until" commands.
(top-level): #include "completer.h".
basename (NAME). The FreeBSD basename returns a pointer to a
static buffer, even if it's simply returning a string identical to
its argument.
(lookup_partial_symtab): Likewise.
instead of non-portable search for `/'. Use FILENAME_CMP instead
of STREQ, to account for case-insensitive filesystems.
(top-level): #include "filenames.h".
Abstract out operations specific to particular C++ ABI's, and
invoke them through a function table. This removes the C++ ABI
dependencies scattered throughout the code, and allows us to
cleanly add support for new C++ ABI's.
* cp-abi.h, cp-abi.h, gnu-v2-abi.c, hpacc-abi.c: New files.
* c-typeprint.c, c-valprint.c, dbxread.c, eval.c, gdbtypes.c,
jv-typeprint.c, linespec.c, symtab.c, typeprint.c, valops.c:
#include "cp-abi.h". These files all use functions now declared
there.
* symtab.h (OPNAME_PREFIX_P, VTBL_PREFIX_P, DESTRUCTOR_PREFIX_P):
Deleted. These services are now provided by functions declared in
cp-abi.h.
* value.h (value_rtti_type, value_virtual_fn_field): Same.
* values.c (value_virtual_fn_field): Same, for this definition.
* valops.c (value_rtti_type): Same.
* c-typeprint.c (c_type_print_base): Use the functions from
"cp-abi.h", instead of the old macros, or hard-coded ABI-specific
tests.
* dbxread.c (record_minimal_symbol): Same.
* gdbtypes.c (get_destructor_fn_field, virtual_base_index,
virtual_base_index_skip_primaries): Same.
* jv-typeprint.c (java_type_print_base): Same.
* linespec.c (find_methods, decode_line_1): Same.
* symtab.c (gdb_mangle_name): Same.
* Makefile.in (SFILES): Add the new .c files mentioned above.
(cp_abi_h): New variable.
(COMMON_OBS): Add gnu-v2-abi.o, hpacc-abi.o, and cp-abi.o.
(cp-abi.o, gnu-v2-abi.o, hpacc-abi.o): New targets.
(c-typeprint.o, c-valprint.o, dbxread.o, eval.o, gdbtypes.o,
jv-typeprint.o, symtab.o, linespec.o, typeprint.o, valops.o): Add
dependency on $(cp_abi_h).
From Peter Schauer <Peter.Schauer@regent.e-technik.tu-muenchen.de>
* symtab.c (lookup_symbol_aux): Call lookup_symbol_aux, not
lookup_symbol, when trying to find a symbol with a mangled name,
to avoid infinite recursion.
a mangled symbol rather than recursing into lookup_symbol, since
this will just re-unmangle the name & call lookup_symbol_aux -
leading to an infinite recursion.
* linespec.h: New file. Declarations for linespec.c.
* linespec.c, alpha-tdep.c, breakpoint.c, parse.c, source.c,
symtab.c, tracepoint.c: Include the above.
* completer.c: New file. Line completion stuff for GDB.
(get_gdb_completer_word_break_characters,
get_gdb_completer_quote_characters): New functions. Accessors for
useful completer internal data.
(filename_completer, line_completion_function, skip_quoted): Moved
here from top.c.
* completer.h: New file. Declarations for the above.
* linespec.c (decode_line_1): Use
get_gdb_completer_word_break_characters and
get_gdb_completer_quote_characters.
* top.c: Include completer.h.
(filename_completer, line_completion_function, skip_quoted):
Moved to completer.c.
* corefile.c, exec.c, source.c, symfile.c, linespec.c: Include
completer.h.
* Makefile.in (SFILES): Add completer.c.
(COMMON_OBS): Add completer.o.
(completer.o): New target.
(linespec.o, alpha-tdep.o, breakpoint.o, parse.o, source.o,
symtab.o, tracepoint.o): Add linespec.h to dependencies list.
(corefile.o, exec.o, source.o, symfile.o, linespec.o): Add completer.h
to dependencies list.
(sources_info): Replace use of no_symtab_msg with the string
itself.
* linespec.c (no_symtab_msg): Remove declaration.
(decode_line_1): Replace uses of no_symtab_msg with the string
itself.
From Daniel Berlin <dberlin@redhat.com> :
* symtab.h (SYMBOL_INIT_DEMANGLED_NAME): Initialize the symbol
language to auto instead of unknown, so it will try to demangle
the symbol.
* symtab.h (OPNAME_PREFIX_P): Change operator prefix to correct value.
* symtab.c (gdb_mangle_name): Properly handle C++ operators.
From Daniel Berlin <dberlin@redhat.com> :
* symtab.c (lookup_symbol_aux): New function. Renamed from
lookup_symbol. Move code to do demangling/case sensitivity to
lookup_symbol().
(lookup_symbol): Now wrapper for lookup_symbol_aux, so we can
perform case sensitivity/demangling without leaking memory. Move
code to do demangling/case sensitivity from old_lookup_symbol to
here.
(lookup_partial_symbol): Use SYMBOL_SOURCE_NAME instead of
SYMBOL_NAME.
(lookup_block_symbol): Use SYMBOL_SOURCE_NAME instead of
SYMBOL_NAME. Don't do linear search in case of C++.
* symfile.c (compare_symbols): Use SYMBOL_SOURCE_NAME instead of
SYMBOL_NAME.
(compare_psymbols): Same here.
* c-typeprint.c (c_typedef_print): remove (replaced by typedef_print in
typeprint.c).
* typeprint.c (typedef_print): new function. (old c_typedef_print
function with pascal language support added).
* value.h (c_printdef_print): removed.
(typedef_print): declare.
* symtab.c (print_symbol_info): call to c_typedef_print replaced by
call to typedef_print.
* symtab.c (search_symbols): Fix off by one error in index for
initializing variables ourtype, ourtype2, ourtype3, and ourtype4.
(symtab_symbol_info): fix similar off by one error.
Fri Aug 25 12:03:15 2000 David Taylor <taylor@texas.cygnus.com>
* gdbarch.sh (TARGET_ADDR_BIT): New macro for the number
of bits in gdb's representation of a target address.
* gdbarch.c, gdbarch.h: Regenerated.
* gdbtypes.c (build_gdbtypes): Use TARGET_ADDR_BIT instead of
TARGET_PTR_BIT when initializing builtin_type_CORE_ADDR.
* printcmd.c (print_address_numeric): Use TARGET_ADDR_BIT instead
of TARGET_PTR_BIT, because we're printing an address, not a pointer.
* c-lang.c: Set case sensitivity on for c_language_defn,
cplus_language_defn, and asm_language_defn.
* ch-lang.c: Set case sensitivity on for chill_language_defn.
* f-lang.c: Set case sensivitity off for f_language_defn.
* jv-lang.c: Set case sensitivity on for java_language_defn.
* language.h: Add enum case_mode, case_sensitivity.
* language.c: Define case_mode, case_sensitivity. Set case
sensitivity on for unknown_language_defn, auto_language_defn,
and local_language_defn.
(show_case_command,set_case_command,set_case_str): New static func.
(set_type_range_case): New static func, replaces set_type_range ().
(set_language_command,set_type_command,set_range_command,set_language):
Call set_type_range_case ().
(language_info): Print case sensitivity setting.
(_initialize_language): Add set/show commands for 'case-sensitive'.
Set default case mode 'auto'. Set default language 'auto'.
* m2-lang.c: Set case sensitivity on for m2_language_defn.
* p-lang.c: Set case sensitivity on for pascal_language_defn.
* scm-lang.c: Set case sensitivity off for scm_language_defn.
* symtab.c (lookup_symbol): Downcase symbol name if case sensivitity
is off.
* bcache.h, bcache.c, c-valprint.c, coffread.c, stabsread.c,
stack.c, valprint.c: Change variables to unsigned.
* bcache.c: Rearrange to avoid warnings about variables not being set.
* c-lang.c, ch-lang.c, f-lang.c, m2-lang.c: Include valprint.h
rather than declaring print_max and repeat_count_threashold
ourselves (incorrectly).
* valprint.h: Do declare repeat_count_threashold.
* ch-exp.c: Use default case for internal error.
* findvar.c: Don't omit argument type.
* symtab.c: Remove unused variable.
bility of multiple symbols at the same address when finding high.
* breakpoint.c (resolve_sal_pc): if the function based section lookup
fails, try getting the section from the minimal symbol table.
* parse.c (write_exp_msymbol): use symbol_overlayed_address to get
the LMA of a minimal symbol if unmapped.
* symtab.c (find_line_symtab): change interface to return symtab
containing the best linetable found.
(decode_line_1): use find_line_symtab to set val.symtab. This should
improve support for source files with multiple symtabs.
* tm-txvu.h: include tm-mips64.h instead of starting from scratch.
TYPES_NAMESPACE, METHODS_NAMESPACE, and VARIABLES_NAMESPACE used by
new search_symbols.
Add prototype for search_symbols and free_search_symbols.
* symtab.c (list_symbols): Rewrite to use new search_symbols.
(file_matches): New helper function for search_symbols.
(free_search_symbols): New function which frees data returned from
search_symbols.
(print_symbol_info): New helper function which prints info about a
matched symbol to stdout. Extracted from old list_symbols.
(print_msymbol_info): New helper function which prints info about
a matched msymbol to stdout. Extracted from old list_symbols.
(symtab_symbol_info): Extracted from old list_symbols.
(variables_info): Use symtab_symbol_info.
(functions_info): Use symtab_symbol_info.
(types_info): Use symtab_symbol_info.
(rbreak_command): Rewrite to use new search_symbols.
* gdbtk.c: Change all references to static global "interp" to
"gdbtk_interp" and export this global.
(gdbtk_init): If gdbtk_source_filename is not NULL, source this file
into the interpreter when it goes idle.
Add new command "gdb_search".
(gdb_search): New function which searches the symbol table.
(gdbtk_test): New function called by main when the --tclcommand
option is used.
* main.c (main): Add a new option "--tclcommand" which is used
by the testsuite to source a file into the interpreter when it
goes idle.
(TARGET_READ_FP): Define to d10v_read_fp rather than d10v_read_sp.
(TARGET_WRITE_FP): Define to d10v_write_fp rather than d10v_write_sp.
(d10v_write_fp, d10v_read_fp): Add prototypes.
* symtab.c (decode_line_1): Remove assignment of sals[0].pc field.
* symfile.c (simple_overlay_update, simple_overlay_update_1):
Ignore the size of overlay sections. This check is redundant anyway.
* printcmd.c (print_frame_args): Ditto.
* valops.c (value_fetch_lazy): Ditto.
* values.c (unpack_long): Ditto.
* d10v-tdep.c (d10v_frame_chain, d10v_frame_find_saved_regs,
d10v_init_extra_frame_info): Fix some minor bugs so the finish command
works properly.
(show_regs): Change num1 and num2 types from "long long" to "LONGEST".
(d10v_read_fp, d10v_write_fp): New functions.
(d10v_push_arguments): Remove unneeded assigns to "val" and "contents".
(d10v_push_arguments): Fix for pointers and structs.
(d10v_extract_return_value): Fix for pointers and chars.
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.
* gdbtk.c (gdb_get_breakpoint_info): Add string for new
enumeration del_at_next_stop to bpdisp array.
end-sanitize-gdbtk
* eval.c (evaluate_subexp_for_sizeof): Handle dereferencing
of non-pointer values.
* symtab.c (gdb_mangle_name): Improve mangling of nested types,
their physical names already include the class name.
* valops.c (value_cast): Handle upcast of a class pointer.
From Andreas Schwab (schwab@issan.informatik.uni-dortmund.de):
* corelow.c (get_core_registers): Make secname big enough.
(DONT_RELOCATE_SYMFILE_OBJFILE): Removed.
* xcoffsolib.h (struct vmap): Add new members tvma, toffs and dvma,
remove tadj.
* exec.c (bfdsec_to_vmap): Initialize new vmap members, initialize
tstart and dstart with section VMA.
* rs6000-nat.c (vmap_symtab): Relocate relative to the VMA in the
object file.
(vmap_ldinfo, xcoff_relocate_core): Adjust tstart by section offset
of the text section, remove DONT_RELOCATE_SYMFILE_OBJFILE hack.
(vmap_exec): Relocate relative to the VMA in the object file,
relocate .bss section as well.
(xcoff_relocate_core): No longer adjust section addresses by VMA.
* rs6000-tdep.c (find_toc_address): Change type of tocbase
to CORE_ADDR.
* xcoffread.c (secnum_to_bfd_section): New routine to get
BFD section from CS section number.
(scan_xcoff_symtab): Make toc_offset section relative.
* symtab.c (total_number_of_methods): Avoid core dump if
baseclass type is still undefined.
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