Commit Graph

358 Commits

Author SHA1 Message Date
Tom Tromey 41bf6acad7 replace XZALLOC with XCNEW
This replaces XZALLOC with XCNEW and removes XZALLOC.
This change is purely mechanical.

2014-01-13  Tom Tromey  <tromey@redhat.com>

	* defs.h (XZALLOC): Remove.
	* ada-lang.c (get_ada_inferior_data): Use XCNEW, not XZALLOC.
	* ada-tasks.c (get_ada_tasks_pspace_data): Likewise.
	(get_ada_tasks_inferior_data): Likewise.
	* auto-load.c (get_auto_load_pspace_data): Likewise.
	* auxv.c (get_auxv_inferior_data): Likewise.
	* bfd-target.c (target_bfd_reopen): Likewise.
	* breakpoint.c (get_catch_syscall_inferior_data): Likewise.
	(deprecated_insert_raw_breakpoint): Likewise.
	* bsd-uthread.c (bsd_uthread_pid_to_str): Likewise.
	* corelow.c (core_open): Likewise.
	* darwin-nat.c (darwin_check_new_threads): Likewise.
	(darwin_attach_pid): Likewise.
	* dummy-frame.c (dummy_frame_push): Likewise.
	* dwarf2-frame.c (dwarf2_frame_cache): Likewise.
	* dwarf2loc.c (allocate_piece_closure): Likewise.
	* elfread.c (elf_symfile_segments): Likewise.
	* eval.c (ptrmath_type_p): Likewise.
	* exceptions.c (EXCEPTIONS_SIGJMP_BUF): Likewise.
	* gdbtypes.c (alloc_type_arch): Likewise.
	(alloc_type_instance): Likewise.
	* hppa-tdep.c (hppa_gdbarch_init): Likewise.
	* inf-child.c (inf_child_can_use_agent): Likewise.
	* inflow.c (get_inflow_inferior_data): Likewise.
	* infrun.c (save_infcall_suspend_state): Likewise.
	* jit.c (jit_reader_load): Likewise.
	(get_jit_objfile_data): Likewise.
	(get_jit_program_space_data): Likewise.
	(jit_object_open_impl): Likewise.
	(jit_symtab_open_impl): Likewise.
	(jit_block_open_impl): Likewise.
	(jit_frame_sniffer): Likewise.
	* linux-fork.c (add_fork): Likewise.
	* maint.c (make_command_stats_cleanup): Likewise.
	* objfiles.c (get_objfile_pspace_data): Likewise.
	* opencl-lang.c (struct lval_closure): Likewise.
	* osdata.c (osdata_start_osdata): Likewise.
	* progspace.c (new_address_space): Likewise.
	(add_program_space): Likewise.
	* remote-sim.c (get_sim_inferior_data): Likewise.
	* sh-tdep.c (sh_gdbarch_init): Likewise.
	* skip.c (Ignore): Likewise.
	(skip_delete_command): Likewise.
	* solib-aix.c (get_solib_aix_inferior_data): Likewise.
	(library_list_start_library): Likewise.
	(solib_aix_current_sos): Likewise.
	* solib-darwin.c (get_darwin_info): Likewise.
	(darwin_current_sos): Likewise.
	* solib-dsbt.c (get_dsbt_info): Likewise.
	* solib-ia64-hpux.c (new_so_list): Likewise.
	(ia64_hpux_get_solib_linkage_addr): Likewise.
	* solib-spu.c (append_ocl_sos): Likewise.
	(spu_current_sos): Likewise.
	* solib-svr4.c (get_svr4_info): Likewise.
	(svr4_keep_data_in_core): Likewise.
	(library_list_start_library): Likewise.
	(svr4_default_sos): Likewise.
	(svr4_read_so_list): Likewise.
	* solib-target.c (library_list_start_library): Likewise.
	(solib_target_current_sos): Likewise.
	* sparc-tdep.c (sparc32_gdbarch_init): Likewise.
	* symfile-debug.c (install_symfile_debug_logging): Likewise.
	* symfile.c (default_symfile_segments): Likewise.
	* target-descriptions.c (tdesc_data_init): Likewise.
	(tdesc_create_reg): Likewise.
	(struct tdesc_type *): Likewise.
	(tdesc_create_vector): Likewise.
	(tdesc_set_struct_size): Likewise.
	(struct tdesc_type *): Likewise.
	(tdesc_free_feature): Likewise.
	(tdesc_create_feature): Likewise.
	* windows-nat.c (windows_add_thread): Likewise.
	(windows_make_so): Likewise.
	* xml-support.c (gdb_xml_body_text): Likewise.
	(gdb_xml_create_parser_and_cleanup): Likewise.
	(xml_process_xincludes): Likewise.
	* xml-syscall.c (allocate_syscalls_info): Likewise.
	(syscall_create_syscall_desc): Likewise.
2014-01-13 07:31:27 -07:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Tom Tromey 37fbcad0be remove some sym_probe_fns methods
While looking into the probe API, it seemed to me that there were a
number of methods in sym_probe_fns that were not needed.  This patch
removes them.

Specifically, it seems to me that sym_probe_fns ought to be concerned
with the API for constructing the probes.  Any method relating to some
aspect of an individual probe can be handled via the probe's own
vtable.  That is, the double indirection here doesn't seem useful --
it certainly isn't in fact used, but also I couldn't think of a
potential use.

2013-12-06  Tom Tromey  <tromey@redhat.com>

	* break-catch-throw.c (fetch_probe_arguments): Use
	get_probe_argument_count and evaluate_probe_argument.
	* elfread.c (elf_get_probe_argument_count)
	(elf_can_evaluate_probe_arguments, elf_evaluate_probe_argument)
	(elf_compile_to_ax): Remove.
	(elf_probe_fns): Update.
	* probe.c (get_probe_argument_count, can_evaluate_probe_arguments)
	(evaluate_probe_argument): Call method on probe, not via sym
	functions.
	* stap-probe.c (compute_probe_arg): Use get_probe_argument_count,
	evaluate_probe_argument.
	(compile_probe_arg): Use get_probe_argument_count.  Call method on
	probe, not via sym functions.
	* symfile-debug.c (debug_sym_get_probe_argument_count)
	(debug_can_evaluate_probe_arguments)
	(debug_sym_evaluate_probe_argument, debug_sym_compile_to_ax):
	Remove.
	(debug_sym_probe_fns): Remove.
	* symfile.h (struct sym_probe_fns) <sym_get_probe_argument_count,
	can_evaluate_probe_arguments, sym_evaluate_probe_argument,
	sym_compile_to_ax>: Remove fields.
2013-12-06 08:57:55 -07:00
Tom Tromey 0e9f083f4c remove gdb_string.h
This removes gdb_string.h.  This patch is purely mechanical.  I
created it by running the two commands:

    git rm common/gdb_string.h
    perl -pi -e's/"gdb_string.h"/<string.h>/;'  *.[chyl] */*.[chyl]

2013-11-18  Tom Tromey  <tromey@redhat.com>

	* common/gdb_string.h: Remove.
	* aarch64-tdep.c: Use string.h, not gdb_string.h.
	* ada-exp.y: Use string.h, not gdb_string.h.
	* ada-lang.c: Use string.h, not gdb_string.h.
	* ada-lex.l: Use string.h, not gdb_string.h.
	* ada-typeprint.c: Use string.h, not gdb_string.h.
	* ada-valprint.c: Use string.h, not gdb_string.h.
	* aix-thread.c: Use string.h, not gdb_string.h.
	* alpha-linux-tdep.c: Use string.h, not gdb_string.h.
	* alpha-mdebug-tdep.c: Use string.h, not gdb_string.h.
	* alpha-nat.c: Use string.h, not gdb_string.h.
	* alpha-osf1-tdep.c: Use string.h, not gdb_string.h.
	* alpha-tdep.c: Use string.h, not gdb_string.h.
	* alphanbsd-tdep.c: Use string.h, not gdb_string.h.
	* amd64-dicos-tdep.c: Use string.h, not gdb_string.h.
	* amd64-linux-nat.c: Use string.h, not gdb_string.h.
	* amd64-linux-tdep.c: Use string.h, not gdb_string.h.
	* amd64-nat.c: Use string.h, not gdb_string.h.
	* amd64-sol2-tdep.c: Use string.h, not gdb_string.h.
	* amd64fbsd-tdep.c: Use string.h, not gdb_string.h.
	* amd64obsd-tdep.c: Use string.h, not gdb_string.h.
	* arch-utils.c: Use string.h, not gdb_string.h.
	* arm-linux-nat.c: Use string.h, not gdb_string.h.
	* arm-linux-tdep.c: Use string.h, not gdb_string.h.
	* arm-tdep.c: Use string.h, not gdb_string.h.
	* arm-wince-tdep.c: Use string.h, not gdb_string.h.
	* armbsd-tdep.c: Use string.h, not gdb_string.h.
	* armnbsd-nat.c: Use string.h, not gdb_string.h.
	* armnbsd-tdep.c: Use string.h, not gdb_string.h.
	* armobsd-tdep.c: Use string.h, not gdb_string.h.
	* avr-tdep.c: Use string.h, not gdb_string.h.
	* ax-gdb.c: Use string.h, not gdb_string.h.
	* ax-general.c: Use string.h, not gdb_string.h.
	* bcache.c: Use string.h, not gdb_string.h.
	* bfin-tdep.c: Use string.h, not gdb_string.h.
	* breakpoint.c: Use string.h, not gdb_string.h.
	* build-id.c: Use string.h, not gdb_string.h.
	* buildsym.c: Use string.h, not gdb_string.h.
	* c-exp.y: Use string.h, not gdb_string.h.
	* c-lang.c: Use string.h, not gdb_string.h.
	* c-typeprint.c: Use string.h, not gdb_string.h.
	* c-valprint.c: Use string.h, not gdb_string.h.
	* charset.c: Use string.h, not gdb_string.h.
	* cli-out.c: Use string.h, not gdb_string.h.
	* cli/cli-cmds.c: Use string.h, not gdb_string.h.
	* cli/cli-decode.c: Use string.h, not gdb_string.h.
	* cli/cli-dump.c: Use string.h, not gdb_string.h.
	* cli/cli-interp.c: Use string.h, not gdb_string.h.
	* cli/cli-logging.c: Use string.h, not gdb_string.h.
	* cli/cli-script.c: Use string.h, not gdb_string.h.
	* cli/cli-setshow.c: Use string.h, not gdb_string.h.
	* cli/cli-utils.c: Use string.h, not gdb_string.h.
	* coffread.c: Use string.h, not gdb_string.h.
	* common/common-utils.c: Use string.h, not gdb_string.h.
	* common/filestuff.c: Use string.h, not gdb_string.h.
	* common/linux-procfs.c: Use string.h, not gdb_string.h.
	* common/linux-ptrace.c: Use string.h, not gdb_string.h.
	* common/signals.c: Use string.h, not gdb_string.h.
	* common/vec.h: Use string.h, not gdb_string.h.
	* core-regset.c: Use string.h, not gdb_string.h.
	* corefile.c: Use string.h, not gdb_string.h.
	* corelow.c: Use string.h, not gdb_string.h.
	* cp-abi.c: Use string.h, not gdb_string.h.
	* cp-support.c: Use string.h, not gdb_string.h.
	* cp-valprint.c: Use string.h, not gdb_string.h.
	* cris-tdep.c: Use string.h, not gdb_string.h.
	* d-lang.c: Use string.h, not gdb_string.h.
	* dbxread.c: Use string.h, not gdb_string.h.
	* dcache.c: Use string.h, not gdb_string.h.
	* demangle.c: Use string.h, not gdb_string.h.
	* dicos-tdep.c: Use string.h, not gdb_string.h.
	* disasm.c: Use string.h, not gdb_string.h.
	* doublest.c: Use string.h, not gdb_string.h.
	* dsrec.c: Use string.h, not gdb_string.h.
	* dummy-frame.c: Use string.h, not gdb_string.h.
	* dwarf2-frame.c: Use string.h, not gdb_string.h.
	* dwarf2loc.c: Use string.h, not gdb_string.h.
	* dwarf2read.c: Use string.h, not gdb_string.h.
	* elfread.c: Use string.h, not gdb_string.h.
	* environ.c: Use string.h, not gdb_string.h.
	* eval.c: Use string.h, not gdb_string.h.
	* event-loop.c: Use string.h, not gdb_string.h.
	* exceptions.c: Use string.h, not gdb_string.h.
	* exec.c: Use string.h, not gdb_string.h.
	* expprint.c: Use string.h, not gdb_string.h.
	* f-exp.y: Use string.h, not gdb_string.h.
	* f-lang.c: Use string.h, not gdb_string.h.
	* f-typeprint.c: Use string.h, not gdb_string.h.
	* f-valprint.c: Use string.h, not gdb_string.h.
	* fbsd-nat.c: Use string.h, not gdb_string.h.
	* findcmd.c: Use string.h, not gdb_string.h.
	* findvar.c: Use string.h, not gdb_string.h.
	* fork-child.c: Use string.h, not gdb_string.h.
	* frame.c: Use string.h, not gdb_string.h.
	* frv-linux-tdep.c: Use string.h, not gdb_string.h.
	* frv-tdep.c: Use string.h, not gdb_string.h.
	* gdb.c: Use string.h, not gdb_string.h.
	* gdb_bfd.c: Use string.h, not gdb_string.h.
	* gdbarch.c: Use string.h, not gdb_string.h.
	* gdbtypes.c: Use string.h, not gdb_string.h.
	* gnu-nat.c: Use string.h, not gdb_string.h.
	* gnu-v2-abi.c: Use string.h, not gdb_string.h.
	* gnu-v3-abi.c: Use string.h, not gdb_string.h.
	* go-exp.y: Use string.h, not gdb_string.h.
	* go-lang.c: Use string.h, not gdb_string.h.
	* go32-nat.c: Use string.h, not gdb_string.h.
	* hppa-hpux-tdep.c: Use string.h, not gdb_string.h.
	* hppa-linux-nat.c: Use string.h, not gdb_string.h.
	* hppanbsd-tdep.c: Use string.h, not gdb_string.h.
	* hppaobsd-tdep.c: Use string.h, not gdb_string.h.
	* i386-cygwin-tdep.c: Use string.h, not gdb_string.h.
	* i386-dicos-tdep.c: Use string.h, not gdb_string.h.
	* i386-linux-nat.c: Use string.h, not gdb_string.h.
	* i386-linux-tdep.c: Use string.h, not gdb_string.h.
	* i386-nto-tdep.c: Use string.h, not gdb_string.h.
	* i386-sol2-tdep.c: Use string.h, not gdb_string.h.
	* i386-tdep.c: Use string.h, not gdb_string.h.
	* i386bsd-tdep.c: Use string.h, not gdb_string.h.
	* i386gnu-nat.c: Use string.h, not gdb_string.h.
	* i386nbsd-tdep.c: Use string.h, not gdb_string.h.
	* i386obsd-tdep.c: Use string.h, not gdb_string.h.
	* i387-tdep.c: Use string.h, not gdb_string.h.
	* ia64-libunwind-tdep.c: Use string.h, not gdb_string.h.
	* ia64-linux-nat.c: Use string.h, not gdb_string.h.
	* inf-child.c: Use string.h, not gdb_string.h.
	* inf-ptrace.c: Use string.h, not gdb_string.h.
	* inf-ttrace.c: Use string.h, not gdb_string.h.
	* infcall.c: Use string.h, not gdb_string.h.
	* infcmd.c: Use string.h, not gdb_string.h.
	* inflow.c: Use string.h, not gdb_string.h.
	* infrun.c: Use string.h, not gdb_string.h.
	* interps.c: Use string.h, not gdb_string.h.
	* iq2000-tdep.c: Use string.h, not gdb_string.h.
	* irix5-nat.c: Use string.h, not gdb_string.h.
	* jv-exp.y: Use string.h, not gdb_string.h.
	* jv-lang.c: Use string.h, not gdb_string.h.
	* jv-typeprint.c: Use string.h, not gdb_string.h.
	* jv-valprint.c: Use string.h, not gdb_string.h.
	* language.c: Use string.h, not gdb_string.h.
	* linux-fork.c: Use string.h, not gdb_string.h.
	* linux-nat.c: Use string.h, not gdb_string.h.
	* lm32-tdep.c: Use string.h, not gdb_string.h.
	* m2-exp.y: Use string.h, not gdb_string.h.
	* m2-typeprint.c: Use string.h, not gdb_string.h.
	* m32c-tdep.c: Use string.h, not gdb_string.h.
	* m32r-linux-nat.c: Use string.h, not gdb_string.h.
	* m32r-linux-tdep.c: Use string.h, not gdb_string.h.
	* m32r-rom.c: Use string.h, not gdb_string.h.
	* m32r-tdep.c: Use string.h, not gdb_string.h.
	* m68hc11-tdep.c: Use string.h, not gdb_string.h.
	* m68k-tdep.c: Use string.h, not gdb_string.h.
	* m68kbsd-tdep.c: Use string.h, not gdb_string.h.
	* m68klinux-nat.c: Use string.h, not gdb_string.h.
	* m68klinux-tdep.c: Use string.h, not gdb_string.h.
	* m88k-tdep.c: Use string.h, not gdb_string.h.
	* macrocmd.c: Use string.h, not gdb_string.h.
	* main.c: Use string.h, not gdb_string.h.
	* mdebugread.c: Use string.h, not gdb_string.h.
	* mem-break.c: Use string.h, not gdb_string.h.
	* memattr.c: Use string.h, not gdb_string.h.
	* memory-map.c: Use string.h, not gdb_string.h.
	* mep-tdep.c: Use string.h, not gdb_string.h.
	* mi/mi-cmd-break.c: Use string.h, not gdb_string.h.
	* mi/mi-cmd-disas.c: Use string.h, not gdb_string.h.
	* mi/mi-cmd-env.c: Use string.h, not gdb_string.h.
	* mi/mi-cmd-stack.c: Use string.h, not gdb_string.h.
	* mi/mi-cmd-var.c: Use string.h, not gdb_string.h.
	* mi/mi-cmds.c: Use string.h, not gdb_string.h.
	* mi/mi-console.c: Use string.h, not gdb_string.h.
	* mi/mi-getopt.c: Use string.h, not gdb_string.h.
	* mi/mi-interp.c: Use string.h, not gdb_string.h.
	* mi/mi-main.c: Use string.h, not gdb_string.h.
	* mi/mi-parse.c: Use string.h, not gdb_string.h.
	* microblaze-rom.c: Use string.h, not gdb_string.h.
	* microblaze-tdep.c: Use string.h, not gdb_string.h.
	* mingw-hdep.c: Use string.h, not gdb_string.h.
	* minidebug.c: Use string.h, not gdb_string.h.
	* minsyms.c: Use string.h, not gdb_string.h.
	* mips-irix-tdep.c: Use string.h, not gdb_string.h.
	* mips-linux-tdep.c: Use string.h, not gdb_string.h.
	* mips-tdep.c: Use string.h, not gdb_string.h.
	* mips64obsd-tdep.c: Use string.h, not gdb_string.h.
	* mipsnbsd-tdep.c: Use string.h, not gdb_string.h.
	* mipsread.c: Use string.h, not gdb_string.h.
	* mn10300-linux-tdep.c: Use string.h, not gdb_string.h.
	* mn10300-tdep.c: Use string.h, not gdb_string.h.
	* monitor.c: Use string.h, not gdb_string.h.
	* moxie-tdep.c: Use string.h, not gdb_string.h.
	* mt-tdep.c: Use string.h, not gdb_string.h.
	* nbsd-tdep.c: Use string.h, not gdb_string.h.
	* nios2-linux-tdep.c: Use string.h, not gdb_string.h.
	* nto-procfs.c: Use string.h, not gdb_string.h.
	* nto-tdep.c: Use string.h, not gdb_string.h.
	* objc-lang.c: Use string.h, not gdb_string.h.
	* objfiles.c: Use string.h, not gdb_string.h.
	* opencl-lang.c: Use string.h, not gdb_string.h.
	* osabi.c: Use string.h, not gdb_string.h.
	* osdata.c: Use string.h, not gdb_string.h.
	* p-exp.y: Use string.h, not gdb_string.h.
	* p-lang.c: Use string.h, not gdb_string.h.
	* p-typeprint.c: Use string.h, not gdb_string.h.
	* parse.c: Use string.h, not gdb_string.h.
	* posix-hdep.c: Use string.h, not gdb_string.h.
	* ppc-linux-nat.c: Use string.h, not gdb_string.h.
	* ppc-sysv-tdep.c: Use string.h, not gdb_string.h.
	* ppcfbsd-tdep.c: Use string.h, not gdb_string.h.
	* ppcnbsd-tdep.c: Use string.h, not gdb_string.h.
	* ppcobsd-tdep.c: Use string.h, not gdb_string.h.
	* printcmd.c: Use string.h, not gdb_string.h.
	* procfs.c: Use string.h, not gdb_string.h.
	* prologue-value.c: Use string.h, not gdb_string.h.
	* python/py-auto-load.c: Use string.h, not gdb_string.h.
	* python/py-gdb-readline.c: Use string.h, not gdb_string.h.
	* ravenscar-thread.c: Use string.h, not gdb_string.h.
	* regcache.c: Use string.h, not gdb_string.h.
	* registry.c: Use string.h, not gdb_string.h.
	* remote-fileio.c: Use string.h, not gdb_string.h.
	* remote-m32r-sdi.c: Use string.h, not gdb_string.h.
	* remote-mips.c: Use string.h, not gdb_string.h.
	* remote-sim.c: Use string.h, not gdb_string.h.
	* remote.c: Use string.h, not gdb_string.h.
	* reverse.c: Use string.h, not gdb_string.h.
	* rs6000-aix-tdep.c: Use string.h, not gdb_string.h.
	* ser-base.c: Use string.h, not gdb_string.h.
	* ser-go32.c: Use string.h, not gdb_string.h.
	* ser-mingw.c: Use string.h, not gdb_string.h.
	* ser-pipe.c: Use string.h, not gdb_string.h.
	* ser-tcp.c: Use string.h, not gdb_string.h.
	* ser-unix.c: Use string.h, not gdb_string.h.
	* serial.c: Use string.h, not gdb_string.h.
	* sh-tdep.c: Use string.h, not gdb_string.h.
	* sh64-tdep.c: Use string.h, not gdb_string.h.
	* shnbsd-tdep.c: Use string.h, not gdb_string.h.
	* skip.c: Use string.h, not gdb_string.h.
	* sol-thread.c: Use string.h, not gdb_string.h.
	* solib-dsbt.c: Use string.h, not gdb_string.h.
	* solib-frv.c: Use string.h, not gdb_string.h.
	* solib-osf.c: Use string.h, not gdb_string.h.
	* solib-spu.c: Use string.h, not gdb_string.h.
	* solib-target.c: Use string.h, not gdb_string.h.
	* solib.c: Use string.h, not gdb_string.h.
	* somread.c: Use string.h, not gdb_string.h.
	* source.c: Use string.h, not gdb_string.h.
	* sparc-nat.c: Use string.h, not gdb_string.h.
	* sparc-sol2-tdep.c: Use string.h, not gdb_string.h.
	* sparc-tdep.c: Use string.h, not gdb_string.h.
	* sparc64-tdep.c: Use string.h, not gdb_string.h.
	* sparc64fbsd-tdep.c: Use string.h, not gdb_string.h.
	* sparc64nbsd-tdep.c: Use string.h, not gdb_string.h.
	* sparcnbsd-tdep.c: Use string.h, not gdb_string.h.
	* spu-linux-nat.c: Use string.h, not gdb_string.h.
	* spu-multiarch.c: Use string.h, not gdb_string.h.
	* spu-tdep.c: Use string.h, not gdb_string.h.
	* stabsread.c: Use string.h, not gdb_string.h.
	* stack.c: Use string.h, not gdb_string.h.
	* std-regs.c: Use string.h, not gdb_string.h.
	* symfile.c: Use string.h, not gdb_string.h.
	* symmisc.c: Use string.h, not gdb_string.h.
	* symtab.c: Use string.h, not gdb_string.h.
	* target.c: Use string.h, not gdb_string.h.
	* thread.c: Use string.h, not gdb_string.h.
	* tilegx-linux-nat.c: Use string.h, not gdb_string.h.
	* tilegx-tdep.c: Use string.h, not gdb_string.h.
	* top.c: Use string.h, not gdb_string.h.
	* tracepoint.c: Use string.h, not gdb_string.h.
	* tui/tui-command.c: Use string.h, not gdb_string.h.
	* tui/tui-data.c: Use string.h, not gdb_string.h.
	* tui/tui-disasm.c: Use string.h, not gdb_string.h.
	* tui/tui-file.c: Use string.h, not gdb_string.h.
	* tui/tui-layout.c: Use string.h, not gdb_string.h.
	* tui/tui-out.c: Use string.h, not gdb_string.h.
	* tui/tui-regs.c: Use string.h, not gdb_string.h.
	* tui/tui-source.c: Use string.h, not gdb_string.h.
	* tui/tui-stack.c: Use string.h, not gdb_string.h.
	* tui/tui-win.c: Use string.h, not gdb_string.h.
	* tui/tui-windata.c: Use string.h, not gdb_string.h.
	* tui/tui-winsource.c: Use string.h, not gdb_string.h.
	* typeprint.c: Use string.h, not gdb_string.h.
	* ui-file.c: Use string.h, not gdb_string.h.
	* ui-out.c: Use string.h, not gdb_string.h.
	* user-regs.c: Use string.h, not gdb_string.h.
	* utils.c: Use string.h, not gdb_string.h.
	* v850-tdep.c: Use string.h, not gdb_string.h.
	* valarith.c: Use string.h, not gdb_string.h.
	* valops.c: Use string.h, not gdb_string.h.
	* valprint.c: Use string.h, not gdb_string.h.
	* value.c: Use string.h, not gdb_string.h.
	* varobj.c: Use string.h, not gdb_string.h.
	* vax-tdep.c: Use string.h, not gdb_string.h.
	* vaxnbsd-tdep.c: Use string.h, not gdb_string.h.
	* vaxobsd-tdep.c: Use string.h, not gdb_string.h.
	* windows-nat.c: Use string.h, not gdb_string.h.
	* xcoffread.c: Use string.h, not gdb_string.h.
	* xml-support.c: Use string.h, not gdb_string.h.
	* xstormy16-tdep.c: Use string.h, not gdb_string.h.
	* xtensa-linux-nat.c: Use string.h, not gdb_string.h.
2013-11-18 13:29:00 -07:00
Tom Tromey 5c4c8a5911 remove unused field from struct elfinfo
I noticed that one field in elfread.c:struct elfinfo is unused.
This patch removes it.

	* elfread.c (struct elfinfo) <stabindexsect>: Remove.
	(elf_locate_sections): Update.
2013-10-17 15:41:46 +00:00
Tom Tromey dc294be54c fix PR symtab/15597
This patch fixes gdb PR symtab/15597.

The bug is that the .gnu_debugaltlink section includes the build-id of
the alt file, but gdb does not use it.

This patch fixes the problem by changing gdb to do what it ought to
always have done: verify the build id of the file found using the
filename in .gnu_debugaltlink; and if that does not match, try to find
the correct debug file using the build-id and debug-file-directory.

This patch touches BFD.  Previously, gdb had its own code for parsing
.gnu_debugaltlink; I changed it to use the BFD functions after those
were introduced.  However, the BFD functions are incorrect -- they
assume that .gnu_debugaltlink is formatted like .gnu_debuglink.
However, it it is not.  Instead, it consists of a file name followed
by the build-id -- no alignment, and the build-id is not a CRC.

Fixing this properly is a bit of a pain.  But, because
separate_alt_debug_file_exists just has a FIXME for the build-id case,
I did not fix it properly.  Instead I introduced a hack.  This leaves
BFD working just as well as it did before my patch.

I'm willing to do something better here but I could use some guidance
as to what.  It seems that the build-id code in BFD is largely punted
on.

FWIW gdb is the only user of bfd_get_alt_debug_link_info outside of
BFD itself.

I moved the build-id logic out of elfread.c and into a new file.
This seemed cleanest to me.

Writing a test case was a bit of a pain.  I added a couple new
features to the DWARF assembler to handle this.

Built and regtested on x86-64 Fedora 18.

	* bfd-in2.h: Rebuild.
	* opncls.c (bfd_get_alt_debug_link_info): Add buildid_len
	parameter.  Change type of buildid_out.  Update.
	(get_alt_debug_link_info_shim): New function.
	(bfd_follow_gnu_debuglink): Use it.

	* Makefile.in (SFILES): Add build-id.c.
	(HFILES_NO_SRCDIR): Add build-id.h.
	* build-id.c: New file, largely from elfread.c.  Modified
	most functions.
	* build-id.h: New file.
	* dwarf2read.c (dwarf2_get_dwz_file): Update for change to
	bfd_get_alt_debug_link_info.  Verify dwz file's build-id.
	Search for dwz file using build-id.
	* elfread.c (build_id_bfd_get, build_id_verify)
	(build_id_to_debug_filename, find_separate_debug_file): Remove.

	* gdb.dwarf2/dwzbuildid.exp: New file.
	* lib/dwarf.exp (Dwarf::_section): Add "flags" and "type"
	parameters.
	(Dwarf::_defer_output): Change "section" parameter to
	"section_spec"; update.
	(Dwarf::gnu_debugaltlink, Dwarf::_note, Dwarf::build_id): New
	procs.
2013-10-08 19:56:15 +00:00
Doug Evans 8fb8eb5ca4 New option "set debug symfile on".
* NEWS: Mention "set debug symfile".
	* Makefile.in (SFILES): Add symfile-debug.c.
	(COMMON_OBS): Add symfile-debug.o.
	* elfread.c (elf_symfile_read): Use objfile_set_sym_fns to set the
	objfile's symbol functions.
	* objfiles.h (objfile_set_sym_fns): Declare.
	* symfile-debug.c: New file.
	* symfile.c (syms_from_objfile_1): Use objfile_set_sym_fns to set the
	objfile's symbol functions.
	(reread_symbols): Ditto.
2013-09-25 23:17:12 +00:00
Doug Evans c256e17165 * symfile.h (struct sym_fns): Delete member "sym_flavour".
All uses updated.
	(add_symtab_fns): Update prototype.
	* symfile.c (sym_fns_ptr): Delete.  Replace with ...
	(registered_sym_fns): ... this.
	(symtab_fns): Update.
	(add_symtab_fns): New arg "flavour".  All callers updated.
	(find_sym_fns): Rewrite to use new sym_fns registry.
2013-09-25 22:48:19 +00:00
Jan Kratochvil 24ba069af8 Keep objfile original filename
gdb/
2013-09-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Pass down original filename for objfile.
	* coffread.c (coff_symfile_read): Update symbol_file_add_separate call.
	* elfread.c (elf_symfile_read): Likewise.
	* jit.c (jit_object_close_impl): Update allocate_objfile call, no
	longer set ORIGINAL_NAME.
	(jit_bfd_try_read_symtab): Update symbol_file_add_from_bfd call.
	* jv-lang.c (get_dynamics_objfile): Update allocate_objfile call.
	* machoread.c (macho_add_oso_symfile): Add parameter name.  Update
	symbol_file_add_from_bfd call.
	(macho_symfile_read_all_oso): Update two macho_add_oso_symfile calls.
	(macho_check_dsym): Add parameter filenamep.  Change function comment.
	Set *filenamep.
	(macho_symfile_read): New variable dsym_filename.  Update
	macho_check_dsym call.  Use it for symbol_file_add_separate.
	* objfiles.c (allocate_objfile): Add parameter name.  New comment for
	it.  Use it for objfile->original_name.
	(objfile_name): Return OBFD's filename, if available.
	* objfiles.h (allocate_objfile): Add new parameter name.
	* solib.c (solib_read_symbols): Update symbol_file_add_from_bfd call.
	* symfile-mem.c (symbol_file_add_from_memory): Update
	symbol_file_add_from_bfd call.
	* symfile.c (read_symbols): Update symbol_file_add_separate call, new
	comment for it.
	(symbol_file_add_with_addrs): New parameter name, add function comment
	for it.  Remove variable name.  Update allocate_objfile call.
	(symbol_file_add_separate): New parameter name, add function comment
	for it.  Update symbol_file_add_with_addrs call.
	(symbol_file_add_from_bfd): New parameter name.  Update
	symbol_file_add_with_addrs call.
	(symbol_file_add): Update symbol_file_add_from_bfd call.
	(reread_symbols): New variable original_name.  Save
	objfile->original_name by it.
	* symfile.h (symbol_file_add_from_bfd, symbol_file_add_separate): Add
	second parameter.
2013-09-24 14:00:06 +00:00
Jan Kratochvil 4262abfb98 Code cleanup: Add objfile_name accessor
gdb/
2013-09-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Code cleanup: Add objfile_name accessor function.
	* ada-lang.c (is_known_support_routine): Use objfile_name.
	* auto-load.c (source_gdb_script_for_objfile)
	(auto_load_objfile_script): Likewise.
	* coffread.c (coff_symtab_read, read_one_sym): Likewise.
	* dbxread.c (dbx_symfile_read): Likewise.
	* dwarf2-frame.c (dwarf2_build_frame_info): Likewise.
	* dwarf2loc.c (locexpr_describe_location_piece): Likewise.
	* dwarf2read.c (dwarf2_get_dwz_file, dwarf2_read_index)
	(dw2_symtab_iter_next, dw2_expand_symtabs_matching)
	(lookup_dwp_signatured_type, lookup_dwo_unit)
	(dwarf2_build_psymtabs_hard, scan_partial_symbols, process_queue)
	(fixup_go_packaging, process_imported_unit_die, dwarf2_physname)
	(read_import_statement, create_dwo_cu, open_and_init_dwp_file)
	(lookup_dwo_cutu, read_call_site_scope, dwarf2_ranges_read)
	(dwarf2_record_block_ranges, read_common_block, read_typedef)
	(read_subrange_type, load_partial_dies, read_partial_die)
	(read_addr_index_1, read_str_index, dwarf_decode_lines_1)
	(die_containing_type, build_error_marker_type, lookup_die_type)
	(follow_die_ref_or_sig, follow_die_ref, dwarf2_fetch_die_loc_sect_off)
	(dwarf2_fetch_constant_bytes, follow_die_sig, get_signatured_type)
	(get_DW_AT_signature_type, write_psymtabs_to_index)
	(save_gdb_index_command): Likewise.
	* elfread.c (find_separate_debug_file_by_buildid, elf_symfile_read):
	Likewise.
	* expprint.c (dump_subexp_body_standard): Likewise.
	* gdbtypes.c (type_name_no_tag_or_error): Likewise.
	* jit.c (jit_object_close_impl): Use the objfile field name renamed to
	original_name.
	* linux-thread-db.c (try_thread_db_load_from_pdir_1): New variable
	obj_name, use objfile_name for it, use the variable.
	(try_thread_db_load_from_pdir, has_libpthread, thread_db_new_objfile):
	Use objfile_name.
	* machoread.c (macho_symtab_read, macho_check_dsym)
	(macho_symfile_relocate): Likewise.
	* maint.c (maintenance_translate_address): Likewise.
	* minidebug.c (find_separate_debug_file_in_section): Likewise.
	* minsyms.c (install_minimal_symbols): Likewise.
	* objfiles.c (allocate_objfile): Use the objfile field name renamed to
	original_name.
	(filter_overlapping_sections): Use objfile_name.
	(objfile_name): New function.
	* objfiles.h (struct objfile): Rename field name to original_name.
	(objfile_name): New prototype.
	* printcmd.c (sym_info, address_info): Use objfile_name.
	* probe.c (parse_probes, collect_probes, compare_probes)
	(info_probes_for_ops): Likewise.
	* progspace.c (clone_program_space): Likewise.
	* psymtab.c (require_partial_symbols, dump_psymtab, allocate_psymtab)
	(maintenance_info_psymtabs): Likewise.
	* python/py-auto-load.c (gdbpy_load_auto_script_for_objfile)
	(source_section_scripts): Likewise.
	* python/py-objfile.c (objfpy_get_filename): Likewise.
	* python/py-progspace.c (pspy_get_filename): Likewise.
	* solib-aix.c (solib_aix_get_toc_value): Likewise.
	* solib-som.c (match_main, som_solib_section_offsets): Likewise.
	* solib.c (solib_read_symbols): Likewise.
	* stabsread.c (scan_file_globals): Likewise.
	* stap-probe.c (handle_stap_probe): Likewise.
	* symfile.c (symbol_file_clear, separate_debug_file_exists)
	(find_separate_debug_file_by_debuglink): Likewise.
	(reread_symbols): Likewise.  Use the objfile field name renamed to
	original_name.
	(allocate_symtab): Use objfile_name.
	* symmisc.c (print_symbol_bcache_statistics, print_objfile_statistics)
	(dump_objfile, dump_msymbols, dump_symtab_1)
	(maintenance_print_msymbols, maintenance_print_objfiles)
	(maintenance_info_symtabs, maintenance_check_symtabs): Likewise.
	* target.c (target_translate_tls_address, target_info): Likewise.
	* xcoffread.c (xcoff_initial_scan): Make variable name const.  Use
	objfile_name.
2013-09-24 13:57:38 +00:00
Doug Evans 4f00dda370 * elfread.c (elf_symfile_read): Move "Done reading minimal symbols"
debugging printf to better location.
2013-08-24 00:12:25 +00:00
Tom Tromey df6d544176 move gdbarch object from objfile to per-BFD
This moves the "gdbarch" field from the objfile into the BFD.

This field's value is derived from the BFD and is immutable over the
lifetime of the BFD.  This makes it a reasonable candidate for pushing
into the per-BFD object.

This is part of the long-term objfile splitting project.  In the long
run I think this patch will make it simpler to moves types from the
objfile to the per-BFD object; but the patch makes sense as a minor
cleanup by itself.

Built and regtested on x86-64 Fedora 18.

	* cp-namespace.c (cp_lookup_symbol_imports_or_template): Use
	get_objfile_arch.
	* elfread.c (elf_rel_plt_read, elf_gnu_ifunc_record_cache)
	(elf_gnu_ifunc_resolve_by_got): Use get_objfile_arch.
	* jit.c (jit_object_close_impl): Update.
	* jv-lang.c (get_dynamics_objfile): Update.
	* linespec.c (add_minsym): Use get_dynamics_objfile.
	* objfiles.c (get_objfile_bfd_data): Initialize 'gdbarch' field.
	(allocate_objfile): Don't initialize 'gdbarch' field.
	(get_objfile_arch): Update.
	* objfiles.h (struct objfile_per_bfd_storage) <gdbarch>: New field,
	moved from...
	(struct objfile) <gdbarch>: ... here.  Remove.
	* stap-probe.c (stap_can_evaluate_probe_arguments): Use
	get_objfile_arch.
	* symfile.c (init_entry_point_info): Use get_objfile_arch.
2013-08-20 15:04:51 +00:00
Sergio Durigan Junior 25f9533e51 2013-07-24 Sergio Durigan Junior <sergiodj@redhat.com>
* breakpoint.c (create_longjmp_master_breakpoint): Check if probe
	interface can evaluate arguments.  Fallback to the old mode if it
	cannot.
	(create_exception_master_breakpoint): Likewise.
	* elfread.c (elf_can_evaluate_probe_arguments): New function.
	(struct sym_probe_fns elf_probe_fns): Export function above to the
	probe interface.
	* probe.c (can_evaluate_probe_arguments): New function.
	* probe.h (struct probe_ops) <can_evaluate_probe_arguments>: New
	function pointer.
	(can_evaluate_probe_arguments): New function prototype.
	* solib-svr4.c (svr4_create_solib_event_breakpoints): Check if
	probe interface can evaluate arguments.  Fallback to the old mode
	if it cannot.
	* stap-probe.c (stap_get_probe_argument_count): Check if probe
	interface can evaluate arguments.  Warning the user if it cannot.
	(stap_can_evaluate_probe_arguments): New function.
	(struct probe_ops stap_probe_ops): Export function above to the
	probe interface.
	* symfile.h (struct sym_probe_fns) <can_evaluate_probe_arguments>:
	New function pointer.
2013-07-24 19:50:32 +00:00
Doug Evans 3189cb1297 * dbxread.c (process_one_symbol): Constify section_offsets parameter.
* stabsread.h (process_one_symbol): Update declaration.
	* dwarf2read.c (dw2_relocate): Constify new_offsets, delta parameters.
	* elfread.c (elf_symfile_relocate_probe): Ditto.
	* psymtab.c (relocate_psymtabs): Ditto.
	* objfiles.c (objfile_relocate1): Constify new_offsets parameter.
	(objfile_relocate): Ditto.
	* objfiles.h (objfile_relocate): Update declaration.
	* symfile.c (relative_addr_info_to_section_offsets): Constify
	addrs parameter.
	(default_symfile_offsets): Ditto.
	(syms_from_objfile_1): Constify offsets parameter.
	(syms_from_objfile): Ditto.
	(symbol_file_add_with_addrs_or_offsets): Ditto.
	(symfile_map_offsets_to_segments): Constify data parameter.
	* symfile.h (struct quick_symbol_functions): Constify new_offsets,
	delta parameters of member relocate.
	(struct sym_probe_fns): Constify new_offsets,
	delta parameters of member sym_relocate_probe.
	(struct sym_fns): Constify section_addr_info parameter of member
	sym_offsets.
	(relative_addr_info_to_section_offsets): Update declaration.
	(default_symfile_offsets): Ditto.
	(syms_from_objfile): Ditto.
	(symfile_map_offsets_to_segments): Ditto.
2013-05-06 19:15:17 +00:00
Tom Tromey 715c6909e2 * elfread.c (elf_symtab_read): Install versioned symbol under
unversioned name as well.
2013-04-15 17:31:17 +00:00
Tom Tromey e27d198cc4 PR symtab/8424:
* blockframe.c (find_pc_partial_function_gnu_ifunc): Check
	SYMBOL_SECTION, not SYMBOL_OBJ_SECTION.
	* breakpoint.c (resolve_sal_pc): Update.
	* elfread.c (elf_gnu_ifunc_record_cache): Update.
	* findvar.c (struct minsym_lookup_data) <objfile>: New field.
	(minsym_lookup_iterator_cb): Use it.
	(default_read_var_value): Update.
	* hppa-hpux-tdep.c (hppa64_hpux_in_solib_call_trampoline):
	Update.
	* infcmd.c (jump_command): Update.
	* linespec.c (minsym_found): Update.
	* maint.c (maintenance_translate_address): Update.
	* minsyms.c (lookup_minimal_symbol_by_pc_section_1): Update.
	(prim_record_minimal_symbol_full): Don't set SYMBOL_OBJ_SECTION.
	* parse.c (write_exp_msymbol): Update.
	* printcmd.c (address_info): Update.
	* psymtab.c (find_pc_sect_psymbol): Update.
	(fixup_psymbol_section): Check SYMBOL_SECTION, not
	SYMBOL_OBJ_SECTION.
	(add_psymbol_to_bcache): Correctly initialize SYMBOL_SECTION.
	Don't initialize SYMBOL_OBJ_SECTION.
	* spu-tdep.c (spu_catch_start): Update.
	* stabsread.c (define_symbol): Don't set SYMBOL_SECTION.
	* symmisc.c (dump_msymbols, print_symbol): Update.
	* symtab.c (fixup_section): Don't set 'obj_section'.  Change
	how fallback section is computed.
	(fixup_symbol_section): Update.
	(find_pc_sect_symtab, find_function_start_sal, skip_prologue_sal):
	Update.
	(allocate_symbol, initialize_symbol, allocate_template_symbol):
	Initialize SYMBOL_SECTION.
	* symtab.h (struct general_symbol_info) <section>: Update comment.
	<obj_section>: Remove.
	(SYMBOL_OBJ_SECTION): Add 'objfile' argument.  Rewrite.
	(SYMBOL_OBJFILE): New macro.
2013-04-08 20:18:11 +00:00
Tom Tromey e6dc44a8f5 * coffread.c (record_minimal_symbol): Update.
* dbxread.c (record_minimal_symbol): Update.
	* elfread.c (record_minimal_symbol): Update.
	* machoread.c (macho_symtab_add_minsym): Update.
	* mdebugread.c (record_minimal_symbol, parse_partial_symbols):
	Update.
	* minsyms.c (prim_record_minimal_symbol): Update.
	(prim_record_minimal_symbol_full): Remove 'bfd_section'
	argument.
	(prim_record_minimal_symbol_and_info): Likewise.
	* minsyms.h (prim_record_minimal_symbol_full)
	(prim_record_minimal_symbol_and_info): Update.
	* symtab.c (allocate_symbol, initialize_symbol)
	(allocate_template_symbol): Initialize SYMBOL_SECTION.
	* xcoffread.c (record_minimal_symbol, scan_xcoff_symtab):
	Update.
2013-04-08 20:13:22 +00:00
Tom Tromey 65cf356359 * coffread.c (cs_to_section): Use gdb_bfd_section_index.
* elfread.c (record_minimal_symbol, elf_symtab_read): Use
	gdb_bfd_section_index.
	* gdb_bfd.c (gdb_bfd_section_index, gdb_bfd_count_sections):
	New functions.
	* gdb_bfd.h (gdb_bfd_section_index, gdb_bfd_count_sections):
	Declare.
	* machoread.c (macho_symtab_add_minsym, macho_symfile_offsets):
	Update.
	* objfiles.c (add_to_objfile_sections_full): New function.
	(add_to_objfile_sections): Use it.
	(build_section_table): Rewrite.
	(objfile_relocate1): Use gdb_bfd_section_index.  Update.
	* objfiles.h (obj_section_offset): Use gdb_bfd_section_index.
	(struct objfile) <sections>: Update comment.
	(ALL_OBJFILE_OSECTIONS): Skip sections where the_bfd_section
	is NULL.
	(ALL_OBJSECTIONS): Use it.
	* solib-dsbt.c (dsbt_relocate_main_executable): Update.
	* solib-frv.c (frv_relocate_main_executable): Update.
	* solib-target.c (solib_target_relocate_section_addresses):
	Use gdb_bfd_section_index.
	* symfile.c (build_section_addr_info_from_section_table):
	Use gdb_bfd_section_index.
	(build_section_addr_info_from_bfd, place_section): Likewise.
	* symtab.c (fixup_section): Update.
	* xcoffread.c (find_targ_sec): Use gdb_bfd_section_index.
2013-04-08 20:04:42 +00:00
Tom Tromey 7cbd4a934e * minsyms.h (struct bound_minimal_symbol): New.
(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
	Remove objfile argument.
	(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
	Return bound_minimal_symbol.
	* minsyms.c (lookup_minimal_symbol_by_pc_1)
	(lookup_minimal_symbol_by_pc_section, lookup_minimal_symbol_by_pc):
	Return bound_minimal_symbol.
	(in_gnu_ifunc_stub): Update.
	(lookup_minimal_symbol_and_objfile): Return bound_minimal_symbol.
	Remove 'objfile_p' argument.
	(lookup_solib_trampoline_symbol_by_pc): Update.
	* ada-tasks.c, amd64-windows-tdep.c, arm-tdep.c,
	arm-wince-tdep.c, block.c, blockframe.c, breakpoint.c, btrace.c,
	c-valprint.c, dwarf2loc.c, elfread.c, frame.c, frv-tdep.c,
	glibc-tdep.c, gnu-v2-abi.c, gnu-v3-abi.c, hppa-hpux-tdep.c,
	i386-tdep.c, ia64-tdep.c, infcall.c, infcmd.c, jit.c,
	linux-fork.c, m32c-tdep.c, m68hc11-tdep.c, maint.c,
	mips-tdep.c, p-valprint.c, parse.c, ppc-linux-tdep.c,
	ppc-sysv-tdep.c, printcmd.c, rs6000-tdep.c, sh64-tdep.c,
	stack.c, symtab.c, tui/tui-disasm.c: Update.
2013-04-08 19:59:09 +00:00
Sergio Durigan Junior bb869963da From: Sergio Durigan Junior <sergiodj@redhat.com>
Subject: [PATCH] Fix for PR c++/15203 and PR c++/15210
Date: Sat, 09 Mar 2013 02:50:49 -0300 (5 days, 4 hours, 57 minutes ago)
Message-ID: <m3a9qdnmti.fsf@redhat.com>

Hi,

This bug was reported internally at our Bugzilla, along with a proposed
fix.  After talking to Keith about it, he investigated and came up with
another patch needed to really fix the issue on CVS HEAD.

The first part of the fix is the patch to cp-namespace.c.  It handles
the case when we are accessing a static variable inside a function
(inside a class) by the full linespec (is it right, Keith?).  E.g.:

    class foo
    {
    public:
        int bar()
        {
            static int var = 0;
        }
    };

And then, printing the value of `var':

    (gdb) print 'foo::bar()::var'

GDB would fall in an internal_error:

    gdb/cp-namespace.c:816: internal-error: cp_lookup_nested_symbol called on a non-aggregate type.

This is because `cp_lookup_nested_symbol' is not handling the case when
TYPE_CODE is either _FUNC or _METHOD.  This patch fixes it by returning
NULL in this case.

The second part of the fix is the patch to elfread.c.  It is needed
because the BSF_GNU_UNIQUE flag was added to some symbols in
<http://sourceware.org/ml/binutils/2009-06/msg00016.html>.  Because of
that, (still) the command:

    (gdb) print 'foo::bar()::var'

where `var' is a static variable returns:

    "No symbol "foo::bar()::var" in current context."

So with the second patch applied the command finally DTRT:

    (gdb) print 'foo::bar()::var'
    $1 = 0

This may not be the ideal solution, according to Keith it would be good
to implement productions on c-exp.y in order to recognize
CLASS::FUNCTION::VARIABLE, but it is a solution which works with what we
have today.

I regtested it in Fedora 17 x86_64 with -m64 and -m32, including
gdbserver, without regressions.

gdb/:
2013-03-14  Keith Seitz  <keiths@redhat.com>
	    Alan Matsuoka  <alanm@redhat.com>

	PR c++/15203
	PR c++/15210
	* cp-namespace.c (cp_lookup_nested_symbol): Handle TYPE_CODE_FUNC and
	TYPE_CODE_METHOD.
	* elfread.c (elf_symtab_read): Handle BSF_GNU_UNIQUE for certain
	symbols.

gdb/testsuite/:
2013-03-14  Sergio Durigan Junior  <sergiodj@redhat.com>

	PR c++/15203
	PR c++/15210
	* gdb.cp/m-static.cc (keepalive_int): New function.
	(gnu_obj_1::method): New variable `sintvar', call `keepalive_int'.
	* gdb.cp/m-static.exp: New test for `sintvar'.
2013-03-14 11:13:36 +00:00
Doug Evans 7b6c814ed7 * elfread.c (elf_symfile_read): Move debugging printf to more
logical location.
2013-03-06 21:20:02 +00:00
Alan Modra 24c274a133 * elfread.c (elf_symtab_read): Do not use udata.p here to find
symbol size.
	* ppc64-tdep.c (ppc64_elf_make_msymbol_special): New function.
	* ppc64-tdep.h (ppc64_elf_make_msymbol_special): Declare.
	* ppc-linux-tdep.c (ppc_linux_init_abi): Set up to use the above.
	* ppcfbsd-tdep.c (ppcfbsd_init_abi): Likewise.
2013-02-22 23:24:24 +00:00
Jan Kratochvil bfada1897a gdb/
Code cleanup.
	* elfread.c (build_id_bfd_get): Make the return type const.
	(build_id_verify): Make the check parameter const.
	(build_id_to_debug_filename): Make the build_id parameter and variable
	data const.
	(find_separate_debug_file_by_buildid): Make the variable build_id const.
2013-02-22 16:40:56 +00:00
Alan Modra c03551323c bfd/
* elf-bfd.h (struct elf_build_id): Extracted from..
	(struct elf_build_id_info): ..here.  Delete.
	(struct output_elf_obj_tdata): New, extracted from..
	(struct elf_obj_tdata): ..here.  Reorganize for better packing.
	Add "o" field.
	(elf_program_header_size): Reference tdata->o.
	(elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker,
	elf_stack_flags, elf_shstrtab, elf_strtab_sec, elf_shstrtab_sec,
	elf_section_syms, elf_num_section_syms, elf_flags_init): Likewise.
	* elf.c (bfd_elf_allocate_object): Allocate output_elf_obj_tdata
	when opening bfd in any mode that might write.
	(_bfd_elf_write_object_contents): Use build_id field in
	output_elf_obj_tdata.
	(_bfd_elf_close_and_cleanup): Tweak elf_shstrtab test.
	(elfobj_grok_gnu_build_id): Adjust for elf_tdata changes.
gdb/
	* elfread.c (build_id_bfd_get): Adjust for elf_tdata changes.
ld/
	* emultempl/elf32.em (write_build_id, setup_build_id): Adjust
	for elf_tdata changes.
2013-02-21 04:35:22 +00:00
Alan Modra 30e8ee25e3 include/
* bfdlink.h (struct bfd_link_info): Delete emit_note_gnu_build_id.
bfd/
	* configure.in: Bump version to 2.23.52.
	* elf-bfd.h (struct elf_build_id_info): New.
	(struct elf_obj_tdata): Delete after_write_object_contents,
	after_write_object_contents_info and build_id_size.  Make build_id
	a pointer to struct elf_build_id_info.
	* elf.c (_bfd_elf_write_object_contents): Style.  Update
	after_write_ibject_contents invocation.
	(elfobj_grok_gnu_build_id): Update for new build_id struct.  Don't
	allow zero size notes.
	* configure: Regenerate.
gdb/
	* elfread.c (struct build_id): Delete.  Use struct elf_build_id
	throughout file instead.
	(build_id_bfd_get): Update to use new elf_tdata build_id field.
	Don't xmalloc return value.
	(build_id_verify): Similarly.  Don't xfree.
	(build_id_to_debug_filename): Update.
	(find_separate_debug_file_by_buildid): Update, don't xfree.
ld/
	* emultempl/elf32.em (emit_note_gnu_build_id): New static var.
	Replace all info->emit_note_gnu_build_id refs.
	(id_note_section_size): Rename from
	gld${EMULATION_NAME}_id_note_section_size.
	(struct build_id_info): Delete.
	(write_build_id): Rename from
	gld${EMULATION_NAME}_write_build_id_section.
	Update elf_tdata usage.  Style, formatting.
	(setup_build_id): New function.
	(gld${EMULATION_NAME}_after_open): Use setup_build_id.
2013-02-18 23:50:32 +00:00
Jan Kratochvil 8a92335bfc gdb/
* elfread.c (elf_symfile_read): Limit separate debug info additions to
	files with no separate debug info.
	* objfiles.c (add_separate_debug_objfile): Add gdb_assert calls.
	* symfile.c (read_symbols): Call find_separate_debug_file_in_section
	only for files with no separate debug info.

gdb/testsuite/
	* gdb.base/gnu-debugdata.exp): Create ${binfile}.debug,
	${binfile}.mini_debuginfo-debuglink, add -k to xz, use now
	${binfile}.mini_debuginfo-debuglink and
	${binfile}.mini_debuginfo-debuglink.xz.
2013-02-01 19:39:04 +00:00
Joel Brobecker 28e7fd6234 Update years in copyright notice for the GDB files.
Two modifications:
  1. The addition of 2013 to the copyright year range for every file;
  2. The use of a single year range, instead of potentially multiple
     year ranges, as approved by the FSF.
2013-01-01 06:33:28 +00:00
Tom Tromey d2f4b8feb9 * coffread.c (coff_symfile_init): Use set_objfile_data.
(coff_symfile_read): Use DBX_SYMFILE_INFO.
	* dbxread.c (dbx_objfile_data_key): New global.
	(dbx_symfile_init): Use set_objfile_data.
	(dbx_symfile_finish): Don't free deprecated_sym_stab_info.
	(dbx_free_symfile_info): New function.
	(coffstab_build_psymtabs, elfstab_build_psymtabs): Use
	DBX_SYMFILE_INFO.
	(stabsect_build_psymtabs): Use set_objfile_data.
	(_initialize_dbxreadb): Initialize dbx_objfile_data_key.
	* elfread.c (elf_symtab_read): Use DBX_SYMFILE_INFO,
	set_objfile_data.
	(free_elfinfo): Use DBX_SYMFILE_INFO.
	(elf_symfile_finish): Don't free deprecated_sym_stab_info.
	(elfstab_offset_sections): Use DBX_SYMFILE_INFO.
	* gdb-stabs.h (dbx_objfile_data_key): Declare.
	(DBX_SYMFILE_INFO): Rewrite to use objfile_data.
	* objfiles.h (struct objfile) <deprecated_sym_stab_info>: Remove.
	* somread.c (som_symfile_finish): Don't free
	deprecated_sym_stab_info.
2012-12-12 15:57:01 +00:00
Yao Qi 85ddcc7021 gdb/
2012-11-21  Yao Qi  <yao@codesourcery.com>

	PR tdep/7438
	* gdbarch.sh (smash_text_address): Remove.
	* gdbarch.c, gdbarch.h: Regenerate.
	* arm-tdep.c (arm_smash_text_address): Remove.
	(arm_gdbarch_init): Don't call set_gdbarch_smash_text_address.
	* hppa-tdep.c (hppa_smash_text_address): Remove.
	(hppa_addr_bits_remove): Rename from hppa_smash_text_address.
	(hppa_gdbarch_init): Don't call set_gdbarch_smash_text_address.
	Caller update.
	* coffread.c (coff_symtab_read): Caller update.
	* dbxread.c (process_one_symbol): Likewise.
	* elfread.c (record_minimal_symbol): Likewise.
	* somread.c (som_symtab_read): Likewise.
2012-11-21 00:29:55 +00:00
Joel Brobecker d9eaeb59a4 Name of symbol missing when printing global variable's address
The build_address_symbolic funnction filters out data symbols if
their size is set to zero.  But the problem is that the COFF symbol
table (for instance) does not provide any size information, leaving
the size to its default value of zero, thus always triggering
the filter.

This shows up when trying to print the address of a global variable
when debugging a Windows executable, for instance.

gdb/ChangeLog:

        * symtab.h (struct minimal_symbol) [has_size]: New field.
        (MSYMBOL_SIZE): Adjust to forbid macro from being used as lvalue.
        (SET_MSYMBOL_SIZE, MSYMBOL_HAS_SIZE): New macros.
        * printcmd.c (build_address_symbolic): Only filter out zero-sized
        minimal symbols if the symbol's size is actually known.
        * minsyms.c (prim_record_minimal_symbol_full): Adjust setting
        of msymbol's size field.  Add comment.
        * elfread.c (elf_symtab_read, elf_rel_plt_read): Use
        SET_MSYMBOL_SIZE to set the minimal symbol size.
2012-09-11 21:26:16 +00:00
Tom Tromey 706e37059f * elfread.c (elf_symtab_read): Update.
* objfiles.c (objfiles_bfd_data): New global.
	(get_objfile_bfd_data, free_objfile_per_bfd_storage)
	(objfile_bfd_data_free, set_objfile_per_bfd): New functions.
	(allocate_objfile, free_objfile): Update.
	(_initialize_objfiles): Initialize objfiles_bfd_data.
	* objfiles.h (struct objfile_per_bfd_storage): New.
	(struct objfile) <per_bfd>: New field.
	<filename_cache>: Remove.
	(set_objfile_per_bfd): Declare.
	* symfile.c (reread_symbols): Update.  Call
	set_objfile_per_bfd.
	(allocate_symtab): Update.
	* symmisc.c (print_symbol_bcache_statistics): Update.
	(print_objfile_statistics): Print the size of the BFD obstack.
gdb/testsuite
	* gdb.base/maint.exp: Update.
2012-08-22 16:01:09 +00:00
Tom Tromey 08d2cd740c * symfile.c (separate_debug_file_exists): Update.
(gdb_bfd_open_maybe_remote): Rename from bfd_open_maybe_remote.
	(reread_symbols): Update.
	* elfread.c (build_id_verify): Update.
	* symfile.h (gdb_bfd_open_maybe_remote): Rename from
	bfd_open_maybe_remote.
2012-07-23 15:03:59 +00:00
Tom Tromey 8ac244b433 * coffread.c (coff_symfile_read): Make a cleanup for 'debugfile'
and 'abfd'.
	* elfread.c (elf_symfile_read): Make a cleanup for 'debugfile'
	and 'abfd'.
	* jit.c (jit_bfd_try_read_symtab): Make a cleanup for 'nbfd'.
	* machoread.c (macho_add_oso_symfile): Make a cleanup for
	'abfd'.
	(macho_symfile_read): Make a cleanup for 'dsym_bfd'.
	* objfiles.c (allocate_objfile): Acquire a new reference.
	* rs6000-nat.c (add_vmap): Don't acquire a BFD reference.
	* solib.c (solib_read_symbols): Don't acquire a BFD reference.
	* spu-linux-nat.c (spu_symbol_file_add_from_memory): Make
	a cleanup for 'nbfd'.
	* symfile-mem.c (symbol_file_add_from_memory): Make a cleanup
	for 'nbfd'.
	* symfile.c (symbol_file_add_with_addrs_or_offsets): Don't
	make a cleanup for 'abfd'.
	(symbol_file_add): Make a BFD cleanup.
2012-07-23 14:58:44 +00:00
Tom Tromey cbb099e886 * dwarf2read.c (try_open_dwo_file): Use gdb_bfd_ref and
gdb_bfd_unref.
	(free_dwo_file): Use gdb_bfd_unref.
	* cli/cli-dump.c: Include gdb_bfd.h.
	(bfd_openw_with_cleanup): Use gdb_bfd_ref.
	(bfd_openr_with_cleanup): Likewise.
	* windows-nat.c (windows_make_so): Use gdb_bfd_ref,
	gdb_bfd_unref.
	* utils.c: Include gdb_bfd.h.
	(do_bfd_close_cleanup): Use gdb_bfd_unref.
	* symfile.c: Include gdb_bfd.h.
	(separate_debug_file_exists): Use gdb_bfd_unref.
	(bfd_open_maybe_remote): Use gdb_bfd_ref.
	(symfile_bfd_open): Use gdb_bfd_ref, gdb_bfd_unref.
	(generic_load): Use gdb_bfd_ref.
	(reread_symbols): Use gdb_bfd_unref.
	* symfile-mem.c: Include gdb_bfd.h.
	(symbol_file_add_from_memory): Use make_cleanup_bfd_close.
	* spu-linux-nat.c (spu_bfd_open): Use gdb_bfd_ref, gdb_bfd_unref.
	* solib.c: Include gdb_bfd.h.
	(solib_bfd_fopen): Use gdb_bfd_ref.
	(solib_bfd_open): Use gdb_bfd_unref.
	(free_so_symbols): Use gdb_bfd_unref.
	(reload_shared_libraries_1): Use gdb_bfd_unref.
	* solib-spu.c: Include gdb_bfd.h.
	(spu_bfd_fopen): Use gdb_bfd_ref, gdb_bfd_unref.
	* solib-pa64.c (pa64_solib_create_inferior_hook): Use gdb_bfd_ref,
	gdb_bfd_unref.
	* solib-frv.c: Include gdb_bfd.h.
	(enable_break2): Use gdb_bfd_unref.
	* solib-dsbt.c: Include gdb_bfd.h.
	(enable_break2): Use gdb_bfd_unref.
	* solib-darwin.c: Include gdb_bfd.h.
	(darwin_solib_get_all_image_info_addr_at_init): Use gdb_bfd_ref,
	gdb_bfd_unref.
	(darwin_bfd_open): Use gdb_bfd_unref.
	* rs6000-nat.c (add_vmap): Use gdb_bfd_ref, gdb_bfd_unref.
	* remote-mips.c: Include gdb_bfd.h.
	(mips_load_srec): Use gdb_bfd_ref.
	(pmon_load_fast): Use gdb_bfd_ref.
	* remote-m32r-sdi.c: Include gdb_bfd.h.
	(m32r_load): Use gdb_bfd_ref.
	* record.c: Include gdb_bfd.h.
	(record_save_cleanups): Use gdb_bfd_unref.
	(cmd_record_save): Use gdb_bfd_unref.
	* procfs.c (insert_dbx_link_bpt_in_file): Use gdb_bfd_ref,
	gdb_bfd_unref.
	* objfiles.h (gdb_bfd_close_or_warn): Remove.
	(gdb_bfd_ref, gdb_bfd_unref): Move to gdb_bfd.h.
	* objfiles.c: Include gdb_bfd.h.
	(free_objfile): Use gdb_bfd_unref.
	(gdb_bfd_close_or_warn, gdb_bfd_ref, gdb_bfd_unref): Move to
	gdb_bfd.c.
	* machoread.c (macho_add_oso_symfile): Use gdb_bfd_unref.
	(macho_symfile_read_all_oso): Use gdb_bfd_ref, gdb_bfd_unref.
	(macho_check_dsym): Likewise.
	* m32r-rom.c: Include gdb_bfd.h.
	(m32r_load): Use gdb_bfd_ref.
	(m32r_upload_command): Use gdb_bfd_ref.
	* jit.c: Include gdb_bfd.h.
	(jit_bfd_try_read_symtab): Use gdb_bfd_ref, gdb_bfd_unref.
	* gdb_bfd.h: New file.
	* gdb_bfd.c: New file.
	* gcore.c: Include gdb_bfd.h.
	(create_gcore_bfd): Use gdb_bfd_ref.
	(do_bfd_delete_cleanup): Use gdb_bfd_unref.
	(gcore_command): Use gdb_bfd_unref.
	* exec.c: Include gdb_bfd.h.
	(exec_close): Use gdb_bfd_unref.
	(exec_close_1): Use gdb_bfd_unref.
	(exec_file_attach): Use gdb_bfd_ref.
	* elfread.c: Include gdb_bfd.h.
	(build_id_verify): Use gdb_bfd_unref.
	* dsrec.c: Include gdb_bfd.h.
	(load_srec): Use gdb_bfd_ref.
	* corelow.c: Include gdb_bfd.h.
	(core_close): Use gdb_bfd_unref.
	(core_open): Use gdb_bfd_ref.
	* bfd-target.c: Include gdb_bfd.h.
	(target_bfd_xclose): Use gdb_bfd_unref.
	(target_bfd_reopen): Use gdb_bfd_ref.
	* Makefile.in (SFILES): Add gdb_bfd.c.
	(HFILES_NO_SRCDIR): Add gdb_bfd.h.
	(COMMON_OBS): Add gdb_bfd.o.
2012-07-18 19:33:34 +00:00
Sergio Durigan Junior 6bac747387 2012-07-18 Sergio Durigan Junior <sergiodj@redhat.com>
* elfread.c (elf_get_probe_argument_count): Remove `objfile' argument.
	(elf_compile_to_ax): Likewise.
	* infrun.c (insert_exception_resume_from_probe): Likewise.
	(check_exception_resume): Remove `objfile' variable.
	* probe.c (find_probe_by_pc): Remove `objfile' argument.
	(struct probe_and_objfile, probe_and_objfile_s): Delete.
	(collect_probes): Adjust return value to `VEC (probe_p) *'.
	(compare_entries): Rename to...
	(compare_probes): ...this.  Adjust function to work with
	`struct probe *'.  Rename variables `ea' and `eb' to `pa' and `pb'
	respectively.
	(gen_ui_out_table_header_info): Adjust `probes' argument to be
	`VEC (probe_p) *'.
	(print_ui_out_info): Adjust argument to be `struct probe *'.
	(info_probes_for_ops): Adjust internal computations to use
	`VEC (probe_p) *'.
	(probe_safe_evaluate_at_pc): Refactor to not pass `objfile' anymore.
	* probe.h (struct probe_ops) <get_probe_argument_count, compile_to_ax,
	gen_info_probes_table_values>: Remove `objfile' argument.
	(struct probe) <objfile>: New field.
	(find_probe_by_pc): Remove `objfile' argument.
	* stap-probe.c (stap_parse_probe_arguments): Likewise.
	(stap_get_probe_argument_count): Likewise.
	(stap_get_arg): Likewise.
	(stap_evaluate_probe_argument): Likewise.
	(stap_compile_to_ax): Likewise.
	(compile_probe_arg): Refactor not to pass `objfile' anymore.
	(handle_stap_probe): Fill `objfile' field from `struct probe'.
	(stap_gen_info_probes_table_header): Remove `objfile' argument.
	* symfile.h (struct sym_probe_fns) <sym_evaluate_probe_argument,
	sym_compile_to_ax>: Likewise.
2012-07-18 16:12:17 +00:00
Doug Evans 45cfd46896 * NEWS: Mention new options "set debug dwarf2-read" and
"set debug symtab-create".
	* dwarf2read.c (dwarf2_read_debug): New static global.
	(dwarf2_build_psymtabs_hard): Add debugging printfs.
	(process_queue): Ditto.
	(process_full_comp_unit): Ditto.
	(_initialize_dwarf2_read): Add new option "set debug dwarf2-read".
	* elfread.c (elf_symfile_read): Add debugging printf.
	* minsyms.c (install_minimal_symbols): Ditto.
	* psymtab.c (allocate_psymtab): Ditto.
	* symfile.c (allocate_symtab): Ditto.
	* symtab.c (symtab_create_debug): New global.
	(_initialize_symtab): Add new option "set debug symtab-create".
	* symtab.h (symtab_create_debug): Declare.

	doc/
	* gdb.texinfo (Debugging Output): Document debug options dwarf2-read
	and symtab-create.
2012-06-26 20:14:03 +00:00
Doug Evans 422d65e705 * symtab.h (minimal_symbol): New member created_by_gdb.
* elfread.c (elf_symtab_read): Set created_by_gdb for @plt minsym
	created by gdb.
	* symtab.c (lookup_symbol_in_objfile_from_linkage_name): New function.
	(search_symbols): Call it instead of lookup_symbol.
	Skip symbols created by gdb.  Only scan minsyms if nfiles == 0.

	testsuite:
	* gdb.base/info-fun.exp: New file.
	* gdb.base/info-fun.c: New file.
	* gdb.base/info-fun-solib.c: New file.
2012-06-19 00:53:35 +00:00
Sergio Durigan Junior 22e048c9dd 2012-05-18 Sergio Durigan Junior <sergiodj@redhat.com>
* ada-lang.c:
	* ada-tasks.c:
	* ada-varobj.c:
	* amd64-darwin-tdep.c:
	* arm-symbian-tdep.c:
	* arm-tdep.c:
	* avr-tdep.c:
	* ax-gdb.c:
	* bfin-linux-tdep.c:
	* breakpoint.c:
	* c-valprint.c:
	* cli/cli-cmds.c:
	* coffread.c:
	* cp-support.c:
	* cris-tdep.c:
	* dwarf2-frame-tailcall.c:
	* dwarf2-frame.c:
	* dwarf2expr.c:
	* dwarf2loc.c:
	* dwarf2read.c:
	* elfread.c:
	* eval.c:
	* expprint.c:
	* f-valprint.c:
	* frv-tdep.c:
	* h8300-tdep.c:
	* hppa-hpux-tdep.c:
	* hppa-tdep.c:
	* hppanbsd-tdep.c:
	* i386-nto-tdep.c:
	* i386-tdep.c:
	* i387-tdep.c:
	* ia64-tdep.c:
	* jit.c:
	* linespec.c:
	* linux-tdep.c:
	* lm32-tdep.c:
	* m2-valprint.c:
	* m32c-tdep.c:
	* m32r-rom.c:
	* m32r-tdep.c:
	* m68k-tdep.c:
	* m68klinux-tdep.c:
	* mi/mi-main.c:
	* microblaze-tdep.c:
	* mips-linux-tdep.c:
	* mips-tdep.c:
	* mn10300-tdep.c:
	* p-valprint.c:
	* parse.c:
	* ppc-linux-tdep.c:
	* ppc-sysv-tdep.c:
	* printcmd.c:
	* python/py-finishbreakpoint.c:
	* python/py-inferior.c:
	* python/py-infthread.c:
	* python/py-type.c:
	* python/python.c:
	* remote-fileio.c:
	* remote-m32r-sdi.c:
	* remote-mips.c:
	* reverse.c:
	* rl78-tdep.c:
	* rs6000-aix-tdep.c:
	* rs6000-tdep.c:
	* s390-tdep.c:
	* score-tdep.c:
	* sh64-tdep.c:
	* skip.c:
	* solib-darwin.c:
	* solib-dsbt.c:
	* solib-frv.c:
	* sparc-tdep.c:
	* spu-multiarch.c:
	* spu-tdep.c:
	* stack.c:
	* symfile.c:
	* symtab.c:
	* tic6x-tdep.c:
	* tracepoint.c:
	* v850-tdep.c:
	* valarith.c:
	* valprint.c:
	* value.c:
	* xcoffread.c:
	* xtensa-tdep.c:
	* ada-lang.c:
	* ada-tasks.c:
	* ada-varobj.c:
	* amd64-darwin-tdep.c:
	* arm-symbian-tdep.c:
	* arm-tdep.c: Delete unused variables.
2012-05-18 21:02:52 +00:00
Maciej W. Rozycki 6a3a010ba6 gdb/
* breakpoint.h (bp_location): Add related_address member.
	* inferior.h (get_return_value): Take a pointer to struct value
	instead of struct type for the function requested.
	* value.h (using_struct_return): Likewise.
	* gdbarch.sh (return_value): Take a pointer to struct value
	instead of struct type for the function requested.
	* breakpoint.c (set_breakpoint_location_function): Initialize
	related_address for bp_gnu_ifunc_resolver breakpoints.
	* elfread.c (elf_gnu_ifunc_resolver_return_stop): Pass the
	requested function's address to gdbarch_return_value.
	* eval.c (evaluate_subexp_standard): Pass the requested
	function's address to using_struct_return.
	* infcall.c (call_function_by_hand): Pass the requested
	function's address to using_struct_return and
	gdbarch_return_value.
	* infcmd.c (get_return_value): Take a pointer to struct value
	instead of struct type for the function requested.
	(print_return_value): Update accordingly.
	(finish_command_continuation): Likewise.
	* stack.c (return_command): Pass the requested function's
	address to using_struct_return and gdbarch_return_value.
	* value.c (using_struct_return): Take a pointer to struct value
	instead of struct type for the function requested.  Pass the
	requested function's address to gdbarch_return_value.
	* python/py-finishbreakpoint.c (finish_breakpoint_object):
	New function_value member, replacing function_type.
	(bpfinishpy_dealloc): Update accordingly.
	(bpfinishpy_pre_stop_hook): Likewise.
	(bpfinishpy_init): Likewise.  Record the requested function's
	address.
	* mips-tdep.c (mips_fval_reg): New enum.
	(mips_o32_push_dummy_call): For MIPS16 FP doubles do not swap
	words put in GP registers.
	(mips_o64_push_dummy_call): Update a comment.
	(mips_o32_return_value): Take a pointer to struct value instead
	of struct type for the function requested and use it to check if
	using the MIPS16 calling convention.  Return the designated
	general purpose registers for floating-point values returned in
	MIPS16 mode.
	(mips_o64_return_value): Likewise.
	* ppc-tdep.h (ppc_sysv_abi_return_value): Update prototype.
	(ppc_sysv_abi_broken_return_value): Likewise.
	(ppc64_sysv_abi_return_value): Likewise.
	* alpha-tdep.c (alpha_return_value): Take a pointer to struct
	value instead of struct type for the function requested.
	* amd64-tdep.c (amd64_return_value): Likewise.
	* amd64-windows-tdep.c (amd64_windows_return_value): Likewise.
	* arm-tdep.c (arm_return_value): Likewise.
	* avr-tdep.c (avr_return_value): Likewise.
	* bfin-tdep.c (bfin_return_value): Likewise.
	* cris-tdep.c (cris_return_value): Likewise.
	* frv-tdep.c (frv_return_value): Likewise.
	* h8300-tdep.c (h8300_return_value): Likewise.
	(h8300h_return_value): Likewise.
	* hppa-tdep.c (hppa32_return_value): Likewise.
	(hppa64_return_value): Likewise.
	* i386-tdep.c (i386_return_value): Likewise.
	* ia64-tdep.c (ia64_return_value): Likewise.
	* iq2000-tdep.c (iq2000_return_value): Likewise.
	* lm32-tdep.c (lm32_return_value): Likewise.
	* m32c-tdep.c (m32c_return_value): Likewise.
	* m32r-tdep.c (m32r_return_value): Likewise.
	* m68hc11-tdep.c (m68hc11_return_value): Likewise.
	* m68k-tdep.c (m68k_return_value): Likewise.
	(m68k_svr4_return_value): Likewise.
	* m88k-tdep.c (m88k_return_value): Likewise.
	* mep-tdep.c (mep_return_value): Likewise.
	* microblaze-tdep.c (microblaze_return_value): Likewise.
	* mn10300-tdep.c (mn10300_return_value): Likewise.
	* moxie-tdep.c (moxie_return_value): Likewise.
	* mt-tdep.c (mt_return_value): Likewise.
	* ppc-linux-tdep.c (ppc_linux_return_value): Likewise.
	* ppc-sysv-tdep.c (ppc_sysv_abi_return_value): Likewise.
	(ppc_sysv_abi_broken_return_value): Likewise.
	(ppc64_sysv_abi_return_value): Likewise.
	* ppcnbsd-tdep.c (ppcnbsd_return_value): Likewise.
	* rl78-tdep.c (rl78_return_value): Likewise.
	* rs6000-aix-tdep.c (rs6000_return_value): Likewise.
	* rx-tdep.c (rx_return_value): Likewise.
	* s390-tdep.c (s390_return_value): Likewise.
	* score-tdep.c (score_return_value): Likewise.
	* sh-tdep.c (sh_return_value_nofpu): Likewise.
	(sh_return_value_fpu): Likewise.
	* sh64-tdep.c (sh64_return_value): Likewise.
	* sparc-tdep.c (sparc32_return_value): Likewise.
	* sparc64-tdep.c (sparc64_return_value): Likewise.
	* spu-tdep.c (spu_return_value): Likewise.
	* tic6x-tdep.c (tic6x_return_value): Likewise.
	* v850-tdep.c (v850_return_value): Likewise.
	* vax-tdep.c (vax_return_value): Likewise.
	* xstormy16-tdep.c (xstormy16_return_value): Likewise.
	* xtensa-tdep.c (xtensa_return_value): Likewise.
	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.

	gdb/testsuite/
	* gdb.base/return-nodebug.exp: Also test float and double types.
2012-05-16 14:35:09 +00:00
Alan Modra 45dfa85a1e Replace all uses of bfd_abs_section, bfd_com_section, bfd_und_section
and bfd_ind_section with their _ptr variants, or use corresponding
bfd_is_* macros.
2012-05-05 03:05:32 +00:00
Sergio Durigan Junior 55aa24fb2e 2012-04-27 Sergio Durigan Junior <sergiodj@redhat.com>
Tom Tromey  <tromey@redhat.com>
	    Jan Kratochvil  <jan.kratochvil@redhat.com>

	* Makefile.in (SFILES): Add `probe' and `stap-probe'.
	(COMMON_OBS): Likewise.
	(HFILES_NO_SRCDIR): Add `probe'.
	* NEWS: Mention support for static and SystemTap probes.
	* amd64-tdep.c (amd64_init_abi): Initializing proper fields used by
	SystemTap probes' arguments parser.
	* arm-linux-tdep.c: Including headers needed to perform the parsing
	of SystemTap probes' arguments.
	(arm_stap_is_single_operand): New function.
	(arm_stap_parse_special_token): Likewise.
	(arm_linux_init_abi): Initializing proper fields used by SystemTap
	probes' arguments parser.
	* ax-gdb.c (require_rvalue): Removing static declaration.
	(gen_expr): Likewise.
	* ax-gdb.h (gen_expr): Declaring function.
	(require_rvalue): Likewise.
	* breakpoint.c: Include `gdb_regex.h' and `probe.h'.
	(bkpt_probe_breakpoint_ops): New variable.
	(momentary_breakpoint_from_master): Set the `probe' value.
	(add_location_to_breakpoint): Likewise.
	(break_command_1): Using proper breakpoint_ops according to the
	argument passed by the user in the command line.
	(bkpt_probe_insert_location): New function.
	(bkpt_probe_remove_location): Likewise.
	(bkpt_probe_create_sals_from_address): Likewise.
	(bkpt_probe_decode_linespec): Likewise.
	(tracepoint_probe_create_sals_from_address): Likewise.
	(tracepoint_probe_decode_linespec): Likewise.
	(tracepoint_probe_breakpoint_ops): New variable.
	(trace_command): Using proper breakpoint_ops according to the
	argument passed by the user in the command line.
	(initialize_breakpoint_ops): Initializing breakpoint_ops for
	static probes on breakpoints and tracepoints.
	* breakpoint.h (struct bp_location) <probe>: New field.
	* cli-utils.c (skip_spaces_const): New function.
	(extract_arg): Likewise.
	* cli-utils.h (skip_spaces_const): Likewise.
	(extract_arg): Likewise.
	* coffread.c (coff_sym_fns): Add `sym_probe_fns' value.
	* configure.ac: Append `stap-probe.o' to be generated when ELF
	support is present.
	* configure: Regenerate.
	* dbxread.c (aout_sym_fns): Add `sym_probe_fns' value.
	* elfread.c: Include `probe.h' and `arch-utils.h'.
	(probe_key): New variable.
	(elf_get_probes): New function.
	(elf_get_probe_argument_count): Likewise.
	(elf_evaluate_probe_argument): Likewise.
	(elf_compile_to_ax): Likewise.
	(elf_symfile_relocate_probe): Likewise.
	(stap_probe_key_free): Likewise.
	(elf_probe_fns): New variable.
	(elf_sym_fns): Add `sym_probe_fns' value.
	(elf_sym_fns_lazy_psyms): Likewise.
	(elf_sym_fns_gdb_index): Likewise.
	(_initialize_elfread): Initialize objfile cache for static
	probes.
	* gdb_vecs.h (struct probe): New forward declaration.
	(probe_p): New VEC declaration.
	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.
	* gdbarch.sh (stap_integer_prefix): New variable.
	(stap_integer_suffix): Likewise.
	(stap_register_prefix): Likewise.
	(stap_register_suffix): Likewise.
	(stap_register_indirection_prefix): Likewise.
	(stap_register_indirection_suffix): Likewise.
	(stap_gdb_register_prefix): Likewise.
	(stap_gdb_register_suffix): Likewise.
	(stap_is_single_operand): New function.
	(stap_parse_special_token): Likewise.
	(struct stap_parse_info): Forward declaration.
	* i386-tdep.c: Including headers needed to perform the parsing
	of SystemTap probes' arguments.
	(i386_stap_is_single_operand): New function.
	(i386_stap_parse_special_token): Likewise.
	(i386_elf_init_abi): Initializing proper fields used by SystemTap
	probes' arguments parser.
	* i386-tdep.h (i386_stap_is_single_operand): New function.
	(i386_stap_parse_special_token): Likewise.
	* machoread.c (macho_sym_fns): Add `sym_probe_fns' value.
	* mipsread.c (ecoff_sym_fns): Likewise.
	* objfiles.c (objfile_relocate1): Support relocation for static
	probes.
	* parse.c (prefixify_expression): Remove static declaration.
	(initialize_expout): Likewise.
	(reallocate_expout): Likewise.
	* parser-defs.h (initialize_expout): Declare function.
	(reallocate_expout): Likewise.
	(prefixify_expression): Likewise.
	* ppc-linux-tdep.c: Including headers needed to perform the parsing
	of SystemTap probes' arguments.
	(ppc_stap_is_single_operand): New function.
	(ppc_stap_parse_special_token): Likewise.
	(ppc_linux_init_abi): Initializing proper fields used by SystemTap
	probes' arguments parser.
	* probe.c: New file, for generic statically defined probe support.
	* probe.h: Likewise.
	* s390-tdep.c: Including headers needed to perform the parsing of
	SystemTap probes' arguments.
	(s390_stap_is_single_operand): New function.
	(s390_gdbarch_init): Initializing proper fields used by SystemTap
	probes' arguments parser.
	* somread.c (som_sym_fns): Add `sym_probe_fns' value.
	* stap-probe.c: New file, for SystemTap probe support.
	* stap-probe.h: Likewise.
	* symfile.h: Include `gdb_vecs.h'.
	(struct sym_probe_fns): New struct.
	(struct sym_fns) <sym_probe_fns>: New field.
	* symtab.c (init_sal): Initialize `probe' field.
	* symtab.h (struct probe): Forward declaration.
	(struct symtab_and_line) <probe>: New field.
	* tracepoint.c (start_tracing): Adjust semaphore on breakpoints
	locations.
	(stop_tracing): Likewise.
	* xcoffread.c (xcoff_sym_fns): Add `sym_probe_fns' value.
2012-04-27 20:47:57 +00:00
Jan Kratochvil e4ab2fad14 gdb/
Code cleanup.
	* charset.c (find_charset_names): Remove variables ix and elt.
	Use free_char_ptr_vec.
	* elfread.c (build_id_to_debug_filename): New variables debugdir_vec,
	back_to and ix.  Use dirnames_to_char_ptr_vec.  Remove variable
	debugdir_end.  New variable debugdir_len.
	* gdb_vecs.h (free_char_ptr_vec, make_cleanup_free_char_ptr_vec)
	(dirnames_to_char_ptr_vec_append, dirnames_to_char_ptr_vec): New
	declarations.
	* progspace.c (clear_program_space_solib_cache): Remove variables ix
	and elt.  Use free_char_ptr_vec.
	* source.c (add_path): Remove variables argv, arg and argv_index.
	New variables dir_vec, back_to, ix and name.
	Use dirnames_to_char_ptr_vec_append.  Use freeargv instead of
	make_cleanup_freeargv.  Remove variable separator.  Simplify the code
	no longer expecting DIRNAME_SEPARATOR.
	(openp): Remove variable p, p1 and len.  New variables dir_vec,
	back_to, ix and dir.  Use dirnames_to_char_ptr_vec.  Simplify the code
	no longer expecting DIRNAME_SEPARATOR.
	* symfile.c (find_separate_debug_file): New variables debugdir_vec,
	back_to and ix.  Use dirnames_to_char_ptr_vec.  Remove variable
	debugdir_end.
	* utils.c (free_char_ptr_vec, do_free_char_ptr_vec)
	(make_cleanup_free_char_ptr_vec, dirnames_to_char_ptr_vec_append)
	(dirnames_to_char_ptr_vec): New functions.
2012-04-17 15:47:09 +00:00
Jan Kratochvil c70a6932bb gdb/
* arm-linux-tdep.c (arm_linux_copy_svc): Reset stale FRAME.
	* breakpoint.c (until_break_command): Likewise.
	* elfread.c (elf_gnu_ifunc_resolver_stop): Likewise.
	* infcall.c (call_function_by_hand): Likewise.
	* infcmd.c (finish_forward): Likewise.
	* infrun.c (insert_exception_resume_breakpoint): Likewise.
2012-02-29 14:52:44 +00:00
Doug Evans 28ee876ac0 * elfread.c (elf_symfile_segments): Fix warning text. 2012-02-21 06:44:13 +00:00
Doug Evans 2c02bd7290 * blockframe.c (find_pc_partial_function_gnu_ifunc): Change type of
"name" parameter to const char ** from char **.  All callers updated.
	(find_pc_partial_function): Ditto.
	(cache_pc_function_name): Change type to const char * from char *.
	* symtab.h ((find_pc_partial_function_gnu_ifunc): Update.
	(find_pc_partial_function): Update.
	* alpha-tdep.h (struct gdbarch_tdep, member pc_in_sigtramp): Change
	type of "name" parameter to const char * from char *.
	All uses updated.
	* arch-utils.c (generic_in_solib_return_trampoline): Change
	type of "name" parameter to const char * from char *.
	* arch-utils.h (generic_in_solib_return_trampoline): Update.
	* frv-linux-tdep.c (frv_linux_pc_in_sigtramp): Change
	type of "name" parameter to const char * from char *.
	* gdbarch.sh (in_solib_return_trampoline): Ditto.
	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.
	* hppa-hpux-tdep.c (hppa_hpux_in_solib_return_trampoline): Update.
	* rs6000-tdep.c (rs6000_in_solib_return_trampoline): Update.
	* m32r-linux-tdep.c (m32r_linux_pc_in_sigtramp): Change
	type of "name" parameter to const char * from char *.
	* skip.c (skip_function_pc): Ditto.
	* sparc-sol2-tdep.c (sparc_sol2_pc_in_sigtramp): Ditto.
	* sparc-tdep.h (sparc_sol2_pc_in_sigtramp): Update.
	* sparc64fbsd-tdep.c (sparc64fbsd_pc_in_sigtramp): Ditto.
	* sparc64nbsd-tdep.c (sparc64nbsd_pc_in_sigtramp): Ditto.
	* sparc64obsd-tdep.c (sparc64obsd_pc_in_sigtramp): Ditto.
	* sparcnbsd-tdep.c (sparc32nbsd_pc_in_sigtramp): Ditto.
	* sparcobsd-tdep.c (sparc32obsd_pc_in_sigtramp): Ditto.
	* nbsd-tdep.c (nbsd_pc_in_sigtramp): Similary for "func_name".
	* nbsd-tdep.h (nbsd_pc_in_sigtramp): Update.
2012-02-02 20:19:17 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
Tom Tromey 0af1e9a54b * elfread.c (elf_symtab_read): Put the filename in the filename
bcache.
2011-12-21 21:30:31 +00:00
Joel Brobecker 828cfa8d0b try ignoring bad PLT entries in ELF symbol tables
Comment says it all:

         /* On ia64-hpux, we have discovered that the system linker
            adds undefined symbols with nonzero addresses that cannot
            be right (their address points inside the code of another
            function in the .text section).  This creates problems
            when trying to determine which symbol corresponds to
            a given address.

            We try to detect those buggy symbols by checking which
            section we think they correspond to.  Normally, PLT symbols
            are stored inside their own section, and the typical name
            for that section is ".plt".  So, if there is a ".plt"
            section, and yet the section name of our symbol does not
            start with ".plt", we ignore that symbol.  */

gdb/ChangeLog:

        * elfread.c (elf_symtab_read): Ignore undefined symbols with
        nonzero addresses if they do not correspond to a .plt section
        when one is available in the objfile.
2011-12-19 04:36:29 +00:00
Tom Tromey f8eba3c616 the "ambiguous linespec" series
gdb
2011-12-06  Joel Brobecker  <brobecker@acacore.com>

        * language.h (struct language_defn): Add new component
        la_symbol_name_compare.
        * symfile.h (struct quick_symbol_functions): Update the profile
        of parameter "name_matcher" for the expand_symtabs_matching
        method.  Update the documentation accordingly.
        * ada-lang.h (ada_name_for_lookup): Add declaration.
        * ada-lang.c (ada_name_for_lookup): New function, extracted out
        from ada_iterate_over_symbols.
        (ada_iterate_over_symbols): Do not encode symbol name anymore.
        (ada_expand_partial_symbol_name): Adjust profile.
        (ada_language_defn): Add value for la_symbol_name_compare field.
        * linespec.c: #include "ada-lang.h".
        (iterate_name_matcher): Add language parameter. Replace call
        to strcmp_iw by call to language->la_symbol_name_compare.
        (decode_variable): Encode COPY if current language is Ada.
        * dwarf2read.c (dw2_expand_symtabs_matching): Adjust profile
        of name_matcher parameter.  Adjust call to name_matcher.
        * psymtab.c (expand_symtabs_matching_via_partial): Likewise.
        (expand_partial_symbol_names): Update profile of parameter "fun".
        * psymtab.h (expand_partial_symbol_names): Update profile of
        parameter "fun".
        * symtab.c (demangle_for_lookup): Update function documentation.
        (search_symbols_name_matches): Add language parameter.
        (expand_partial_symbol_name): Likewise.
        * c-lang.c (c_language_defn, cplus_language_defn)
        (asm_language_defn, minimal_language_defn): Add value for
        la_symbol_name_compare field.
        * d-lang.c (d_language_defn): Likewise.
        * f-lang.c (f_language_defn): Ditto.
        * jv-lang.c (java_language_defn): Ditto.
        * m2-lang.c (m2_language_defn): Ditto.
        * objc-lang.c (objc_language_defn): Ditto.
        * opencl-lang.c (opencl_language_defn): Ditto.
        * p-lang.c (pascal_language_defn): Ditto.
        * language.c (unknown_language_defn, auto_language_defn)
        (local_language_defn): Ditto.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* linespec.c (iterate_over_all_matching_symtabs): Use
	LA_ITERATE_OVER_SYMBOLS.
	(lookup_prefix_sym, add_matching_symbols_to_info): Likewise.
	(find_function_symbols, decode_variable): Remove Ada special
	case.
	* language.h (struct language_defn) <la_iterate_over_symbols>: New
	field.
	(LA_ITERATE_OVER_SYMBOLS): New macro.
	* language.c (unknown_language_defn, auto_language_defn)
	(local_language_defn): Update.
	* c-lang.c (c_language_defn, cplus_language_defn)
	(asm_language_defn, minimal_language_defn): Update.
	* d-lang.c (d_language_defn): Update.
	* f-lang.c (f_language_defn): Update.
	* jv-lang.c (java_language_defn): Update.
	* m2-lang.c (m2_language_defn): Update.
	* objc-lang.c (objc_language_defn): Update.
	* opencl-lang.c (opencl_language_defn): Update.
	* p-lang.c (pascal_language_defn): Update.
	* ada-lang.c (ada_iterate_over_symbols): New function.
	(ada_language_defn): Update.

2011-12-06  Tom Tromey  <tromey@redhat.com>
	    Joel Brobecker  <brobecker@acacore.com>

	PR breakpoints/13105, PR objc/8341, PR objc/8343, PR objc/8366,
	PR objc/8535, PR breakpoints/11657, PR breakpoints/11970,
	PR breakpoints/12023, PR breakpoints/12334, PR breakpoints/12856,
	PR shlibs/8929, PR shlibs/7393:
	* python/py-type.c (compare_maybe_null_strings): Rename from
	compare_strings.
	(check_types_equal): Update.
	* utils.c (compare_strings): New function.
	* tui/tui-winsource.c (tui_update_breakpoint_info): Update for
	location changes.
	* tracepoint.c (scope_info): Update.
	(trace_find_line_command): Use DECODE_LINE_FUNFIRSTLINE.
	* symtab.h (iterate_over_minimal_symbols)
	(iterate_over_some_symtabs, iterate_over_symtabs)
	(find_pcs_for_symtab_line, iterate_over_symbols)
	(demangle_for_lookup): Declare.
	(expand_line_sal): Remove.
	* symtab.c (iterate_over_some_symtabs, iterate_over_symtabs)
	(lookup_symtab_callback): New functions.
	(lookup_symtab): Rewrite.
	(demangle_for_lookup): New function, extract from
	lookup_symbol_in_language.
	(lookup_symbol_in_language): Use it.
	(iterate_over_symbols): New function.
	(find_line_symtab): Update.
	(find_pcs_for_symtab_line): New functions.
	(find_line_common): Add 'start' argument.
	(decode_line_spec): Update.  Change argument to 'flags', change
	interpretation.
	(append_expanded_sal): Remove.
	(append_exact_match_to_sals): Remove.
	(expand_line_sal): Remove.
	* symfile.h (struct quick_symbol_functions) <lookup_symtab>:
	Remove.
	<map_symtabs_matching_filename>: New field.
	* stack.c (func_command): Only look in the current program space.
	Use DECODE_LINE_FUNFIRSTLINE.
	* source.c (line_info): Set pspace on sal.  Check program space in
	the loop.  Use DECODE_LINE_LIST_MODE.
	(select_source_symtab): Use DECODE_LINE_FUNFIRSTLINE.
	* solib-target.c: Remove DEF_VEC_I(CORE_ADDR).
	* python/python.c (gdbpy_decode_line): Update.
	* psymtab.c (partial_map_expand_apply): New function.
	(partial_map_symtabs_matching_filename): Rename from
	lookup_partial_symbol.  Update arguments.
	(lookup_symtab_via_partial_symtab): Remove.
	(psym_functions): Update.
	* objc-lang.h (parse_selector, parse_method): Don't declare.
	(find_imps): Update.
	* objc-lang.c (parse_selector, parse_method): Now static.
	(find_methods): Change arguments.  Fill in a vector of symbol
	names.
	(uniquify_strings): New function.
	(find_imps): Change arguments.
	* minsyms.c (iterate_over_minimal_symbols): New function.
	* linespec.h (enum decode_line_flags): New.
	(struct linespec_sals): New.
	(struct linespec_result) <canonical>: Remove.
	<pre_expanded, addr_string, sals>: New fields.
	(destroy_linespec_result, make_cleanup_destroy_linespec_result)
	(decode_line_full): Declare.
	(decode_line_1): Update.
	* linespec.c (struct address_entry, struct linespec_state, struct
	collect_info): New types.
	(add_sal_to_sals_basic, add_sal_to_sals, hash_address_entry)
	(eq_address_entry, maybe_add_address): New functions.
	(total_number_of_methods): Remove.
	(iterate_name_matcher, iterate_over_all_matching_symtabs): New
	functions.
	(find_methods): Change arguments.  Don't canonicalize input.
	Simplify logic.
	(add_matching_methods, add_constructors)
	(build_canonical_line_spec): Remove.
	(filter_results, convert_results_to_lsals): New functions.
	(decode_line_2): Change arguments.  Rewrite for new data
	structures.
	(decode_line_internal): Rename from decode_line_1.  Change
	arguments.  Add cleanups.  Update for new data structures.
	(linespec_state_constructor, linespec_state_destructor)
	(decode_line_full, decode_line_1): New functions.
	(decode_indirect): Change arguments.  Update.
	(locate_first_half): Use skip_spaces.
	(decode_objc): Change arguments.  Update for new data structures.
	Simplify logic.
	(decode_compound): Change arguments.  Add cleanups.  Remove
	fallback code, replace with error.
	(struct decode_compound_collector): New type.
	(collect_one_symbol): New function.
	(lookup_prefix_sym): Change arguments.  Update.
	(compare_symbol_name, add_all_symbol_names_from_pspace)
	(find_superclass_methods ): New functions.
	(find_method): Rewrite.
	(struct symtab_collector): New type.
	(add_symtabs_to_list, collect_symtabs_from_filename): New
	functions.
	(symtabs_from_filename): Change API.  Rename from
	symtab_from_filename.
	(collect_function_symbols): New function.
	(find_function_symbols): Change API.  Rename from
	find_function_symbol.  Rewrite.
	(decode_all_digits): Change arguments.  Rewrite.
	(decode_dollar): Change arguments.  Use decode_variable.
	(decode_label): Change arguments.  Rewrite.
	(collect_symbols): New function.
	(minsym_found): Change arguments.  Rewrite.
	(check_minsym, search_minsyms_for_name)
	(add_matching_symbols_to_info): New function.
	(decode_variable): Change arguments.  Iterate over all symbols.
	(symbol_found): Remove.
	(symbol_to_sal): New function.
	(init_linespec_result, destroy_linespec_result)
	(cleanup_linespec_result, make_cleanup_destroy_linespec_result):
	New functions.
	(decode_digits_list_mode, decode_digits_ordinary): New functions.
	* dwarf2read.c (dw2_map_expand_apply): New function.
	(dw2_map_symtabs_matching_filename): Rename from
	dw2_lookup_symtab.  Change arguments.
	(dwarf2_gdb_index_functions): Update.
	* dwarf2loc.c: Remove DEF_VEC_I(CORE_ADDR).
	* defs.h (compare_strings): Declare.
	* cli/cli-cmds.c (compare_strings): Move to utils.c.
	(edit_command, list_command): Use DECODE_LINE_LIST_MODE.  Call
	filter_sals.
	(compare_symtabs, filter_sals): New functions.
	* breakpoint.h (struct bp_location) <line_number, source_file>:
	New fields.
	(struct breakpoint) <line_number, source_file>: Remove.
	<filter>: New field.
	* breakpoint.c (print_breakpoint_location, init_raw_breakpoint)
	(momentary_breakpoint_from_master, add_location_to_breakpoint):
	Update for changes to locations.
	(init_breakpoint_sal): Add 'filter' argument.  Set 'filter' on
	breakpoint.
	(create_breakpoint_sal): Add 'filter' argument.
	(remove_sal, expand_line_sal_maybe): Remove.
	(create_breakpoints_sal): Remove 'sals' argument.  Handle
	pre-expanded sals and the filter.
	(parse_breakpoint_sals): Use decode_line_full.
	(check_fast_tracepoint_sals): Use get_sal_arch.
	(create_breakpoint): Create a linespec_sals.  Update.
	(break_range_command): Use decode_line_full.  Update.
	(until_break_command): Update.
	(clear_command): Update match conditions for linespec.c changes.
	Use DECODE_LINE_LIST_MODE.
	(say_where): Update for changes to locations.
	(bp_location_dtor): Free 'source_file'.
	(base_breakpoint_dtor): Free 'filter'.  Don't free 'source_file'.
	(update_static_tracepoint): Update for changes to locations.
	(update_breakpoint_locations): Disable ranged breakpoint if too
	many locations match.  Update.
	(addr_string_to_sals): Use decode_line_full.  Resolve all sal
	PCs.
	(breakpoint_re_set_default): Don't call expand_line_sal_maybe.
	(decode_line_spec_1): Update.  Change argument name to 'flags',
	change interpretation.
	* block.h (block_containing_function): Declare.
	* block.c (block_containing_function): New function.
	* skip.c (skip_function_command): Update.
	(skip_re_set): Update.
	* infcmd.c (jump_command): Use DECODE_LINE_FUNFIRSTLINE.
	* mi/mi-main.c (mi_cmd_trace_find): Use DECODE_LINE_FUNFIRSTLINE.
	* NEWS: Add entry.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* elfread.c (elf_gnu_ifunc_resolver_return_stop): Allow
	breakpoint's pspace to be NULL.
	* breakpoint.h (struct breakpoint) <pspace>: Update comment.
	* breakpoint.c (init_raw_breakpoint): Conditionally set
	breakpoint's pspace.
	(init_breakpoint_sal): Don't set breakpoint's pspace.
	(prepare_re_set_context): Conditionally switch program space.
	(addr_string_to_sals): Check executing_startup on location's
	program space.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* breakpoint.h (enum enable_state) <bp_startup_disabled>: Remove.
	* breakpoint.c (should_be_inserted): Explicitly check if program
	space is executing startup.
	(describe_other_breakpoints): Update.
	(disable_breakpoints_before_startup): Change executing_startup
	earlier.  Remove loop.
	(enable_breakpoints_after_startup): Likewise.
	(init_breakpoint_sal): Don't use bp_startup_disabled.
	(create_breakpoint): Don't use bp_startup_disabled.
	(update_global_location_list): Use should_be_inserted.
	(bkpt_re_set): Update.
gdb/testsuite
2011-12-06  Joel Brobecker  <brobecker@acacore.com>

        * gdb.ada/fullname_bp.exp: Add tests for other valid linespecs
        involving a fully qualified function name.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.ada/homonym.exp: Add three breakpoint tests.

2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.base/solib-weak.exp (do_test): Remove kfail.
	* gdb.trace/tracecmd.exp: Disable pending breakpoints earlier.
	* gdb.objc/objcdecode.exp: Update for output changes.
	* gdb.linespec/linespec.exp: New file.
	* gdb.linespec/lspec.cc: New file.
	* gdb.linespec/lspec.h: New file.
	* gdb.linespec/body.h: New file.
	* gdb.linespec/base/two/thefile.cc: New file.
	* gdb.linespec/base/one/thefile.cc: New file.
	* gdb.linespec/Makefile.in: New file.
	* gdb.cp/templates.exp (test_template_breakpoints): Update for
	output changes.
	* gdb.cp/re-set-overloaded.exp: Remove kfail.
	* gdb.cp/ovldbreak.exp: Update for output changes.  "all" test now
	makes one breakpoint.
	* gdb.cp/method2.exp (test_break): Update for output changes.
	* gdb.cp/mb-templates.exp: Update for output changes.
	* gdb.cp/mb-inline.exp: Update for output changes.
	* gdb.cp/mb-ctor.exp: Update for output changes.
	* gdb.cp/ovsrch.exp: Use fully-qualified names.
	* gdb.base/solib-symbol.exp: Run to main later.  Breakpoint now
	has multiple matches.
	* gdb.base/sepdebug.exp: Disable pending breakpoints.  Update for
	error message change.
	* gdb.base/list.exp (test_list_filename_and_number): Update for
	error message change.
	* gdb.base/break.exp: Disable pending breakpoints.  Update for
	output changes.
	* configure.ac: Add gdb.linespec.
	* configure: Rebuild.
	* Makefile.in (ALL_SUBDIRS): Add gdb.linespec.
gdb/doc
2011-12-06  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Set Breaks): Update for new behavior.
2011-12-06 18:54:43 +00:00
Pedro Alves 7f86f0587f 2011-08-09 Pedro Alves <pedro@codesourcery.com>
gdb/
	* elfread.c (elf_symtab_read): Ditto.
	* maint.c (maintenance_command): Ditto.
	* somread.c (som_symtab_read): Ditto.
	* solib.c (solib_find, solib_map_sections, update_solib_list)
	(solib_add, info_sharedlibrary_command, solib_name_from_address)
	(solib_create_inferior_hook, in_solib_dynsym_resolve_code)
	(sharedlibrary_command, no_shared_libraries): Rework comments.
	* solib-irix.c (locate_base, disable_break, enable_break)
	(irix_solib_create_inferior_hook, irix_solib_create_inferior_hook)
	(irix_current_sos, irix_open_symbol_file_object)
	(irix_special_symbol_handling): Ditto.
	* solib-sunos.c (locate_base, first_link_map_member)
	(sunos_current_sos, disable_break, enable_break)
	(sunos_special_symbol_handling, sunos_solib_create_inferior_hook):
	Ditto.
	* solib-svr4.c (bfd_lookup_symbol, elf_locate_base, locate_base)
	(open_symbol_file_object, svr4_current_sos, enable_break)
	(svr4_special_symbol_handling, svr4_solib_create_inferior_hook):
	Ditto.
	* solib-frv.c (bfd_lookup_symbol, open_symbol_file_object)
	(frv_current_sos, enable_break, frv_special_symbol_handling)
	(frv_solib_create_inferior_hook): Ditto.
	* solist.h (struct target_so_ops): Extend the comments of the
	special_symbol_handling, current_sos and open_symbol_file_object
	methods.
2011-08-09 12:51:47 +00:00
Paul Pluzhnikov dea91a5c34 Cleanup: kill trailing whitespace 2011-07-25 22:23:38 +00:00
Paul Pluzhnikov 3807f6133e 2011-07-23 Paul Pluzhnikov <ppluzhnikov@google.com>
* elfread.c (elf_rel_plt_read): Fix off-by-one bug.
2011-07-23 16:49:16 +00:00
Tristan Gingold 251d32d96e 2011-05-26 Tristan Gingold <gingold@adacore.com>
* symfile.h (struct dwarf2_section_names): New type.
	(struct dwarf2_debug_sections): New type.
	(dwarf2_has_info): Add parameter.
	* dwarf2read.c (dwarf2_elf_names): New variable.
	(INFO_SECTION, ABBREV_SECTION, LINE_SECTION, LOC_SECTION)
	(MACINFO_SECTION, STR_SECTION, RANGES_SECTION, TYPES_SECTION)
	(FRAME_SECTION, EH_FRAME_SECTION, GDB_INDEX_SECTION): Remove.
	(dwarf2_has_info): Add names parameter.  Pass names
	to dwarf2_locate_sections.
	(section_is_p): Rewrite using the names parameter.
	(dwarf2_locate_sections): Use section names from the names parameter.
	* coffread.c (coff_symfile_read): Adjust call to dwarf2_has_info.
	* elfread.c (read_psyms): Ditto.
	* machoread.c (macho_symfile_read): Ditto.
2011-05-26 07:47:10 +00:00
Joel Brobecker dd3295eed0 Revert "elfread.c (elf_symtab_read): Stop memory leak"
It turns out that this change is not correct, and it causes a crash
on sparc-solaris while trying to load ld.so.  This is because the
memory is actually still referenced after elf_symtab_read completes.

gdb/ChangeLog:

        * elfread.c (elf_symtab_read): Revert the previous change
        that tried to stop a memory leak.
2011-05-03 16:22:39 +00:00
Jan Kratochvil 3e03848b6c gdb/
* elfread.c (elf_symfile_read): Protect dwarf2_initialize_objfile by
	!objfile_has_partial_symbols.  New comment.
	* objfiles.c (objfile_has_partial_symbols): Call HAS_SYMBOLS if
	SYM_READ_PSYMBOLS is not present. Extend the comment.
	* symfile.h (struct sym_fns): Extend the sym_read_psymbols comment.

gdb/testsuite/
	* gdb.base/gdbindex-stabs-dwarf.c: New file.
	* gdb.base/gdbindex-stabs.c: New file.
	* gdb.base/gdbindex-stabs.exp: New file.
2011-04-25 19:38:16 +00:00
Jan Kratochvil 63524580f8 bfd/
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Do not check for
	SEC_LOAD.

gdb/
	Fix convert_code_addr_to_desc_addr for ppc64 files after eu-strip.
	* elfread.c (elf_symfile_read): New variable synth_abfd, pass it to
	bfd_get_synthetic_symtab.
	* jit.c (jit_register_code): Pass NULL to the new parameter parent.
	* machoread.c (macho_add_oso_symfile): Pass main_objfile to the new
	parameter parent, remove the call to add_separate_debug_objfile.
	* solib.c (solib_read_symbols): Pass NULL to the new parameter parent.
	* symfile-mem.c (symbol_file_add_from_memory): Likewise.
	* symfile.c (symbol_file_add_with_addrs_or_offsets): New parameter
	parent, new comment for it, call add_separate_debug_objfile for it.
	(symbol_file_add_separate): Pass objfile as the parameter parent,
	remove the call to add_separate_debug_objfile.
	(symbol_file_add_from_bfd): New parameter parent, pass it.
	(symbol_file_add): Pass NULL to the new parameter parent.
	* symfile.h (symbol_file_add_from_bfd): New parameter parent.

gdb/testsuite/
	* gdb.base/eu-strip-infcall.c: New file.
	* gdb.base/eu-strip-infcall.exp: New file.
2011-04-17 18:38:46 +00:00
Jan Kratochvil 90359a1673 gdb/
* elfread.c (elf_symtab_read): Do not ignore .L symbols if they are
	BSF_SYNTHETIC.

gdb/testsuite/
	* gdb.base/callfuncs.c (Lcallfunc, callfunc): New functions.
	* gdb.base/callfuncs.exp (print callfunc (Lcallfunc, 5)): New test.
2011-04-17 18:09:02 +00:00
Thiago Jung Bauermann f13101077f 2011-03-31 Thiago Jung Bauermann <bauerman@br.ibm.com>
Sergio Durigan Junior  <sergiodj@linux.vnet.ibm.com>

	Implement support for PowerPC BookE ranged breakpoints.

gdb/
	* NEWS: Mention support for ranged breakpoints on embedded PowerPC.
	* breakpoint.h (struct bp_target_info) <length>: New member
	variable.
	(struct breakpoint_ops) <breakpoint_hit>: Take struct bp_location
	instead of struct breakpoint as argument, and also add ASPACE
	and BP_ADDR arguments.  Update all callers.
	(struct breakpoint_ops) <print_one_detail>: New method.
	(struct breakpoint) <addr_string_range_end>: New member variable.
	* breakpoint.c (breakpoint_location_address_match): Add function
	prototype.
	(insert_bp_location): Set bl->target_info.length.
	(breakpoint_here_p): Call breakpoint_location_address_match.
	(moribund_breakpoint_here_p): Likewise.
	(regular_breakpoint_inserted_here_p): Likewise.
	(breakpoint_thread_match): Likewise.
	(bpstat_stop_status): Likewise.
	(bpstat_check_location): Move call to
	breakpoint_ops.breakpoint_hit to the top.
	(print_one_breakpoint_location): Call
	breakpoint_ops.print_one_detail if available.
	(breakpoint_address_match_range): New function.
	(breakpoint_location_address_match): Likewise.
	(breakpoint_locations_match): Compare the length field of the
	locations too.
	(hw_breakpoint_used_count): Count resources used by all locations
	in a breakpoint, and use breakpoint_ops.resources_needed if
	available.
	(breakpoint_hit_ranged_breakpoint): New function.
	(resources_needed_ranged_breakpoint): Likewise.
	(print_it_ranged_breakpoint): Likewise.
	(print_one_ranged_breakpoint): Likewise.
	(print_one_detail_ranged_breakpoint): Likewise.
	(print_mention_ranged_breakpoint): Likewise.
	(print_recreate_ranged_breakpoint): Likewise.
	(ranged_breakpoint_ops): New structure.
	(find_breakpoint_range_end): New function.
	(break_range_command): Likewise.
	(delete_breakpoint): Free addr_string_range_end.
	(update_breakpoint_locations): Add SALS_END argument.  Update
	all callers.  Calculate breakpoint length if a non-zero SALS_END
	is given.  Call breakpoint_locations_match instead of
	breakpoint_address_match.
	(reset_breakpoint): Find SaL of the end of the range if B is a
	ranged breakpoint.
	(_initialize_breakpoint): Register break-range command.
	* defs.h (print_core_address): Add function prototype.
	* ppc-linux-nat.c (ppc_linux_ranged_break_num_registers): New
	function.
	(ppc_linux_insert_hw_breakpoint): Support ranged breakpoints.
	(ppc_linux_remove_hw_breakpoint): Likewise.
	(_initialize_ppc_linux_nat): Initialize
	to_ranged_break_num_registers.
	* target.c (update_current_target): Add comment about
	to_ranged_break_num_registers.
	(target_ranged_break_num_registers): New function.
	* target.h (struct target_ops) <to_ranged_break_num_registers>:
	New method.
	(target_ranged_break_num_registers): Add function prototype.
	* ui-out.c (ui_out_field_core_addr): Move address-printing logic to ...
	* utils.c (print_core_address): ... here.

gdb/doc/
	* gdb.texinfo (PowerPC Embedded): Document ranged breakpoints.
2011-03-31 14:32:49 +00:00
Jan Kratochvil 0e30163f12 gdb/
Support resolution of STT_GNU_IFUNC via breakpoints.
	* breakpoint.c (print_it_typical): Support bp_gnu_ifunc_resolver and
	bp_gnu_ifunc_resolver_return.
	(bpstat_what): Rename parameter to bs_head, new variable bs, adjust
	the loop.  Support bp_gnu_ifunc_resolver and
	bp_gnu_ifunc_resolver_return.  New comment after the loop.  New loop
	for bp_gnu_ifunc_resolver and bp_gnu_ifunc_resolver_return
	breakpoints.
	(bptype_string, print_one_breakpoint_location): Support
	bp_gnu_ifunc_resolver and bp_gnu_ifunc_resolver_return.
	(user_settable_breakpoint): Return true also for
	bp_gnu_ifunc_resolver.
	(allocate_bp_location): Support bp_gnu_ifunc_resolver and
	bp_gnu_ifunc_resolver_return.
	(set_breakpoint_location_function): New parameter explicit_loc,
	describe it.  Call find_pc_partial_function_gnu_ifunc with new
	variable IS_GNU_IFUNC and adjust the address for STT_GNU_IFUNC if
	EXPLICIT_LOC is not set.
	(set_raw_breakpoint): Set EXPLICIT_LOC for
	set_breakpoint_location_function.
	(clone_momentary_breakpoint): Use true for EXPLICIT_LOC of
	set_breakpoint_location_function.
	(mention): Support bp_gnu_ifunc_resolver and
	bp_gnu_ifunc_resolver_return.
	(add_location_to_breakpoint): Set EXPLICIT_LOC for
	set_breakpoint_location_function.
	(update_breakpoint_locations): Remove static.
	(breakpoint_re_set_one): Support bp_gnu_ifunc_resolver and
	bp_gnu_ifunc_resolver_return.
	* breakpoint.h (enum bptype): New fields bp_gnu_ifunc_resolver and
	bp_gnu_ifunc_resolver_return.
	(update_breakpoint_locations): New declaration.
	* elfread.c: Include gdbthread.h and regcache.h.
	(elf_gnu_ifunc_resolver_stop, elf_gnu_ifunc_resolver_return_stop): New
	functions.
	(elf_gnu_ifunc_fns): Install them.
	* minsyms.c (stub_gnu_ifunc_resolver_stop)
	(stub_gnu_ifunc_resolver_return_stop): New functions.
	(stub_gnu_ifunc_fns): Install them.
	* symtab.h (struct gnu_ifunc_fns): New fields gnu_ifunc_resolver_stop
	and gnu_ifunc_resolver_return_stop.
	(gnu_ifunc_resolver_stop, gnu_ifunc_resolver_return_stop): New.
2011-03-28 20:29:51 +00:00
Jan Kratochvil 07be84bf8f gdb/
STT_GNU_IFUNC reader implementation.
	* elfread.c: Include gdbtypes.h, value.h and infcall.h.
	(SYMBOL_GOT_PLT_SUFFIX, elf_rel_plt_read)
	(elf_objfile_gnu_ifunc_cache_data, struct elf_gnu_ifunc_cache)
	(elf_gnu_ifunc_cache_hash, elf_gnu_ifunc_cache_eq)
	(elf_gnu_ifunc_record_cache, elf_gnu_ifunc_resolve_by_cache)
	(elf_gnu_ifunc_resolve_by_got, elf_gnu_ifunc_resolve_name)
	(elf_gnu_ifunc_resolve_addr): New.
	(elf_symfile_read): Call elf_rel_plt_read.
	(elf_gnu_ifunc_fns): New.
	(_initialize_elfread): Initialize elf_objfile_gnu_ifunc_cache_data.
	Install elf_gnu_ifunc_fns.
	* infcall.c (find_function_return_type): New function.
	(find_function_addr): Resolve TYPE_GNU_IFUNC functions, if possible.
	* minsyms.c (stub_gnu_ifunc_resolve_addr)
	(stub_gnu_ifunc_resolve_name): New functions.
	(stub_gnu_ifunc_fns, gnu_ifunc_fns_p): New variables.
	* symtab.h (struct gnu_ifunc_fns, gnu_ifunc_resolve_addr)
	(gnu_ifunc_resolve_name, gnu_ifunc_fns_p): New.
2011-03-28 20:26:24 +00:00
Jan Kratochvil 0875794a96 gdb/
GDB internal type support for STT_GNU_IFUNC.
	* elfread.c (record_minimal_symbol): Support mst_text_gnu_ifunc.
	(elf_symtab_read): Set mst_text_gnu_ifunc for
	BSF_GNU_INDIRECT_FUNCTION.
	* eval.c (evaluate_subexp_standard): Support TYPE_GNU_IFUNC.
	* gdbtypes.c (init_type): Support TYPE_FLAG_GNU_IFUNC,
	builtin_func_func, nodebug_text_gnu_ifunc_symbol and
	nodebug_got_plt_symbol.
	* gdbtypes.h (enum type_flag_value): New entry TYPE_FLAG_GNU_IFUNC.
	(TYPE_GNU_IFUNC): New.
	(struct main_type): New field flag_gnu_ifunc.
	(struct builtin_type): New field builtin_func_func.
	(struct objfile_type): New fields nodebug_text_gnu_ifunc_symbol and
	nodebug_got_plt_symbol.
	* minsyms.c (lookup_minimal_symbol_text): Support mst_text_gnu_ifunc.
	(in_gnu_ifunc_stub): New.
	(prim_record_minimal_symbol, find_solib_trampoline_target): Support
	mst_text_gnu_ifunc.
	* parse.c (write_exp_msymbol): New variable ifunc_msym.  Detect and
	support mst_text_gnu_ifunc.  Support mst_slot_got_plt.
	* solib-svr4.c (svr4_in_dynsym_resolve_code): Return true also for
	in_gnu_ifunc_stub.
	* symmisc.c (dump_msymbols): Support mst_text_gnu_ifunc.
	* symtab.c (search_symbols): Likewise.
	* symtab.h (enum minimal_symbol_type): New fields mst_text_gnu_ifunc
	and mst_slot_got_plt.
	(in_gnu_ifunc_stub): New declaration.
2011-03-28 20:21:04 +00:00
Kai Tietz 0ba1096ad5 2011-03-23 Kai Tietz <ktietz@redhat.com>
* breakpoint.c (clear_command): Use filename_cmp
	instead of strcmp for comparison.
	* buildsym.c (watch_main_source_file_lossage): Likewise.
	(patch_subfile_names): Use IS_DIR_SEPARATOR instead of
	checking just for slash.
	* dbxread.c (read_dbx_symtab): Use lbasename instead of
	strrchr and filename_cmp instead of strcmp for filenames.
	(add_old_header_file): Use filename_cmp
	instead of strcmp for comparison.
	* exec.c (exec_set_section_address): Likewise.
	* macrotab.c (macro_lookup_inclusion): Likewise.
	(macro_lookup_inclusion): Likewise.
	* elfread.c (_initialize_elfread): Likewise.
	(elfstab_offset_sections): Likewise.
	(elfstab_offset_sections): Use lbasename instead of
	strrchr.
	* mdebugread.c (parse_partial_symbols): Likewise.
	(arse_partial_symbols): Use filename_(n)cmp instead of
	str(n)cmp for comparison.
	* minsyms.c (lookup_minimal_symbol): Likewise.
	* psymtab.c (read_psymtabs_with_filename): Likewise.
	* solib.c (solib_read_symbols): Likewise.
	(reload_shared_libraries_1): Likewise.
	* symmisc.c (maintenance_print_symbols): Likewise.
	* symfile.c (separate_debug_file_exists): Likewise.
	(reread_symbols): Likewise.
	(find_separate_debug_file_by_debuglink): Likewise.
	* remote-fileio.c (remote_fileio_func_rename): Likewise.
	* source.c (add_path): Likewise.
	* symtab.c (filename_seen): Likewise.
	(file_matches): Likewise.
	(print_symbol_info): Likewise.
	(maybe_add_partial_symtab_filename): Likewise.
	(make_source_files_completion_list): Likewise.
	* xml-syscall.c (init_sysinfo): Likewise.
	* windows-nat.c (_initialize_check_for_gdb_ini): Use
	IS_DIR_SEPARATOR for checking for trailing path separator.
2011-03-23 18:23:56 +00:00
Michael Snyder 69feea6fe7 2011-03-05 Michael Snyder <msnyder@vmware.com>
* elfread.c (elf_symtab_read): Stop memory leak.
2011-03-07 19:44:19 +00:00
Tom Tromey b11896a527 * xcoffread.c (xcoff_sym_fns): Update.
* symfile.h (struct sym_fns) <sym_read_psymbols>: New field.
	(enum symfile_add_flags) <SYMFILE_NO_READ>: New constant.
	* symfile.c (syms_from_objfile): Handle SYMFILE_NO_READ.
	(symbol_file_add_with_addrs_or_offsets): Likewise.
	(reread_symbols): Handle OBJF_PSYMTABS_READ.
	* somread.c (som_sym_fns): Update.
	* psymtab.h (require_partial_symbols): Declare.
	* psymtab.c (require_partial_symbols): New function.
	(ALL_OBJFILE_PSYMTABS_REQUIRED): New macro.
	(ALL_OBJFILE_PSYMTABS): Undef.
	(ALL_PSYMTABS): Move from psympriv.h.
	(lookup_partial_symtab, find_pc_sect_psymtab)
	(lookup_symbol_aux_psymtabs, relocate_psymtabs)
	(find_last_source_symtab_from_partial)
	(forget_cached_source_info_partial)
	(print_psymtab_stats_for_objfile, read_symtabs_for_function)
	(expand_partial_symbol_tables, read_psymtabs_with_filename)
	(map_symbol_names_psymtab, map_symbol_filenames_psymtab)
	(find_symbol_file_from_partial, map_matching_symbols_psymtab)
	(expand_symtabs_matching_via_partial, maintenance_info_psymtabs):
	Use ALL_OBJFILE_PSYMTABS_REQUIRED.
	* psympriv.h (ALL_PSYMTABS): Move to psymtab.c.
	* objfiles.h (OBJF_PSYMTABS_READ): New macro.
	* objfiles.c (objfile_has_partial_symbols): Handle lazily-read
	psymtabs.
	* mipsread.c (ecoff_sym_fns): Update.
	* machoread.c (macho_sym_fns): Update.
	* elfread.c (elf_symfile_read): Set up for lazy psymtab reading.
	(read_psyms): New function.
	(elf_sym_fns, elf_sym_fns_gdb_index): Update.
	(elf_sym_fns_lazy_psyms): New global.
	* dwarf2read.c (dwarf2_initialize_objfile): Don't call
	dwarf2_build_psymtabs.
	* dbxread.c (aout_sym_fns): Update.
	* coffread.c (coff_sym_fns): Update.
2011-03-07 16:17:29 +00:00
Joel Brobecker c05d19c5b6 Minor reformatting in elfread.c:elf_symtab_read
gdb/ChangeLog:

        * elfread.c (elf_symtab_read): Minor reformatting.
2011-03-07 11:13:08 +00:00
Michael Snyder 0963b4bd45 2011-01-07 Michael Snyder <msnyder@vmware.com>
* ada-lang.c: Comment cleanup, mostly periods and spaces.
	* ada-lang.h: Ditto.
	* ada-tasks.c: Ditto.
	* ada-valprint.c: Ditto.
	* aix-threads.c: Ditto.
	* alpha-linux-nat.c: Ditto.
	* alpha-linux-tdep.c: Ditto.
	* alpha-mdebug-tdep.c: Ditto.
	* alpha-nat.c: Ditto.
	* alpha-osf1-tdep.c: Ditto.
	* alpha-tdep.c: Ditto.
	* alphabsd-nat.c: Ditto.
	* alphabsd-tdep.c: Ditto.
	* amd64-darwin-tdep.c: Ditto.
	* amd64-linux-nat.c: Ditto.
	* amd64-linux-tdep.c: Ditto.
	* amd64-sol2-tdep.c: Ditto.
	* amd64-tdep.c: Ditto.
	* amd64-fbsd-tdep.c: Ditto.
	* amd64-nbsd-tdep.c: Ditto.
	* amd64-obsd-tdep.c: Ditto.
	* amd64-linux-nat.c: Ditto.
	* amd64-linux-tdep.c: Ditto.
	* arm-tdep.c: Ditto.
	* arm-tdep.h: Ditto.
	* armnbsd-nat.c: Ditto.
	* avr-tdep.c: Ditto.
	* bfin-tdep.c: Ditto.
	* bsd-kvm.c: Ditto.
	* c-typeprintc: Ditto.
	* c-valprint.c: Ditto.
	* coff-pe-read.h: Ditto.
	* coffreead.c: Ditto.
	* cris-tdep.c: Ditto.
	* d-lang.c: Ditto.
	* darwin-nat-info.c: Ditto.
	* darwin-nat.c: Ditto.
	* dbug-rom.c: Ditto.
	* dbxread.c: Ditto.
	* dcache.c: Ditto.
	* dcache.h: Ditto.
	* dec-thread.c: Ditto.
	* defs.h: Ditto.
	* demangle.c: Ditto.
	* dicos-tdep.c: Ditto.
	* dictionary.c: Ditto.
	* dictionary.h: Ditto.
	* dink32-rom.c: Ditto.
	* disasm.c: Ditto.
	* doublest.c: Ditto.
	* dsrec.c: Ditto.
	* dummy-frame.c: Ditto.
	* dwarf2-frame.c: Ditto.
	* dwarf2expr.c: Ditto.
	* dwarf2loc.c: Ditto.
	* dwarf2read.c: Ditto.
	* elfread.c: Ditto.
	* environ.c: Ditto.
	* eval.c: Ditto.
	* event-top.h: Ditto.
	* exceptions.c: Ditto.
	* exceptions.h: Ditto.
	* exec.c: Ditto.
	* expprint.c: Ditto.
	* expression.h: Ditto.
	* f-exp.y: Ditto.
	* f-lang.c: Ditto.
	* f-lang.h: Ditto.
	* f-typeprint.c: Ditto.
	* f-valprint.c: Ditto.
	* fbsd-nat.c: Ditto.
	* findvar.c: Ditto.
	* fork-child.c: Ditto.
	* frame.c: Ditto.
	* frame.h: Ditto.
	* frv-linux-tdep.c: Ditto.
	* frv-tdep.c: Ditto.
	* gcore.c: Ditto.
	* gdb-stabs.h: Ditto.
	* gdb_assert.h: Ditto.
	* gdb_string.h: Ditto.
	* gdb_thread_db.h: Ditto.
	* gdb_wait.h: Ditto.
	* gdbarch.sh: Ditto.
	* gdbcore.h: Ditto.
	* gdbthread.h: Ditto.
	* gdbtypes.c: Ditto.
	* gdbtypes.h: Ditto.
	* gnu-nat.c: Ditto.
	* gnu-nat.h: Ditto.
	* gnu-v2-abi.c: Ditto.
	* gnu-v3-abi.c: Ditto.
	* go32-nat.c: Ditto.
	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.
2011-01-07 19:36:19 +00:00
Michael Snyder 3e43a32aaa 2011-01-05 Michael Snyder <msnyder@vmware.com>
* addrmap.c: Shorten lines of >= 80 columns.
	* arch-utils.c: Ditto.
	* arch-utils.h: Ditto.
	* ax-gdb.c: Ditto.
	* ax-general.c: Ditto.
	* bcache.c: Ditto.
	* blockframe.c: Ditto.
	* breakpoint.c: Ditto.
	* buildsym.c: Ditto.
	* c-lang.c: Ditto.
	* c-typeprint.c: Ditto.
	* charset.c: Ditto.
	* coffread.c: Ditto.
	* command.h: Ditto.
	* corelow.c: Ditto.
	* cp-abi.c: Ditto.
	* cp-namespace.c: Ditto.
	* cp-support.c: Ditto.
	* dbug-rom.c: Ditto.
	* dbxread.c: Ditto.
	* defs.h: Ditto.
	* dfp.c: Ditto.
	* dfp.h: Ditto.
	* dictionary.c: Ditto.
	* disasm.c: Ditto.
	* doublest.c: Ditto.
	* dwarf2-frame.c: Ditto.
	* dwarf2expr.c: Ditto.
	* dwarf2loc.c: Ditto.
	* dwarf2read.c: Ditto.
	* elfread.c: Ditto.
	* eval.c: Ditto.
	* event-loop.c: Ditto.
	* event-loop.h: Ditto.
	* exceptions.h: Ditto.
	* exec.c: Ditto.
	* expprint.c: Ditto.
	* expression.h: Ditto.
	* f-lang.c: Ditto.
	* f-valprint.c: Ditto.
	* findcmd.c: Ditto.
	* frame-base.c: Ditto.
	* frame-unwind.c: Ditto.
	* frame-unwind.h: Ditto.
	* frame.c: Ditto.
	* frame.h: Ditto.
	* gcore.c: Ditto.
	* gdb-stabs.h: Ditto.
	* gdb_assert.h: Ditto.
	* gdb_dirent.h: Ditto.
	* gdb_obstack.h: Ditto.
	* gdbcore.h: Ditto.
	* gdbtypes.c: Ditto.
	* gdbtypes.h: Ditto.
	* inf-ttrace.c: Ditto.
	* infcall.c: Ditto.
	* infcmd.c: Ditto.
	* inflow.c: Ditto.
	* infrun.c: Ditto.
	* inline-frame.h: Ditto.
	* language.c: Ditto.
	* language.h: Ditto.
	* libunwind-frame.c: Ditto.
	* libunwind-frame.h: Ditto.
	* linespec.c: Ditto.
	* linux-nat.c: Ditto.
	* linux-nat.h: Ditto.
	* linux-thread-db.c: Ditto.
	* machoread.c: Ditto.
	* macroexp.c: Ditto.
	* macrotab.c: Ditto.
	* main.c: Ditto.
	* maint.c: Ditto.
	* mdebugread.c: Ditto.
	* memattr.c: Ditto.
	* minsyms.c: Ditto.
	* monitor.c: Ditto.
	* monitor.h: Ditto.
	* objfiles.c: Ditto.
	* objfiles.h: Ditto.
	* osabi.c: Ditto.
	* p-typeprint.c: Ditto.
	* p-valprint.c: Ditto.
	* parse.c: Ditto.
	* printcmd.c: Ditto.
	* proc-events.c: Ditto.
	* procfs.c: Ditto.
	* progspace.c: Ditto.
	* progspace.h: Ditto.
	* psympriv.h: Ditto.
	* psymtab.c: Ditto.
	* record.c: Ditto.
	* regcache.c: Ditto.
	* regcache.h: Ditto.
	* remote-fileio.c: Ditto.
	* remote.c: Ditto.
	* ser-mingw.c: Ditto.
	* ser-tcp.c: Ditto.
	* ser-unix.c: Ditto.
	* serial.c: Ditto.
	* serial.h: Ditto.
	* solib-frv.c: Ditto.
	* solib-irix.c: Ditto.
	* solib-osf.c: Ditto.
	* solib-pa64.c: Ditto.
	* solib-som.c: Ditto.
	* solib-sunos.c: Ditto.
	* solib-svr4.c: Ditto.
	* solib-target.c: Ditto.
	* solib.c: Ditto.
	* somread.c: Ditto.
	* source.c: Ditto.
	* stabsread.c: Ditto.
	* stabsread.c: Ditto.
	* stack.c: Ditto.
	* stack.h: Ditto.
	* symfile-mem.c: Ditto.
	* symfile.c: Ditto.
	* symfile.h: Ditto.
	* symmisc.c: Ditto.
	* symtab.c: Ditto.
	* symtab.h: Ditto.
	* target-descriptions.c: Ditto.
	* target-memory.c: Ditto.
	* target.c: Ditto.
	* target.h: Ditto.
	* terminal.h: Ditto.
	* thread.c: Ditto.
	* top.c: Ditto.
	* tracepoint.c: Ditto.
	* tracepoint.h: Ditto.
	* ui-file.c: Ditto.
	* ui-file.h: Ditto.
	* ui-out.h: Ditto.
	* user-regs.c: Ditto.
	* user-regs.h: Ditto.
	* utils.c: Ditto.
	* valarith.c: Ditto.
	* valops.c: Ditto.
	* valprint.c: Ditto.
	* valprint.h: Ditto.
	* value.c: Ditto.
	* varobj.c: Ditto.
	* varobj.h: Ditto.
	* vec.h: Ditto.
	* xcoffread.c: Ditto.
	* xcoffsolib.c: Ditto.
	* xcoffsolib.h: Ditto.
	* xml-syscall.c: Ditto.
	* xml-tdesc.c: Ditto.
2011-01-05 22:22:53 +00:00
Joel Brobecker 7b6bb8daac run copyright.sh for 2011. 2011-01-01 15:34:07 +00:00
Jan Kratochvil 3f1eff0a2c gdb/
Fix stale memory references.
	* elfread.c (elf_symfile_read): Replace xmalloc by bfd_alloc, drop
	xfree, new comment.
2010-11-19 22:30:47 +00:00
Tom Tromey 72b9f47f1e * symfile.h (allocate_symtab): Update.
* symfile.c (allocate_symtab): Make 'filename' const.
	* psymtab.c (add_psymbol_to_bcache): Make 'name' const.
	(add_psymbol_to_list): Likewise.
	* psympriv.h (struct partial_symtab) <filename, dirname>: Now
	const.
	(add_psymbol_to_list): Update.
	* mdebugread.c (new_symtab): Make 'name' const.
	(psymtab_to_symtab_1): Make 'filename' const.
	* elfread.c (elfstab_offset_sections): Update.
	* dwarf2read.c (dwarf_decode_lines): Make 'comp_dir' const.
	(dwarf2_start_subfile): Make 'dirname' and 'comp_dir' const.
	(psymtab_include_file_name): Update.
	* dbxread.c (find_stab_function_addr): Make 'filename' const.
	* buildsym.h (start_subfile): Update.
	* buildsym.c (start_subfile): Make arguments const.
2010-10-01 20:26:11 +00:00
Tom Tromey 00b5771c2a * symfile.h (struct sym_fns) <next>: Remove.
(add_symtab_fns): Update.
	* symfile.c (sym_fns_ptr): New typedef.
	(symtab_fns): Now a VEC.
	(add_symtab_fns): Update.  Change argument type.
	(find_sym_fns): Update.  Change return type.
	(get_symfile_segment_data): Update.
	* objfiles.h (struct objfile) <sf>: Now const.
	* somread.c (som_sym_fns): Now const.  Update.
	* xcoffread.c (xcoff_sym_fns): Now const.  Update.
	* mipsread.c (ecoff_sym_fns): Now const.  Update.
	* machoread.c (macho_sym_fns): Now const.  Update.
	* elfread.c (elf_sym_fns): Now const.  Update.
	(elf_sym_fns_gdb_index): Likewise.
	* dbxread.c (aout_sym_fns): Now const.  Update.
	* coffread.c (coff_sym_fns): Now const.  Update.
2010-09-30 19:14:30 +00:00
Tom Tromey 9291a0cd80 gdb
* breakpoint.c (save_cmdlist): No longer static.
	* gdbcmd.h (save_cmdlist): Declare.
	* symfile.c (symbol_file_add_with_addrs_or_offsets): Set
	OBJF_READNOW on objfile if readnow_symbol_files.
	* elfread.c (elf_symfile_read): Use dwarf2_initialize_objfile.
	(elf_sym_fns_gdb_index): New global.
	* dwarf2read.c: Include exceptions.h.
	(offset_type): New.
	(struct mapped_index): New.
	(dwarf2_per_cu_data_ptr): New typedef.
	(struct dwarf2_per_objfile) <using_index, index_table, gdb_index>:
	New fields.
	(GDB_INDEX_SECTION): New define.
	(struct dwarf2_per_cu_quick_data): New.
	(struct dwarf2_per_cu_data) <objfile>: New field.
	<psymtab>: Removed.
	<v>: New field.
	(byte_swap): New function.
	(MAYBE_SWAP): New macro.
	(INDEX_SUFFIX): New macro.
	(dw2_do_instantiate_symtab): New function.
	(dw2_instantiate_symtab): Likewise.
	(create_cus_from_index): Likewise.
	(create_addrmap_from_index): Likewise.
	(mapped_index_string_hash): Likewise.
	(find_slot_in_mapped_hash): Likewise.
	(dwarf2_read_index): Likewise.
	(dw2_setup): Likewise.
	(dw2_require_line_header): Likewise.
	(dw2_require_full_path): Likewise.
	(dw2_find_last_source_symtab): Likewise.
	(dw2_forget_cached_source_info): Likewise.
	(dw2_lookup_symtab): Likewise.
	(dw2_lookup_symbol): Likewise.
	(dw2_do_expand_symtabs_matching): Likewise.
	(dw2_pre_expand_symtabs_matching): Likewise.
	(dw2_print_stats): Likewise.
	(dw2_dump): Likewise.
	(dw2_relocate): Likewise.
	(dw2_expand_symtabs_for_function): Likewise.
	(dw2_expand_all_symtabs): Likewise.
	(dw2_expand_symtabs_with_filename): Likewise.
	(dw2_find_symbol_file): Likewise.
	(dw2_map_ada_symtabs): Likewise.
	(dw2_expand_symtabs_matching): Likewise.
	(dw2_find_pc_sect_symtab): Likewise.
	(dw2_map_symbol_names): Likewise.
	(dw2_map_symbol_filenames): Likewise.
	(dw2_has_symbols): Likewise.
	(dwarf2_gdb_index_functions): New global.
	(dwarf2_initialize_objfile): New function.
	(process_psymtab_comp_unit): Update.
	(add_partial_subprogram): Likewise.
	(dwarf2_psymtab_to_symtab): Likewise.
	(psymtab_to_symtab_1): Use dw2_do_instantiate_symtab.
	(process_full_comp_unit): Update.
	(find_file_and_directory): New function.
	(read_file_scope): Use find_file_and_directory.
	(dwarf2_per_cu_objfile): Update.
	(dwarf2_per_cu_addr_size): Update.
	(dwarf2_per_cu_offset_size): Update.
	(dwarf2_free_objfile): Free the index, if needed.
	(dwarf2_per_objfile_free): Unmap the index, if needed.
	(struct strtab_entry): New.
	(hash_strtab_entry): New function.
	(eq_strtab_entry): Likewise.
	(create_strtab): Likewise.
	(add_string): Likewise.
	(struct symtab_index_entry): New.
	(struct mapped_symtab): New.
	(hash_symtab_entry): New function.
	(eq_symtab_entry): Likewise.
	(delete_symtab_entry): Likewise.
	(create_index_table): Likewise.
	(create_mapped_symtab): Likewise.
	(cleanup_mapped_symtab): Likewise.
	(find_slot): Likewise.
	(hash_expand): Likewise.
	(add_index_entry): Likewise.
	(add_indices_to_cpool): Likewise.
	(write_hash_table): Likewise.
	(add_address_entry): Likewise.
	(write_psymbols): Likewise.
	(write_obstack): Likewise.
	(unlink_if_set): Likewise.
	(write_psymtabs_to_index): Likewise.
	(save_gdb_index_command): Likewise.
	(_initialize_dwarf2_read): Install "save gdb-index"
	command.
	(create_all_comp_units): Initialize 'objfile' field of CU.
	(dwarf2_locate_sections): Check for .gdb_index.
	* psymtab.h (dwarf2_gdb_index_functions): Declare.
	* symfile.h (dwarf2_initialize_objfile): Declare.
gdb/doc
	* gdb.texinfo (Index Files): New node.
2010-07-13 20:51:34 +00:00
Michael Snyder d7f9d72972 2010-05-14 Michael Snyder <msnyder@vmware.com>
* elfread.c: White space.
	* environ.c: White space.
	* eval.c: White space.
	* event-loop.c: White space.
	* event-top.c: White space.
	* exceptions.c: White space.
	* exec.c: White space.
	* expprint.c: White space.
2010-05-14 18:35:11 +00:00
Michael Snyder fa238c0364 2010-05-05 Michael Snyder <msnyder@vmware.com>
* elfread.c (elf_symtab_read): Delete unused variable.
	(find_separate_debug_file_by_buildid): Delete unused variables.
	(elf_symfile_read): Delete unused variable.

	* coffread.c (coff_symfile_read): Delete unused variables.

	* coff-pe-read.c (add_pe_exported_sym): Delete unused variable.
	(read_pe_exported_syms): Delete unused variable.

	* stabsread.c (define_symbol): Delete unused variable.

	* dwarf2read.c (read_type_comp_unit_head): Delete unused variable.
	(process_psymtab_comp_unit): Delete unused variable.
	(dwarf2_build_psymtabs_hard): Delete unused variable.
	(load_partial_comp_unit): Delete unused variable.
	(create_all_comp_units): Delete unused variable.
	(scan_partial_symbols): Delete unused variable.
	(add_partial_symbol): Delete unused variable.
	(add_partial_namespace): Delete unused variable.
	(add_partial_enumeration): Delete unused variable.
	(load_full_comp_unit): Delete unused variable.
	(process_full_comp_unit): Delete unused variable.
	(read_file_scope): Delete unused variable.
	(read_type_unit_scope): Delete unused variable.
	(process_structure_scope): Delete unused variable.
	(process_enumeration_scope): Delete unused variable.
	(read_tag_ptr_to_member_type): Delete unused variable.
	(read_typedef): Delete unused variable.
	(read_partial_die): Delete unused variable.
	(decode_locdesc): Delete unused variable.
	(zeroed_partial_die): Delete unused global variable.
2010-05-05 23:44:19 +00:00
Pedro Alves 516ba65938 * objfiles.h (gdb_bfd_close_or_warn): Declare.
* objfiles.c (gdb_bfd_close_or_warn): New.
	* corelow.c: Include objfiles.h
	(core_close): Use gdb_bfd_close_or_warn.
	* elfread.c (build_id_verify): Ditto.
	* exec.c (exec_close, exec_close_1): Ditto.
2010-04-14 17:26:11 +00:00
Michael Snyder 737c4c52da 2010-03-24 Michael Snyder <msnyder@localhost.localdomain>
* elfread.c (find_separate_debug_file_by_buildid):
	Remove unused local variable.
2010-03-24 21:58:31 +00:00
Tom Tromey be391dcafc * elfread.c (elf_symfile_read): Don't call
dwarf2_build_frame_info.
	* dwarf2read.c (struct dwarf2_section_info) <readin>: New field.
	(struct dwarf2_per_objfile) <objfile>: New field.
	(dwarf2_has_info): Now idempotent.  Set objfile field.
	(dwarf2_read_section): Check and set readin field.  Call
	posix_madvise.
	(dwarf2_build_psymtabs): Don't read all sections.
	(read_type_comp_unit_head): Read types section.
	(create_debug_types_hash_table): Likewise.
	(init_cu_die_reader): Add asserts.
	(process_type_comp_unit): Add assert.
	(dwarf2_build_psymtabs_hard): Read info section.
	(load_partial_comp_unit): Add assert.
	(create_all_comp_units): Read info section.
	(load_full_comp_unit): Likewise.
	(dwarf2_ranges_read): Read ranges section.
	(dwarf2_record_block_ranges): Add assert.
	(dwarf2_read_abbrevs): Read abbrev section.
	(read_indirect_string): Read str section.
	(dwarf_decode_line_header): Read line section.
	(read_signatured_type_at_offset): Read types section.
	(dwarf_decode_macros): Read macinfo section.
	(dwarf2_symbol_mark_computed): Read loc section.
	* dwarf2-frame.c (dwarf2_frame_find_fde): Call
	dwarf2_build_frame_info.
	(dwarf2_build_frame_info): Unconditionally set
	dwarf2_frame_objfile_data on the objfile.
	* configure.ac: Check for posix_madvise.
	* config.in, configure: Rebuild.
2010-03-10 18:37:24 +00:00
Tom Tromey ccefe4c44c gdb
* xcoffread.c: Include psymtab.h.
	(xcoff_sym_fns): Update.
	* symtab.h (struct partial_symbol): Remove.
	(PSYMBOL_DOMAIN, PSYMBOL_CLASS): Remove.
	(struct partial_symtab): Remove.
	(PSYMTAB_TO_SYMTAB): Remove.
	(lookup_partial_symbol, lookup_partial_symtab, find_pc_psymtab)
	(find_pc_sect_psymtab): Remove.
	(find_pc_sect_symtab_via_partial): Declare.
	(find_pc_psymtab, find_pc_sect_psymbol, psymtab_to_symtab)
	(find_main_psymtab): Remove.
	(find_main_filename): Declare.
	(fixup_psymbol_section): Remove.
	(fixup_section): Declare.
	* symtab.c: Include psymtab.h.
	(lookup_symtab): Use lookup_symtab method.
	(lookup_partial_symtab): Remove.
	(find_pc_sect_psymtab_closer): Remove.
	(find_pc_sect_psymtab): Remove.
	(find_pc_sect_symtab_via_partial): New function.
	(find_pc_psymtab, find_pc_sect_psymbol, find_pc_psymbol): Remove.
	(fixup_section): No longer static.
	(fixup_psymbol_section): Remove.
	(lookup_symbol_aux): Use lookup_symbol_aux_quick.
	(lookup_global_symbol_from_objfile): Likewise.
	(lookup_symbol_aux_psymtabs): Remove.
	(lookup_symbol_aux_quick): New function.
	(lookup_symbol_global): Use lookup_symbol_aux_quick.
	(lookup_partial_symbol): Remove.
	(basic_lookup_transparent_type_quick): New function.
	(basic_lookup_transparent_type): Use it.
	(find_main_psymtab): Remove.
	(find_main_filename): New function.
	(find_pc_sect_symtab): Use find_pc_sect_symtab method.
	(find_line_symtab): Use expand_symtabs_with_filename method.
	(output_partial_symbol_filename): New function.
	(sources_info): Use map_partial_symbol_filenames.
	(struct search_symbols_data): New type.
	(search_symbols_file_matches): New function.
	(search_symbols_name_matches): Likewise.
	(search_symbols): Use expand_symtabs_matching method.
	(struct add_name_data): Rename from add_macro_name_data.
	(add_macro_name): Update.
	(add_partial_symbol_name): New function.
	(default_make_symbol_completion_list): Use
	map_partial_symbol_names.
	(struct add_partial_symbol_name): New type.
	(maybe_add_partial_symtab_filename): New function.
	(make_source_files_completion_list): Use
	map_partial_symbol_filenames.
	(expand_line_sal): Use expand_symtabs_with_filename method.
	* symmisc.c: Include psymtab.h.
	(print_objfile_statistics): Use print_stats method.
	(dump_objfile): Use dump method.
	(dump_psymtab, maintenance_print_psymbols)
	(maintenance_info_psymtabs, maintenance_check_symtabs)
	(extend_psymbol_list): Remove.
	* symfile.h (struct quick_symbol_functions): New struct.
	(struct sym_fns) <qf>: New field.
	(sort_pst_symbols): Remove.
	(increment_reading_symtab): Declare.
	* symfile.c: Include psymtab.h.
	(compare_psymbols, sort_pst_symbols): Remove.
	(psymtab_to_symtab): Remove.
	(increment_reading_symtab): New function.
	(symbol_file_add_with_addrs_or_offsets): Use expand_all_symtabs
	method.
	(set_initial_language): Use find_main_filename.
	(allocate_psymtab, discard_psymtab, cashier_psymtab): Remove.
	(free_named_symtabs): Remove unused code.
	(start_psymtab_common, add_psymbol_to_bcache)
	(append_psymbol_to_list, add_psymbol_to_list, init_psymbol_list):
	Remove.
	* stack.c: Include psymtab.h, symfile.h.
	(backtrace_command_1): Use find_pc_sect_symtab_via_partial.
	* source.h (psymtab_to_fullname): Don't declare.
	* source.c: Include psymtab.h.
	(select_source_symtab): Use find_last_source_symtab method.
	(forget_cached_source_info): Use forget_cached_source_info
	method.
	(find_and_open_source): No longer static.
	(psymtab_to_fullname): Remove.
	* somread.c: Include psymtab.h.
	(som_sym_fns): Update.
	* psympriv.h: New file.
	* psymtab.h: New file.
	* psymtab.c: New file.
	* objfiles.h: (ALL_OBJFILE_PSYMTABS): Remove.
	(ALL_PSYMTABS, ALL_PSPACE_PSYMTABS): Likewise.
	* objfiles.c: Include psymtab.h.
	(objfile_relocate1): Use relocate method.
	(objfile_has_partial_symbols): Use has_symbols method.
	* mipsread.c: Include psymtab.h.
	(ecoff_sym_fns): Update.
	* mi/mi-cmd-file.c: Include psymtab.h.
	(print_partial_file_name): New function.
	(mi_cmd_file_list_exec_source_files): Use
	map_partial_symbol_filenames.
	* mdebugread.c: Include psympriv.h.
	* machoread.c: Include psympriv.h.
	(macho_sym_fns): Update.
	* m2-exp.y (yylex): Use lookup_symtab.
	* elfread.c: Include psympriv.h.
	(elf_sym_fns): Update.
	* dwarf2read.c: Include psympriv.h.
	* dbxread.c: Include psympriv.h.
	(aout_sym_fns): Update.
	* cp-support.c: Include psymtab.h.
	(read_in_psymtabs): Remove.
	(make_symbol_overload_list_qualified): Use
	expand_symtabs_for_function method.
	* coffread.c: Include psympriv.h.
	(coff_sym_fns): Update.
	* blockframe.c: Include psymtab.h.
	(find_pc_partial_function): Use find_pc_sect_symtab method.
	* ada-lang.h (ada_update_initial_language): Update.
	* ada-lang.c: Include psymtab.h.
	(ada_update_initial_language): Remove 'main_pst' argument.
	(ada_lookup_partial_symbol): Remove.
	(struct ada_psym_data): New type.
	(ada_add_psyms): New function.
	(ada_add_non_local_symbols): Use map_ada_symtabs method.
	(struct add_partial_datum): New type.
	(ada_add_partial_symbol_completions): New function.
	(ada_make_symbol_completion_list): Use map_partial_symbol_names.
	(ada_exception_support_info_sniffer): Update.
	* Makefile.in (SFILES): Add psymtab.c.
	(COMMON_OBS): Add psymtab.o.
	(HFILES_NO_SRCDIR): Add psymtab.h, psympriv.h.
gdb/doc
	* gdbint.texinfo (Symbol Handling): Update.
2010-03-10 18:20:08 +00:00
Tristan Gingold ac8035ab9e 2010-02-03 Tristan Gingold <gingold@adacore.com>
* symfile.h (struct sym_fns): Add sym_relocate field.
	(default_symfile_relocate): New prototype.
	(symfile_relocate_debug_section): First argument is now an objfile.
	* symfile.c (default_symfile_relocate): Rename from
	symfile_relocate_debug_section, first argument is now an objfile.
	(symfile_relocate_debug_section): New function.
	* coffread.c (coff_sym_fns): Set sym_relocate field.
	* somread.c (som_sym_fns): Ditto.
	* mipsread.c (ecoff_sym_fns): Ditto.
	* machoread.c (macho_sym_fns): Ditto.
	* elfread.c (elf_sym_fns): Ditto.
	* dwarf2read.c (dwarf2_read_section): Ditto.
	* xcoffread.c (xcoff_sym_fns): Ditto.
	* dbxread.c (aout_sym_fns): Ditto.
	(dbx_psymtab_to_symtab): Adjust call to symfile_relocate_debug_section.
	(elfstab_build_psymtabs): Ditto.
2010-02-03 14:13:16 +00:00
Joel Brobecker 4c38e0a4fc Update copyright year in most headers.
Automatic update by copyright.sh.
2010-01-01 07:32:07 +00:00
Tristan Gingold 874f57650c 2009-12-11 Tristan Gingold <gingold@adacore.com>
* symfile.h (find_separate_debug_file_by_buildid): Remove prototype.
	(bfd_open_maybe_remote): New prototype.
	* symfile.c (bfd_open_maybe_remote): New function.
	(separate_debug_file_exists, reread_symbols): Use it.
	(struct build_id, build_id_bfd_get, build_id_verify)
	(build_id_to_debug_filename)
	(find_separate_debug_file_by_buildid): Move these ...
	* elfread.c (struct build_id)
	(build_id_bfd_get, build_id_verify, build_id_to_debug_filename)
	(find_separate_debug_file_by_buildid): ... here.
2009-12-14 12:50:39 +00:00
Tristan Gingold 9cce227f8c 2009-12-02 Tristan Gingold <gingold@adacore.com>
* symfile.h (symbol_file_add_separate): New prototype.
	(find_separate_debug_file_by_buildid): Ditto.
	(find_separate_debug_file_by_debuglink): Ditto.
	* symfile.c (reread_separate_symbols): Remove.
	(find_separate_debug_file): Split into ...
	(find_separate_debug_file_by_buildid): ... this and ...
	(find_separate_debug_file_by_debuglink): ... this.
	(symbol_file_add_with_addrs_or_offsets): Do not save orig_addrs.
	Remove separate debug file handling.
	(symbol_file_add_separate): New function.
	(reread_symbols): Do not considere separate debug files, but free
	them while handling their parent.  Reindent.
	* coffread.c (coff_symfile_read): Handle separate object file.
	* elfread.c (elf_symfile_read): Ditto.
2009-12-09 13:44:53 +00:00
Tristan Gingold f43525316b 2009-12-07 Tristan Gingold <gingold@adacore.com>
* symfile.h (struct sym_fns): Adjust comment on sym_read.
	* symfile.c (syms_from_objfile): Pass all symfile flags to sym_read.
	* dbxread.c (dbx_symfile_read): Rename mainline to symfile_flags,
	adjust header comment.
	* elfread.c (elf_symfile_read): Ditto.
	* somread.c (som_symfile_read): Ditto.
	* xcoffread.c (xcoff_initial_scan): Ditto.
	* coffread.c (coff_symfile_read): Rename mainline to symfile_flags.
	* machoread.c (macho_symfile_read): Ditto.
	* mipsread.c (mipscoff_symfile_read): Ditto.
2009-12-07 09:47:40 +00:00
Tristan Gingold de1d8fb992 2009-12-07 Tristan Gingold <gingold@adacore.com>
* dbxread.c (dbx_symfile_read): No need to test mainline to call
	init_psymbol_list.
	* xcoffread.c (xcoff_initial_scan): Ditto;
	* coffread.c (coff_symfile_read): Remove call to init_psymbol_list.
	* elfread.c (elf_symfile_read): Ditto.
	* machoread.c (macho_symfile_read): Ditto.
2009-12-07 09:36:44 +00:00
Tristan Gingold f29dff0a09 2009-12-02 Tristan Gingold <gingold@adacore.com>
* symfile.h (dwarf2_build_psymtabs): Remove mainline parameter in
	prototype.
	* dwarf2read.c (dwarf2_build_psymtabs): Remove mainline paramter in
	definition, simplify code assuming it is always 0.
	* coffread.c (coff_symfile_read): Adjust call.
	* elfread.c (elf_symfile_read): Ditto.
	* machoread.c (macho_symfile_read): Explicitely calls
	init_psymbol_list if mainline is set.
2009-12-02 11:44:35 +00:00
Tristan Gingold c67a9c901a 2009-12-02 Tristan Gingold <gingold@adacore.com>
* dwarf2read.c (dwarf2_build_psymtabs_easy): Remove mainline parameter.
	(dwarf2_build_psymtabs_hard): Ditto.
	(dwarf2_build_psymtabs): Ajust calls.
	* stabsread.h (elfstab_build_psymtabs): Remove mainline parameter on
	the prototype.
	(coffstab_build_psymtabs): Ditto.
	(stabsect_build_psymtabs): Ditto.
	* dbxread.c (coffstab_build_psymtabs): Remove mainline parameter on
	the definition.
	(elfstab_build_psymtabs): Ditto.
	(stabsect_build_psymtabs): Ditto.
	* coffread.c (coff_symfile_read): Adjust call.
	* elfread.c (elf_symfile_read): Ditto.
	* somread.c (som_symfile_read): Ditto.
2009-12-02 11:34:37 +00:00
Tom Tromey 04a679b8f5 * xcoffread.c (scan_xcoff_symtab): Update.
* symfile.h (add_psymbol_to_list): Update prototype.
	* symfile.c (add_psymbol_to_bcache): Add copy_name argument.
	(add_psymbol_to_list): Likewise.
	* stabsread.c (define_symbol): Update.
	* mdebugread.c (parse_partial_symbols): Update.
	(handle_psymbol_enumerators): Update.
	(new_symbol): Update.
	* dbxread.c (read_dbx_symtab): Update.
	* coffread.c (process_coff_symbol): Update.
	* symtab.h (prim_record_minimal_symbol_full): Declare.
	(SYMBOL_SET_NAMES): Add copy_name argument.
	* symtab.c (struct demangled_name_entry): New struct.
	(hash_demangled_name_entry): New function.
	(eq_demangled_name_entry): Likewise.
	(create_demangled_names_hash): Use new functions.
	(symbol_set_names): Use struct demangled_name_entry.  Add
	copy_name argument.
	* minsyms.c (prim_record_minimal_symbol_full): New function.
	(prim_record_minimal_symbol_and_info): Use it.
	* elfread.c (record_minimal_symbol): Add name_len and copy_name
	arguments.  Call prim_record_minimal_symbol_full.
	(elf_symtab_read): Add copy_names argument.
	(elf_symfile_read): Update calls to elf_symtab_read.
	* dwarf2read.c (add_partial_symbol): Don't copy symbol names.
	(load_partial_dies): Likewise.
	(new_symbol): Likewise.
	* cp-namespace.c (check_one_possible_namespace_symbol): Don't save
	name on the obstack.  Update call to SYMBOL_SET_NAMES.
2009-11-16 18:40:23 +00:00
Daniel Jacobowitz a103a963e0 2009-11-13 Maciej W. Rozycki <macro@codesourcery.com>
* elfread.c (elf_symtab_read): Only mark a minimal symbol as
	special if it actually exists.  Merge the checks for this
	conditions.
2009-11-13 22:47:13 +00:00
Tom Tromey 1c9e835890 * symtab.h (SYMBOL_SET_LINKAGE_NAME): Update comment.
* symfile.c (allocate_symtab): Don't use obsavestring on a
	constant string.
	* stabsread.c (define_symbol): Don't use obsavestring on a
	constant string.
	* mdebugread.c (parse_type): Don't use obsavestring on a constant
	string.
	(new_symtab): Likewise.
	* elfread.c (elf_symtab_read): Don't use obsavestring on a
	constant string.
2009-11-05 19:53:04 +00:00
Daniel Jacobowitz ad09a54881 * elfread.c (elf_symfile_segments): Do not warn about
uninitialized sections outside of load segments.
2009-11-02 17:16:14 +00:00
Paul Pluzhnikov 1800f484a2 2009-10-08 Paul Pluzhnikov <ppluzhnikov@google.com>
PR gdb/10457
	* elfread.c (elf_symtab_read): Don't use alloca in a loop.
2009-10-08 16:38:42 +00:00
Paul Pluzhnikov 25c2f6abe0 2009-04-30 Paul Pluzhnikov <ppluzhnikov@google.com>
* elfread.c (elf_symtab_read): Don't assume .data and .rodata
	are present.
2009-04-30 21:59:03 +00:00
Joel Brobecker 0fb0cc7590 Updated copyright notices for most files. 2009-01-03 05:58:08 +00:00
Tom Tromey b887350fc5 * xcoffread.c (RECORD_MINIMAL_SYMBOL): Update.
(scan_xcoff_symtab): Update.
	* mdebugread.c (record_minimal_symbol): Update.
	(parse_partial_symbols): Update.
	* elfread.c (record_minimal_symbol): Update.
	* dbxread.c (record_minimal_symbol): Update.
	* coffread.c (record_minimal_symbol): Update.
	* sh64-tdep.c (MSYMBOL_IS_SPECIAL): Redefine.
	(sh64_elf_make_msymbol_special): Update.
	* mips-tdep.c (mips_elf_make_msymbol_special): Use
	MSYMBOL_TARGET_FLAG_1.
	(mips_elf_make_msymbol_special): Likewise.
	(msymbol_is_special): Likewise.
	* minsyms.c (prim_record_minimal_symbol_and_info): Update.
	(install_minimal_symbols): Likewise.
	(prim_record_minimal_symbol): Update.
	(prim_record_minimal_symbol_and_info): Remove 'info' argument.
	* m68hc11-tdep.c (MSYMBOL_SET_RTC): Redefine.
	(MSYMBOL_SET_RTI): Redefine.
	(MSYMBOL_IS_RTC): Redefine.
	(MSYMBOL_IS_RTI): Redefine.
	* arm-tdep.c (MSYMBOL_SET_SPECIAL): Redefine.
	(MSYMBOL_IS_SPECIAL): Redefine.
	* symtab.h (struct minimal_symbol) <info>: Remove.
	<target_flag_1, target_flag_2>: New fields.
	(MSYMBOL_INFO): Remove.
	(MSYMBOL_TARGET_FLAG_1): New macro.
	(MSYMBOL_TARGET_FLAG_2): Likewise.
	(prim_record_minimal_symbol_and_info): Update.
2008-10-01 16:41:27 +00:00
Ulrich Weigand 45148c2ed5 * elfread.c (elf_symtab_read): Do not relocate thread-local symbols. 2008-08-21 22:28:00 +00:00
Chris Demetriou a366c65aeb 2008-07-20 Sergei Poselenov <sposelenov@emcraft.com>
Chris Demetriou  <cgd@google.com>

        * elfread.c (elf_symfile_segments): Fix the check that each loadable
        section fits within an ELF segment to handle ELF segments that hit
        the end of the address space.
2008-07-21 05:05:23 +00:00
Daniel Jacobowitz 2eaf8d2a14 * elfread.c (elf_symtab_read): Create trampolines for @plt symbols.
* minsyms.c (lookup_minimal_symbol_by_pc_section_1): Renamed from
	lookup_minimal_symbol_by_pc_section.  Prefer trampolines if requested.
	(lookup_minimal_symbol_by_pc_section): Use
	lookup_minimal_symbol_by_pc_section_1.
	(lookup_solib_trampoline_symbol_by_pc): Likewise.
2008-05-14 18:14:34 +00:00
Daniel Jacobowitz 60c5725ca9 * Makefile.in (arm-tdep.o): Update.
* arm-tdep.c (arm_objfile_data_key, struct arm_mapping_symbol)
	(struct arm_per_objfile, arm_compare_mapping_symbols): New.
	(arm_pc_is_thumb): Use mapping symbols.
	(arm_objfile_data_cleanup, arm_record_special_symbol): New.
	(arm_gdbarch_init): Call set_gdbarch_record_special_symbol.
	(_initialize_arm_tdep): Initialize arm_objfile_data_key.
	* elfread.c (elf_symtab_read): Use gdbarch_record_special_symbol.
	* gdbarch.sh: Add record_special_symbol.
	* gdbarch.c, gdbarch.h: Regenerated.
	* objfiles.c (struct objfile_data): Add cleanup member.
	(register_objfile_data_with_cleanup): New function, from
	register_objfile_data.
	(register_objfile_data): Use it.
	(objfile_free_data): Call clear_objfile_data.
	(clear_objfile_data): Call cleanup functions.
	* objfiles.h (register_objfile_data_with_cleanup): Declare.
2008-05-02 20:38:16 +00:00
Ulrich Weigand 5e2b427df3 * objfiles.h (struct objfile): New GDBARCH member.
(get_objfile_arch): Add prototype.
	* objfiles.c: Include "arch-utils.h".
	(allocate_objfile): Look up gdbarch associated with bfd.
	(get_objfile_arch): New function.
	* Makefile (objfiles.o): Update dependencies.

	* dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch
	by objfile arch.
	* dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch
	by frame arch.
	(locexpr_describe_location): Replace current_gdbarch by
	objfile arch.
	* dwarf2read.c (die_type): Replace current_gdbarch by objfile arch.
	(dwarf2_add_field): Likewise.
	(read_tag_pointer_type): Likewise.
	(read_base_type): Likewise.
	(new_symbol): Likewise.

	* coffread.c (decode_type): Add OBJFILE argument.  Update callers.
	(decode_base_type, decode_function_type): Likewise.
	(coff_read_struct_type, coff_read_enum_type): Likewise.
	(coff_symtab_read): Replace current_gdbarch by objfile arch.
	(decode_base_type): Likewise.
	(coff_read_enum_type): Likewise.
	(coff_read_struct_type): Replace current_objfile by OBJFILE argument.
	(coff_read_enum_type): Likewise.

	* dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch.
	(end_psymtab): Likewise.
	(process_one_symbol): Likewise.

	* mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch.
	(parse_procedure): Likewise.
	(parse_partial_symbols): Likewise.

	* somread.c (som_symtab_read): Replace current_gdbarch by objfile arch.

	* stabsread.c (define_symbol): Replace current_gdbarch by objfile arch.
	Replace static pcc_promotion_type and pcc_unsigned_promotion_type by
	built-in types.
	(read_range_type): Replace current_gdbarch by objfile arch.  Replace
	static range_index_type by built-in type.
	(read_one_struct_field): Replace current_gdbarch by objfile arch.
	(read_enum_type): Likewise.

	* xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by
	objfile arch.
2008-03-26 14:53:28 +00:00
Alan Modra 4fbb74a605 include/elf/
PR 5900
	* common.h (SHN_BAD): Delete.
	(SHN_LORESERVE .. SHN_HIRESERVE): Move to..
	* external.h: ..here.
	* internal.h (SHN_LORESERVE, SHN_HIRESERVE): Define.
	(SHN_LOPROC, SHN_HIPROC, SHN_LOOS, SHN_HIOS): Define.
	(SHN_ABS, SHN_COMMON, SHN_XINDEX, SHN_BAD): Define.
bfd/
	PR 5900
	* elf-bfd.h: Include elf/internal.h after elf/external.h.
	* elfcode.h (elf_swap_symbol_in): Map reserved shndx range.
	(elf_swap_symbol_out): Adjust SHN_XINDEX test.
	(elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values
	seen in external structs.
	(valid_section_index_p): Delete.
	(elf_object_p): Don't increment section numbers over reserved range.
	Simplify test for valid sh_link, sh_info and e_shstrndx fields.
	(elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values
	seen in external structs.  Don't increment section numbers over
	reserved range.
	* elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx.
	(bfd_section_from_shdr): Likewise.
	(group_signature): Range check before accessing elf_elfsections.
	(_bfd_elf_setup_sections): Likewise.
	(bfd_section_from_shdr): Likewise.
	(bfd_section_from_shdr): Don't increment section number over
	reserved sections.
	(assign_file_positions_for_non_load_sections): Likewise.
	(assign_file_positions_except_relocs): Likewise.
	(_bfd_elf_write_object_contents): Likewise.
	(assign_section_numbers): Likewise.  Adjust for changed SHN_*.
	(prep_headers): Delete unused variable.
	* elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust
	for changed SHN_* values.
	(check_dynsym, elf_link_input_bfd): Likewise.
	(bfd_elf_final_link): Likewise.  Don't skip over reserved section
	range.
	(elf_fixup_link_order): Check that sh_link field is valid.
	* elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned.
	* elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before
	accesssing elf_elfsections.
	* elf32-avr.c (elf32_avr_size_stubs): Likewise.
	* elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise.
	* elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed
	SHN_* defines.  Test for SHN_BAD return from
	_bfd_elf_section_from_bfd_section
binutils/
	PR 5900
	* readelf.c (SECTION_HEADER_INDEX, SECTION_HEADER_NUM): Delete.
	Remove use throughout file.
	(SECTION_HEADER): Likewise.
	(dump_relocations): Don't adjust st_shndx for reserved range.
	(process_file_header): Mask SHN_XINDEX to values seen in external
	elf structs.  Simplify valid section index tests.
	(get_32bit_elf_symbols, get_64bit_elf_symbols): Mask SHN_XINDEX.
	Map reserved st_shndx to internal form.
	(process_section_groups): Test that group symbol st_shndx is in
	range, not just non-zero.  Delete reserved range check.
	(get_symbol_index_type): Mask "type" to 16 bits when printing PRC,
	OS or RSV.
gdb/
	PR 5900
	* elfread.c (elf_symtab_read): Make shndx an unsigned int.
	* mipsread.c: Include elf/internal.h.
	(read_alphacoff_dynamic_symtab): Map external reserved sym_shndx
	to internal range.
ld/testsuite/
	PR 5900
	* ld-elf/sec64k.exp: Update.
2008-03-12 08:37:09 +00:00
Daniel Jacobowitz 9b254dd1ce Updated copyright notices for most files. 2008-01-01 22:53:26 +00:00
Ulrich Weigand 6f610d0772 bfd/ChangeLog:
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Set udata.p of
	synthetic symbol to point to the ELF symbol it was derived from.

gdb/ChangeLog:

	* elfread.c (ST_REGULAR, ST_DYNAMIC, ST_SYNTHETIC): New defines.
	(elf_symtab_read): Rename DYNAMIC argument to TYPE.  Do not access
	ELF-private symbol data when processing synthetic symbols.  Use
	udata.p to get at size of ppc64 synthetic 'dot' symbols.
	(elf_symfile_read): Pass TYPE argument to elf_symtab_read.
2007-11-15 23:48:00 +00:00
Ulrich Weigand 02c75f7232 * elfread.c (elf_symtab_read): When constructing a solib trampoline
minimal symbol from an undefined dynamic symbol, use proper section.
2007-10-31 19:09:14 +00:00
Daniel Jacobowitz fe3e1990b3 * coffread.c (coff_symfile_finish): Call dwarf2_free_objfile.
* dwarf2read.c (dwarf2_free_objfile): New.
	* elfread.c (elf_symfile_finish): Call dwarf2_free_objfile.
	* symfile.h (dwarf2_free_objfile): Declare.
2007-10-22 01:16:34 +00:00
Ulrich Weigand 203c3895a5 * gdbarch.sh (sofun_address_maybe_missing): New gdbarch variable.
* gdbarch.c, gdbarch.h: Regenerate.
	* dbxread.c (find_stab_function_addr): Define unconditionally.
	(read_dbx_symtab): Use gdbarch_sofun_address_maybe_missing
	instead of SOFUN_ADDRESS_MAYBE_MISSING.
	(end_psymtab): Likewise.
	(process_one_symbol): Likewise.
	* mdebugread.c (parse_partial_symbols): Likewise.

	* symtab.h (struct minimal_symbol): Always define "filename" member.
	* elfread.c (elf_symtab_read): Use msym->filename unconditionally.
	* minsyms.c (lookup_minimal_symbol): Likewise.
	* symmisc.c (dump_msymbols): Likewise.

	* config/i386/i386sol2.mt (DEPRECATED_TM_FILE): Remove.
	* config/i386/linux.mt (DEPRECATED_TM_FILE): Remove.
	* config/i386/tm-i386sol2.h: Remove file.
	* config/i386/tm-linux.h: Remove file.
	* i386-linux-tdep.c (i386_linux_init_abi): Add call to
	set_gdbarch_sofun_address_maybe_missing.
	* i386-sol2-tdep.c (i386_sol2_init_abi): Likewise.

	* config/powerpc/linux.mt (DEPRECATED_TM_FILE): Remove.
	* config/powerpc/nbsd.mt (DEPRECATED_TM_FILE): Remove.
	* config/powerpc/obsd.mt (DEPRECATED_TM_FILE): Remove.
	* config/powerpc/ppc-eabi.mt (DEPRECATED_TM_FILE): Remove.
	* config/powerpc/ppc-sim.mt (DEPRECATED_TM_FILE): Remove.
	* config/powerpc/tm-ppc-eabi.h: Remove file.
	* rs6000-tdep.c (rs6000_gdbarch_init): Add call to
	set_gdbarch_sofun_address_maybe_missing.

	* config/sparc/sol2-64.mt (DEPRECATED_TM_FILE): Remove.
	* config/sparc/sol2.mt (DEPRECATED_TM_FILE): Remove.
	* config/sparc/tm-sol2.h: Remove file.
	* sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Add call to
	set_gdbarch_sofun_address_maybe_missing.
	* sparc-sol2-tdep.c (sparc32_sol2_init_abi): Likewise.

doc/ChangeLog:

	* gdbarch.texi (Target Conditionals): Remove documentation of
	SOFUN_ADDRESS_MAYBE_MISSING, replaced by ...
	(Compiler Characteristics): ... documentation of
	set_gdbarch_sofun_address_maybe_missing.
2007-10-19 12:26:35 +00:00
Joel Brobecker c295b2e505 * symfile.h (struct sym_fns): Add new field sym_read_linetable.
* coffread.c, dbxread.c, elfread.c, mipsread.c somread.c:
        Adjust the struct sym_fns object accordingly by setting
        the new field to NULL.
        * xcoffread.c (aix_process_linenos): Make static.
        (xcoff_sym_fns): Set new field to aix_process_linenos.
        * buildsym.c (end_symtab): Replace call to PROCESS_LINENUMBER_HOOK
        by call to new the new sym_fns sym_read_linetable function.
        * config/powerpc/aix.mt (DEPRECATED_TM_FILE): Delete.
        * config/rs6000/tm-rs6000.h: Delete.
2007-09-21 18:01:26 +00:00
Joel Brobecker a9762ec78a Switch the license of all .c files to GPLv3.
Switch the license of all .h files to GPLv3.
        Switch the license of all .cc files to GPLv3.
2007-08-23 18:08:50 +00:00
Daniel Jacobowitz 31d99776c7 * coffread.c (coff_sym_fns): Add default_symfile_segments.
* dbxread.c (start_psymtab): Check HAVE_ELF.
	(aout_sym_fns): Likewise.
	* elfread.c (elf_symfile_segments): New.
	(elf_sym_fns): Add elf_symfile_segments.
	* mipsread.c (ecoff_sym_fns): Add default_symfile_segments.
	* remote.c (get_offsets): Use symfile_map_offsets_to_segments.
	Skip if there is no symfile_objfile.  Handle TextSeg and DataSeg.
	* somread.c (som_sym_fns): Use default_symfile_segments.
	* symfile.c (find_sym_fns): Take a BFD and return the sym_fns.
	(init_objfile_sect_indices): Call symfile_find_segment_sections.
	(default_symfile_segments): New function.
	(syms_from_objfile): Update call to find_sym_fns.
	(symfile_get_segment_data, free_symfile_segment_data): New.
	(symfile_map_offsets_to_segments): New.
	(symfile_find_segment_sections): New.
	* symfile.h (struct symfile_segment_data): New.
	(struct sym_fns): Add sym_segments.
	(default_symfile_segments, symfile_get_segment_data)
	(free_symfile_segment_data): New prototypes.
	(symfile_map_offsets_to_segments): Likewise.
	* xcoffread.c (xcoff_sym_fns): Add default_symfile_segments.
	* Makefile.in (COMMON_OBS): Remove elfread.o.
	(elf_internal_h): New.
	(elfread.o): Update.
	* configure.ac: Add elfread.o to COMMON_OBS if bfd/elf.o was
	compiled.
	* config.in, configure: Regenerated.
	* NEWS: Mention qOffsets changes.

	* gdb.texinfo (General Query Packets): Document qOffsets changes.

	* Makefile.def: Add dependency from configure-gdb to all-bfd.
	* Makefile.in: Regenerated.
2007-06-18 15:46:38 +00:00
Ulrich Weigand 260edbc2ca 2007-06-12 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (SMASH_TEXT_ADDRESS): Replace by
	gdbarch_smash_text_address.
	* somread.c (som_symtab_read): Likewise.
	* elfread.c (record_minimal_symbol): Likewise.
	* dbxread.c (process_one_symbol): Likewise.
	* coffread.c (coff_symtab_read): Likewise.
	* gdbarch.c, gdbarch.h: Regenerate.
2007-06-12 16:55:32 +00:00
Ulrich Weigand 95f1da47fa 2007-06-06 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (COFF_MAKE_MSYMBOL_SPECIAL): Replace by
	gdbarch_coff_make_msymbol_special.
	* coffread.c (coff_symtab_read): Likewise.
	* gdbarch.sh (ELF_MAKE_MSYMBOL_SPECIAL): Replace by
	gdbarch_elf_make_msymbol_special.
	* elfread.c (elf_symtab_read): Likewise.
	* mips-tdep.c (mips_elf_make_msymbol_special): Likewise (comment).
	* sh64-tdep.c (MSYMBOL_IS_SPECIAL): Likewise (comment).
	* gdbarch.c, gdbarch.h: Regenerate.
2007-06-06 15:32:25 +00:00
Daniel Jacobowitz 7ce5900041 * MAINTAINERS: Remove d10v entry.
* Makefile.in (SFILES): Remove dwarfread.c.
	(COMMON_OBS): Remove dwarfread.o.
	(gdb_sim_d10v_h, abug-rom.o, cpu32bug-rom.o, d10v-tdep.o, dwarfread.o)
	(remote-est.o, rom68k-rom.o): Delete.
	* NEWS: Mention removal of d10v, target abug, target cpu32bug,
	target est, target rom68k, and DWARF 1.
	* configure.tgt: Mark d10v as removed.
	* dwarf2read.c: Doc update.
	* elfread.c (struct elfinfo): Remove dboffset, dbsize, lnoffset,
	and lnsize.
	(elf_locate_sections): Do not set them.
	(elf_symfile_read): Do not call dwarf_build_psymtabs.
	* symfile.h (dwarf_build_psymtabs): Delete prototype.
	* config/m68k/monitor.mt (TDEPFILES): Prune.
	* abug-rom.c, cpu32bug-rom.c, d10v-tdep.c, dwarfread.c,
	remote-est.c, rom68k-rom.c, config/d10v/d10v.mt: Delete.

	* gdb.texinfo (M68K): Remove obsolete ROM monitors.
	* gdbint.texinfo (DWARF 1): Delete section and other dwarfread.c
	references.

	* gdb.asm/asm-source.exp: Remove d10v case.
	* lib/gdb.exp (skip_cplus_tests): Likewise.
	* gdb.asm/d10v.inc: Deleted.
2007-03-30 17:21:48 +00:00
Daniel Jacobowitz 6aba47ca06 Copyright updates for 2007. 2007-01-09 17:59:20 +00:00
Daniel Jacobowitz 0823249716 gdb/
* elfread.c (elf_symtab_read): Treat weak functions as global.
gdb/testsuite/
	* gdb.base/solib-weak.c, gdb.base/solib-weak.exp, gdb.base/weaklib1.c,
	gdb.base/weaklib2.c: New files.
2006-12-01 18:14:30 +00:00
Daniel Jacobowitz 7476373706 * elfread.c (elf_symtab_read): Skip symbols which BFD considers
special.
2006-02-21 20:38:48 +00:00
Alan Modra 9f20e3dae5 * elfread.c (elf_symfile_read): Don't make synth syms global. 2005-12-27 04:09:40 +00:00
Eli Zaretskii 197e01b6dc * breakpoint.c:
* arm-tdep.c:
	* ia64-tdep.c:
	* i386-tdep.c:
	* hpread.c:
	* hppa-tdep.c:
	* hppa-hpux-tdep.c:
	* gnu-nat.c:
	* gdbtypes.c:
	* gdbarch.h:
	* gdbarch.c:
	* eval.c:
	* dwarf2read.c:
	* dbxread.c:
	* copying:
	* symfile.c:
	* stabsread.c:
	* sh64-tdep.c:
	* sh-tdep.c:
	* s390-tdep.c:
	* rs6000-tdep.c:
	* remote.c:
	* remote-mips.c:
	* mips-tdep.c:
	* mdebugread.c:
	* linux-nat.c:
	* infrun.c:
	* xcoffread.c:
	* win32-nat.c:
	* valops.c:
	* utils.c:
	* tracepoint.c:
	* target.c:
	* symtab.c:
	* c-exp.y:
	* ada-valprint.c:
	* ada-typeprint.c:
	* ada-lex.l:
	* ada-lang.h:
	* ada-lang.c:
	* ada-exp.y:
	* alphafbsd-tdep.c:
	* alphabsd-tdep.h:
	* alphabsd-tdep.c:
	* alphabsd-nat.c:
	* alpha-tdep.h:
	* alpha-tdep.c:
	* alpha-osf1-tdep.c:
	* alpha-nat.c:
	* alpha-mdebug-tdep.c:
	* alpha-linux-tdep.c:
	* alpha-linux-nat.c:
	* aix-thread.c:
	* abug-rom.c:
	* arch-utils.c:
	* annotate.h:
	* annotate.c:
	* amd64obsd-tdep.c:
	* amd64obsd-nat.c:
	* amd64nbsd-tdep.c:
	* amd64nbsd-nat.c:
	* amd64fbsd-tdep.c:
	* amd64fbsd-nat.c:
	* amd64bsd-nat.c:
	* amd64-tdep.h:
	* amd64-tdep.c:
	* amd64-sol2-tdep.c:
	* amd64-nat.h:
	* amd64-nat.c:
	* amd64-linux-tdep.c:
	* amd64-linux-nat.c:
	* alphanbsd-tdep.c:
	* block.h:
	* block.c:
	* bfd-target.h:
	* bfd-target.c:
	* bcache.h:
	* bcache.c:
	* ax.h:
	* ax-general.c:
	* ax-gdb.h:
	* ax-gdb.c:
	* avr-tdep.c:
	* auxv.h:
	* auxv.c:
	* armnbsd-tdep.c:
	* armnbsd-nat.c:
	* arm-tdep.h:
	* arm-linux-nat.c:
	* arch-utils.h:
	* charset.c:
	* call-cmds.h:
	* c-valprint.c:
	* c-typeprint.c:
	* c-lang.h:
	* c-lang.c:
	* buildsym.h:
	* buildsym.c:
	* bsd-uthread.h:
	* bsd-uthread.c:
	* bsd-kvm.h:
	* bsd-kvm.c:
	* breakpoint.h:
	* core-regset.c:
	* core-aout.c:
	* completer.h:
	* completer.c:
	* complaints.h:
	* complaints.c:
	* command.h:
	* coffread.c:
	* coff-solib.h:
	* coff-solib.c:
	* coff-pe-read.h:
	* coff-pe-read.c:
	* cli-out.h:
	* cli-out.c:
	* charset.h:
	* dink32-rom.c:
	* dictionary.h:
	* dictionary.c:
	* demangle.c:
	* defs.h:
	* dcache.h:
	* dcache.c:
	* d10v-tdep.c:
	* cpu32bug-rom.c:
	* cp-valprint.c:
	* cp-support.h:
	* cp-support.c:
	* cp-namespace.c:
	* cp-abi.h:
	* cp-abi.c:
	* corelow.c:
	* corefile.c:
	* environ.c:
	* elfread.c:
	* dwarfread.c:
	* dwarf2loc.c:
	* dwarf2expr.h:
	* dwarf2expr.c:
	* dwarf2-frame.h:
	* dwarf2-frame.c:
	* dve3900-rom.c:
	* dummy-frame.h:
	* dummy-frame.c:
	* dsrec.c:
	* doublest.h:
	* doublest.c:
	* disasm.h:
	* disasm.c:
	* fork-child.c:
	* findvar.c:
	* fbsd-nat.h:
	* fbsd-nat.c:
	* f-valprint.c:
	* f-typeprint.c:
	* f-lang.h:
	* f-lang.c:
	* expression.h:
	* expprint.c:
	* exec.h:
	* exec.c:
	* exceptions.h:
	* exceptions.c:
	* event-top.h:
	* event-top.c:
	* event-loop.h:
	* event-loop.c:
	* gdb.c:
	* gdb-stabs.h:
	* gdb-events.h:
	* gdb-events.c:
	* gcore.c:
	* frv-tdep.h:
	* frv-tdep.c:
	* frv-linux-tdep.c:
	* frame.h:
	* frame.c:
	* frame-unwind.h:
	* frame-unwind.c:
	* frame-base.h:
	* frame-base.c:
	* gdb_vfork.h:
	* gdb_thread_db.h:
	* gdb_string.h:
	* gdb_stat.h:
	* gdb_regex.h:
	* gdb_ptrace.h:
	* gdb_proc_service.h:
	* gdb_obstack.h:
	* gdb_locale.h:
	* gdb_dirent.h:
	* gdb_curses.h:
	* gdb_assert.h:
	* gdbarch.sh:
	* gdb.h:
	* hpux-thread.c:
	* hppabsd-nat.c:
	* hppa-tdep.h:
	* hpacc-abi.c:
	* h8300-tdep.c:
	* gregset.h:
	* go32-nat.c:
	* gnu-v3-abi.c:
	* gnu-v2-abi.h:
	* gnu-v2-abi.c:
	* gnu-nat.h:
	* glibc-tdep.c:
	* gdbtypes.h:
	* gdbcore.h:
	* gdbcmd.h:
	* i386nbsd-tdep.c:
	* i386nbsd-nat.c:
	* i386gnu-tdep.c:
	* i386gnu-nat.c:
	* i386fbsd-tdep.c:
	* i386fbsd-nat.c:
	* i386bsd-tdep.c:
	* i386bsd-nat.h:
	* i386bsd-nat.c:
	* i386-tdep.h:
	* i386-sol2-nat.c:
	* i386-nto-tdep.c:
	* i386-nat.c:
	* i386-linux-tdep.h:
	* i386-linux-tdep.c:
	* i386-linux-nat.c:
	* i386-cygwin-tdep.c:
	* inf-ttrace.c:
	* inf-ptrace.h:
	* inf-ptrace.c:
	* inf-loop.h:
	* inf-loop.c:
	* inf-child.h:
	* inf-child.c:
	* ia64-tdep.h:
	* ia64-linux-nat.c:
	* i387-tdep.h:
	* i387-tdep.c:
	* i386v4-nat.c:
	* i386v-nat.c:
	* i386obsd-tdep.c:
	* i386obsd-nat.c:
	* kod.c:
	* jv-valprint.c:
	* jv-typeprint.c:
	* jv-lang.h:
	* jv-lang.c:
	* irix5-nat.c:
	* iq2000-tdep.c:
	* interps.h:
	* interps.c:
	* inftarg.c:
	* inflow.h:
	* inflow.c:
	* inferior.h:
	* infcmd.c:
	* infcall.h:
	* infcall.c:
	* inf-ttrace.h:
	* m32r-tdep.h:
	* m32r-tdep.c:
	* m32r-rom.c:
	* m32r-linux-tdep.c:
	* m32r-linux-nat.c:
	* m2-valprint.c:
	* m2-typeprint.c:
	* m2-lang.h:
	* m2-lang.c:
	* lynx-nat.c:
	* linux-thread-db.c:
	* linux-nat.h:
	* linespec.c:
	* libunwind-frame.h:
	* libunwind-frame.c:
	* language.h:
	* language.c:
	* macroexp.c:
	* macrocmd.c:
	* m88kbsd-nat.c:
	* m88k-tdep.h:
	* m88k-tdep.c:
	* m68klinux-tdep.c:
	* m68klinux-nat.c:
	* m68kbsd-tdep.c:
	* m68kbsd-nat.c:
	* m68k-tdep.h:
	* m68k-tdep.c:
	* mips-linux-nat.c:
	* mips-irix-tdep.c:
	* minsyms.c:
	* memattr.h:
	* memattr.c:
	* mem-break.c:
	* mdebugread.h:
	* main.h:
	* main.c:
	* macrotab.h:
	* macrotab.c:
	* macroscope.h:
	* macroscope.c:
	* macroexp.h:
	* nbsd-tdep.c:
	* mt-tdep.c:
	* monitor.h:
	* monitor.c:
	* mn10300-tdep.h:
	* mn10300-tdep.c:
	* mn10300-linux-tdep.c:
	* mipsv4-nat.c:
	* mipsread.c:
	* mipsnbsd-tdep.h:
	* mipsnbsd-tdep.c:
	* mipsnbsd-nat.c:
	* mips64obsd-tdep.c:
	* mips64obsd-nat.c:
	* mips-tdep.h:
	* mips-mdebug-tdep.c:
	* mips-linux-tdep.c:
	* osabi.h:
	* osabi.c:
	* ocd.h:
	* ocd.c:
	* observer.c:
	* objfiles.h:
	* objfiles.c:
	* objc-lang.h:
	* objc-lang.c:
	* objc-exp.y:
	* nto-tdep.h:
	* nto-tdep.c:
	* nto-procfs.c:
	* nlmread.c:
	* nbsd-tdep.h:
	* ppcobsd-tdep.c:
	* ppcobsd-nat.c:
	* ppcnbsd-tdep.h:
	* ppcnbsd-tdep.c:
	* ppcnbsd-nat.c:
	* ppcbug-rom.c:
	* ppc-tdep.h:
	* ppc-sysv-tdep.c:
	* ppc-linux-tdep.c:
	* ppc-linux-nat.c:
	* ppc-bdm.c:
	* parser-defs.h:
	* parse.c:
	* p-valprint.c:
	* p-typeprint.c:
	* p-lang.h:
	* p-lang.c:
	* remote-fileio.h:
	* remote-fileio.c:
	* remote-est.c:
	* remote-e7000.c:
	* regset.h:
	* regset.c:
	* reggroups.h:
	* reggroups.c:
	* regcache.h:
	* regcache.c:
	* proc-why.c:
	* proc-service.c:
	* proc-events.c:
	* printcmd.c:
	* ppcobsd-tdep.h:
	* sentinel-frame.h:
	* sentinel-frame.c:
	* scm-valprint.c:
	* scm-tags.h:
	* scm-lang.h:
	* scm-lang.c:
	* scm-exp.c:
	* s390-tdep.h:
	* rom68k-rom.c:
	* remote.h:
	* remote-utils.c:
	* remote-st.c:
	* remote-sim.c:
	* remote-sds.c:
	* remote-rdp.c:
	* remote-rdi.c:
	* remote-hms.c:
	* sim-regno.h:
	* shnbsd-tdep.h:
	* shnbsd-tdep.c:
	* shnbsd-nat.c:
	* sh-tdep.h:
	* serial.h:
	* serial.c:
	* ser-unix.h:
	* ser-unix.c:
	* ser-tcp.c:
	* ser-pipe.c:
	* ser-go32.c:
	* ser-e7kpc.c:
	* ser-base.h:
	* ser-base.c:
	* solib.c:
	* solib-svr4.h:
	* solib-svr4.c:
	* solib-sunos.c:
	* solib-som.h:
	* solib-som.c:
	* solib-pa64.h:
	* solib-pa64.c:
	* solib-osf.c:
	* solib-null.c:
	* solib-legacy.c:
	* solib-irix.c:
	* solib-frv.c:
	* solib-aix5.c:
	* sol-thread.c:
	* sparc64-linux-tdep.c:
	* sparc64-linux-nat.c:
	* sparc-tdep.h:
	* sparc-tdep.c:
	* sparc-sol2-tdep.c:
	* sparc-sol2-nat.c:
	* sparc-nat.h:
	* sparc-nat.c:
	* sparc-linux-tdep.c:
	* sparc-linux-nat.c:
	* source.h:
	* source.c:
	* somread.c:
	* solist.h:
	* solib.h:
	* std-regs.c:
	* stack.h:
	* stack.c:
	* stabsread.h:
	* sparcobsd-tdep.c:
	* sparcnbsd-tdep.c:
	* sparcnbsd-nat.c:
	* sparc64obsd-tdep.c:
	* sparc64nbsd-tdep.c:
	* sparc64nbsd-nat.c:
	* sparc64fbsd-tdep.c:
	* sparc64fbsd-nat.c:
	* sparc64-tdep.h:
	* sparc64-tdep.c:
	* sparc64-sol2-tdep.c:
	* sparc64-nat.c:
	* ui-file.c:
	* typeprint.h:
	* typeprint.c:
	* tramp-frame.h:
	* tramp-frame.c:
	* trad-frame.h:
	* trad-frame.c:
	* tracepoint.h:
	* top.c:
	* tobs.inc:
	* thread.c:
	* terminal.h:
	* target.h:
	* symfile.h:
	* stop-gdb.c:
	* vaxbsd-nat.c:
	* vax-tdep.h:
	* vax-tdep.c:
	* vax-nat.c:
	* varobj.h:
	* varobj.c:
	* value.h:
	* value.c:
	* valprint.h:
	* valprint.c:
	* v850-tdep.c:
	* uw-thread.c:
	* user-regs.c:
	* ui-out.h:
	* ui-out.c:
	* ui-file.h:
	* xcoffsolib.h:
	* xcoffsolib.c:
	* wrapper.c:
	* wince.c:
	* wince-stub.h:
	* wince-stub.c:
	* vaxobsd-tdep.c:
	* vaxnbsd-tdep.c:
	* gdb_gcore.sh:
	* copying.c:
	* configure.ac:
	* aclocal.m4:
	* acinclude.m4:
	* reply_mig_hack.awk:
	* observer.sh:
	* gdb_mbuild.sh:
	* arm-linux-tdep.c:
	* blockframe.c:
	* dbug-rom.c:
	* environ.h:
	* dwarf2loc.h:
	* gdb-events.sh:
	* glibc-tdep.h:
	* gdb_wait.h:
	* gdbthread.h:
	* i386-sol2-tdep.c:
	* hppabsd-tdep.c:
	* hppa-linux-nat.c:
	* hppa-hpux-nat.c:
	* ia64-linux-tdep.c:
	* infptrace.c:
	* linespec.h:
	* maint.c:
	* mips-mdebug-tdep.h:
	* remote-m32r-sdi.c:
	* s390-nat.c:
	* rs6000-nat.c:
	* remote-utils.h:
	* sh3-rom.c:
	* sh-linux-tdep.c:
	* top.h:
	* symtab.h:
	* symmisc.c:
	* symfile-mem.c:
	* srec.h:
	* user-regs.h:
	* version.h:
	* valarith.c:
	* xstormy16-tdep.c:
	* wrapper.h:
	* Makefile.in:
	* f-exp.y:
	* cris-tdep.c:
	* cp-name-parser.y:
	* procfs.c:
	* proc-utils.h:
	* proc-flags.c:
	* proc-api.c:
	* p-exp.y:
	* m68hc11-tdep.c:
	* m2-exp.y:
	* kod.h:
	* kod-cisco.c:
	* jv-exp.y:
	* hppa-linux-tdep.c: Add (c) after Copyright.  Update the FSF
	address.
2005-12-17 22:34:03 +00:00
Daniel Jacobowitz 0cc7b39248 * elfread.c (elf_symtab_read): Remove if (1) and reindent. 2005-11-13 18:56:34 +00:00
Elena Zannoni 6255354386 2005-11-03 Daniel Jacobowitz <dan@codesourcery.com>
Checked in by Elena Zannoni  <ezannoni@redhat.com>

       * elfread.c (elf_symtab_read): Add number_of_symbols and
       symbol_table as arguments.  Do not load the symbol table
       here.
       (elf_symfile_read): Load the static and dynamic symbol tables
       here, before calling elf_symtab_read.  Also load any synthetic
       symbols and process those.
2005-11-04 02:44:25 +00:00
Alan Modra 85e3476f96 * elfread.c (elf_symtab_read): Discard section syms. 2005-02-21 11:00:44 +00:00
Andrew Cagney e2e0b3e57f 2005-02-11 Andrew Cagney <cagney@gnu.org>
Mark up error_no_arg, query, perror_with_name, complaint, and
	internal_error.
	* breakpoint.c, cp-abi.c, cp-namespace.c, cp-support.c: Update.
	* cris-tdep.c, dbxread.c, dictionary.c, dsrec.c: Update.
	* dummy-frame.c, dve3900-rom.c, dwarf2-frame.c, dwarf2expr.c: Update.
	* dwarf2read.c, dwarfread.c, elfread.c, event-loop.c: Update.
	* exceptions.c, exec.c, f-lang.c, findvar.c, fork-child.c: Update.
	* frame-unwind.c, frame.c, frv-linux-tdep.c, frv-tdep.c: Update.
	* gdb_assert.h, gdbarch.c, gdbtypes.c, gnu-nat.c: Update.
	* go32-nat.c, hppa-tdep.c, hppabsd-nat.c, hpread.c: Update.
	* i386-linux-nat.c, i386-nat.c, i386-tdep.c, i386bsd-nat.c: Update.
	* i386fbsd-nat.c, inf-ptrace.c, inf-ttrace.c, infcall.c: Update.
	* infcmd.c, inflow.c, infptrace.c, infrun.c, inftarg.c: Update.
	* interps.c, language.c, linespec.c, linux-nat.c: Update.
	* m32r-linux-nat.c, m68k-tdep.c, m68kbsd-nat.c: Update.
	* m68klinux-nat.c, m88kbsd-nat.c, macroexp.c, macroscope.c: Update.
	* macrotab.c, maint.c, mdebugread.c, memattr.c: Update.
	* mips-linux-tdep.c, mips-tdep.c, mips64obsd-nat.c: Update.
	* mipsnbsd-nat.c, mn10300-tdep.c, monitor.c, nto-procfs.c: Update.
	* objc-lang.c, objfiles.c, objfiles.h, ocd.c, osabi.c: Update.
	* parse.c, ppc-bdm.c, ppc-linux-nat.c, ppc-sysv-tdep.c: Update.
	* ppcnbsd-nat.c, ppcobsd-nat.c, printcmd.c, procfs.c: Update.
	* regcache.c, reggroups.c, remote-e7000.c, remote-mips.c: Update.
	* remote-rdp.c, remote-sds.c, remote-sim.c, remote-st.c: Update.
	* remote-utils.c, remote.c, rs6000-nat.c, rs6000-tdep.c: Update.
	* s390-nat.c, s390-tdep.c, sentinel-frame.c, serial.c: Update.
	* sh-tdep.c, sh3-rom.c, sh64-tdep.c, shnbsd-nat.c: Update.
	* solib-aix5.c, solib-svr4.c, solib.c, source.c: Update.
	* sparc-nat.c, stabsread.c, stack.c, symfile.c, symtab.c: Update.
	* symtab.h, target.c, tracepoint.c, ui-file.c, ui-out.c: Update.
	* utils.c, valops.c, valprint.c, vax-nat.c, vaxbsd-nat.c: Update.
	* win32-nat.c, xcoffread.c, xstormy16-tdep.c: Update.
	* cli/cli-cmds.c, cli/cli-logging.c, cli/cli-script.c: Update.
	* cli/cli-setshow.c, mi/mi-cmd-break.c, mi/mi-cmds.c: Update.
	* mi/mi-console.c, mi/mi-getopt.c, mi/mi-out.c: Update.
	* tui/tui-file.c, tui/tui-interp.c: Update.
2005-02-11 18:13:55 +00:00
Andrew Cagney 8a3fe4f86c 2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
	* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
	* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
	* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
	* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
	* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
	* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
	* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
	* event-top.c, exec.c, expprint.c, f-lang.c: Update.
	* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
	* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
	* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
	* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
	* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
	* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
	* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
	* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
	* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
	* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
	* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
	* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
	* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
	* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
	* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
	* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
	* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
	* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
	* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
	* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
	* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
	* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
	* remote-rdp.c, remote-sim.c, remote-st.c: Update.
	* remote-utils.c, remote-utils.h, remote.c: Update.
	* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
	* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
	* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
	* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
	* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
	* somread.c, somsolib.c, source.c, stabsread.c: Update.
	* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
	* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
	* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
	* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
	* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
	* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
	* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
	* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
	* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
	* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
	* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
	* tui/tui-win.c: Update.
2005-02-11 04:06:14 +00:00
Andrew Cagney 0a6ddd0822 2004-10-23 Andrew Cagney <cagney@gnu.org>
* objfiles.h (struct objfile): Rename obj_private to
	deprecated_obj_private, sym_private to deprecated_sym_private, and
	sym_stab_info to deprecated_sym_stab_info.
	* gdb-stabs.h: Update.
	* elfread.c: Update.
	* dbxread.c: Update.
	* coffread.c: Update.
	* xcoffread.c: Update.
	* symfile.c: Update.
	* somread.c: Update.
	* nlmread.c: Update.
	* mdebugread.c: Update.
	* hpread.c: Update.
	* coffread.c: Update.
2004-10-23 16:18:09 +00:00
Andrew Cagney 2dc74dc121 2004-08-10 Andrew Cagney <cagney@gnu.org>
* defs.h (xmfree): Delete.
	* utils.c (xmfree): Delete function.
	(xfree): Inline calls to xmfree and mfree.
	* symmisc.c (free_symtab_block, free_symtab): Use xfree.
	* symfile.c (reread_symbols, init_psymbol_list): Ditto.
	* source.c (forget_cached_source_info, find_and_open_source): Ditto.
	* somread.c (som_symfile_finish): Ditto.
	* objfiles.c (allocate_objfile, free_objfile):
	* nlmread.c (nlm_symfile_finish): Ditto.
	* hpread.c (hpread_symfile_finish): Ditto.
	* elfread.c (free_elfinfo, elf_symfile_finish): Ditto.
	* dbxread.c (dbx_symfile_finish, free_bincl_list): Ditto.
	* coffread.c (coff_symfile_finish): Ditto.
2004-08-10 21:52:05 +00:00
Andrew Cagney 7936743b08 2004-08-10 Andrew Cagney <cagney@gnu.org>
* utils.c (xmmalloc): Delete.
	(xmalloc): Inline xmmalloc and mmalloc calls.
	(msavestring): Use xmalloc.
	* defs.h (xmmalloc): Delete declaration.
	* xcoffread.c (xcoff_symfile_init): Use xmalloc instead of
	xmmalloc.
	* symmisc.c (extend_psymbol_list): Ditto.
	* symfile.c (init_psymbol_list): Ditto.
	* source.c (find_source_lines): Ditto.
	* hpread.c (hpread_symfile_init, hpread_lookup_type): Ditto.
	* elfread.c (elf_symtab_read): Ditto.
	* dbxread.c (dbx_symfile_init, init_bincl_list): Ditto.
	* coffread.c (coff_symfile_init): Ditto.
2004-08-10 19:37:47 +00:00
Alan Modra 2c500098f2 * dsrec.c (load_srec, make_srec): Use bfd_get_section_size instead of
bfd_get_section_size_before_reloc or _raw_size.
	* dwarf2-frame.c (dwarf2_build_frame_info): Likewise.
	* dwarf2read.c (dwarf2_locate_sections): Likewise.
	(dwarf2_read_section): Likewise.
	* elfread.c (elf_locate_sections): Likewise.
	* gcore.c (derive_heap_segment): Likewise.
	* mipsread.c (read_alphacoff_dynamic_symtab): Likewise.
	* remote-e7000.c (e7000_load): Likewise.
	* remote-m32r-sdi.c (m32r_load): Likewise.
	* remote-mips.c (mips_load_srec): Likewise.
	(pmon_load_fast): Likewise.
	* remote.c (compare_sections_command): Likewise.
	* symfile.c (add_section_size_callback): Likewise.
	(load_section_callback): Likewise.
	(pc_in_unmapped_range): Likewise.
	(pc_in_mapped_range): Likewise.
	(sections_overlap): Likewise.
	(list_overlays_command): Likewise.
	(simple_overlay_update_1): Likewise.
	(simple_overlay_update): Likewise.
	* tracepoint.c (remote_set_transparent_ranges): Likewise.
	* win32-nat.c (core_section_load_dll_symbols): Likewise.
2004-06-15 01:04:20 +00:00
Daniel Jacobowitz c5edf76a75 * dwarf2read.c (dwarf2_objfile_data_key): New.
(struct dwarf2_per_objfile, dwarf2_per_objfile): New.
	(dwarf_info_size, dwarf_abbrev_size, dwarf_line_size)
	(dwarf_pubnames_size, dwarf_aranges_size, dwarf_loc_size)
	(dwarf_macinfo_size, dwarf_str_size, dwarf_ranges_size)
	(dwarf_frame_size, dwarf_eh_frame_size, dwarf_info_buffer)
	(dwarf_abbrev_buffer, dwarf_line_buffer, dwarf_str_buffer)
	(dwarf_macinfo_buffer, dwarf_ranges_buffer, dwarf_loc_buffer):
	Remove variables.
	(struct dwarf2_pinfo): Remove per-objfile members.  Update comments.
	(DWARF_ABBREV_SIZE, DWARF_LINE_SIZE)
	(DWARF_LOC_SIZE, DWARF_MACINFO_SIZE, DWARF_STR_SIZE)
	(DWARF_RANGES_SIZE, DWARF_INFO_BUFFER)
	(DWARF_ABBREV_BUFFER, DWARF_LINE_BUFFER, DWARF_STR_BUFFER)
	(DWARF_MACINFO_BUFFER, DWARF_RANGES_BUFFER, DWARF_LOC_BUFFER):
	Remove macros.
	(dwarf2_has_info): Take an objfile argument.  Allocate per-objfile
	data.
	(dwarf2_locate_sections, dwarf2_build_psymtabs)
	(dwarf2_build_psymtabs_easy, dwarf2_build_psymtabs_hard)
	(skip_one_die, dwarf2_get_pc_bounds, dwarf2_read_abbrevs)
	(read_partial_die, read_full_die, read_indirect_string)
	(dwarf_decode_line_header, dwarf_decode_macros)
	(dwarf2_symbol_mark_computed): Remove use of removed macros.
	Update uses of removed variables.
	(psymtab_to_symtab_1): Restore per-objfile data pointer.  Remove use
	of removed macros.
	(_initialize_dwarf2_read): New function.
	* symfile.h (dwarf2_has_info): Update prototype.
	* coffread.c (coff_symfile_read): Update call to dwarf2_has_info.
	* elfread.c (elf_symfile_read): Likewise.
2004-04-02 19:23:05 +00:00
Elena Zannoni 4a146b47d7 2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* buildsym.c (free_pending_blocks, finish_block)
	(record_pending_block, make_blockvector, end_symtab): Replace
	symbol_obstack with objfile_obstack.
	* coffread.c (process_coff_symbol, coff_read_struct_type)
	(coff_read_enum_type): Ditto.
	* cp-namespace.c (initialize_namespace_symtab)
	(check_one_possible_namespace_symbol): Ditto.
	* dwarf2read.c (new_symbol, dwarf2_const_value, macro_start_file)
	(dwarf2_symbol_mark_computed): Ditto.
	* dwarfread.c (enum_type, new_symbol, synthesize_typedef): Ditto.
	* elfread.c (elf_symtab_read): Ditto.
	* hpread.c (hpread_symfile_init, hpread_symfile_init)
	(hpread_read_enum_type, hpread_read_function_type)
	(hpread_read_doc_function_type, hpread_process_one_debug_symbol):
	Ditto.
	* jv-lang.c (get_java_class_symtab, add_class_symbol)
	(java_link_class_type): Ditto.
	* mdebugread.c (parse_symbol, psymtab_to_symtab_1, new_symtab)
	(new_symbol): Ditto.
	* minsyms.c (install_minimal_symbols): Ditto.
	* objfiles.c (allocate_objfile): Remove init of symbol_obstack.
	(terminate_minimal_symbol_table): Replace symbol_obstack with
	objfile_obstack.
	(free_objfile): Remove freeing of symbol_obstack.
	* objfiles.h: Remove symbol_obstack field.
	* pa64solib.c (add_to_solist): Replace symbol_obstack with
	objfile_obstack.
	* solib-sunos.c (allocate_rt_common_objfile): Remove init of
	symbol_obstack.
	(solib_add_common_symbols): Replace symbol_obstack with
	objfile_obstack.
	* somsolib.c (som_solib_add): Ditto.
	* stabsread.c (patch_block_stabs, define_symbol, read_enum_type)
	(common_block_start, common_block_end): Ditto.
	* symfile.c (reread_symbols): Remove freeing and init of
	symbol_obstack.
	(allocate_symtab): Rename symbol_obstack to objfile_obstack.
	* symfile.h: Update comment.
	* symmisc.c (print_objfile_statistics): Remove symbol_obstack
	stats printing.
	* symtab.c (symbol_set_names): Replace symbol_obstack with
	objfile_obstack.
	* symtab.h (struct general_symbol_info, struct minimal_symbol):
	Update comments.
	* xcoffread.c (read_xcoff_symtab, SYMBOL_DUP, SYMNAME_ALLOC)
	(init_stringtab, xcoff_initial_scan): Replace symbol_obstack with
	objfile_obstack.
2004-02-07 23:13:47 +00:00
Elena Zannoni 8b92e4d54f 2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* dbxread.c (dbx_symfile_init, start_psymtab, end_psymtab,
	coffstab_build_psymtabs, elfstab_build_psymtabs)
	(stabsect_build_psymtabs): Replace psymbol_obstack with
	objfile_obstack.
	* dwarf2-frame.c (decode_frame_entry_1): Ditto.
	* dwarf2read.c (dwarf2_build_psymtabs_hard, dwarf2_read_section):
	Ditto.
	* dwarfread.c (scan_compilation_units): Ditto.
	* elfread.c (elfstab_offset_sections): Ditto.
	* hppa-tdep.c (read_unwind_info): Ditto.
	* hpread.c (hpread_build_psymtabs, hpread_start_psymtab)
	(hpread_end_psymtab): Ditto.
	* mdebugread.c (mdebug_build_psymtabs, add_pending)
	(parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
	Ditto.
	* mips-tdep.c (non_heuristic_proc_desc): Ditto.
	* objfiles.c (add_to_objfile_sections)
	(build_objfile_section_table): Ditto.
	(allocate_objfile): Remove init of psymbol_obstack.
	(free_objfile): Remove freeing of psymbol_obstack.
	* objfiles.h (struct objfile): Remove field
	psymbol_obstack. Update comments.
	* pa64solib.c (pa64_solib_add_solib_objfile): Replace
	psymbol_obstack with objfile_obstack.
	* solib-sunos.c (allocate_rt_common_objfile): Remove init of
        psymbol_obstack.
	* somread.c (som_symfile_offsets, init_import_symbols)
	(init_export_symbols): Replace psymbol_obstack with
	objfile_obstack.
	* somsolib.c (som_solib_add_solib_objfile): Ditto.
	* symfile.c (default_symfile_offsets, syms_from_objfile)
	(reread_symbols): Remove freeing and init of psymbol_obstack.
	(cashier_psymtab): Update comment.
	* symmisc.c (print_objfile_statistics): Don't report stats for
	psymbol obstack.
	* symtab.h (struct general_symbol_info, struct partial_symtab):
	Update comments.
	* xcoffread.c (xcoff_start_psymtab, xcoff_end_psymtab, swap_sym)
	(xcoff_symfile_offsets): Replace psymbol_obstack with
	objfile_obstack.
2004-02-07 18:29:54 +00:00
Andrew Cagney 66c5728963 2003-11-23 Andrew Cagney <cagney@redhat.com>
* symfile.c (symbol_file_command): Replace STREQ with strcmp.
	* elfread.c (elf_symtab_read): Delete STREQ from comment.
2003-11-23 19:24:05 +00:00
Michael Chastain f594e5e9c9 2003-11-07 Michael Chastain <mec@shout.net>
* symtab.h (struct minimal_symbol): Add size.
	* dbxread.c: Use it.
	* elfread.c: (record_minimal_symbol_and_info): Do not use info.
	Rename to record_minimal_symbol.
	(elf_symtab_read): Set MSYMBOL_SIZE explicitly.
	* minsyms.c (prim_record_minimal_symbol_and_info): Initialize MSYMBOL_SIZE.
	(install_minimal_symbols): Ditto.
	* objfiles.c (terminate_minimal_symbol_table): Ditto.
	* arm-tdep.c: Delete unused MSYMBOL_SIZE.
	* m68hc11-tdep.c: Ditto.
	* mips-tdep.c: Ditto.
	* sh64-tdep.c: Ditto.
2003-11-11 20:04:52 +00:00
Andrew Cagney 6314a34934 2003-11-07 Andrew Cagney <cagney@redhat.com>
* top.c (print_gdb_version): Replace STREQ with strcmp.
	* valops.c (value_struct_elt_for_reference): Ditto.
	(value_struct_elt_for_reference): Ditto.
	* symtab.c (gdb_mangle_name): Ditto.
	(find_line_symtab): Ditto.
	* symmisc.c (maintenance_print_symbols): Ditto.
	* symfile.c (symbol_file_command): Ditto.
	* stabsread.c (define_symbol, read_type): Ditto.
	(cleanup_undefined_types, scan_file_globals): Ditto.
	* solib.c (solib_map_sections): Ditto.
	* solib-svr4.c (bfd_lookup_symbol): Ditto.
	* rs6000-tdep.c (skip_prologue): Ditto.
	* p-valprint.c (pascal_value_print): Ditto.
	(pascal_object_is_vtbl_ptr_type): Ditto.
	* objfiles.c (in_plt_section): Ditto.
	* minsyms.c (lookup_minimal_symbol): Ditto.
	(compact_minimal_symbols): Ditto.
	(find_solib_trampoline_target): Ditto.
	* mdebugread.c (parse_type): Ditto.
	* language.c (set_language_command): Ditto.
	(set_type_command, set_range_command): Ditto.
	* f-lang.c (add_common_block): Ditto.
	(add_common_block): Ditto.
	(find_first_common_named): Ditto.
	(patch_all_commons_by_name): Ditto.
	* elfread.c (elf_locate_sections): Ditto.
	(elf_locate_sections): Ditto.
	(elfstab_offset_sections): Ditto.
	* dwarf2read.c (dwarf2_locate_sections): Ditto.
	* dbxread.c (add_old_header_file): Ditto.
	(find_corresponding_bincl_psymtab): Ditto.
	(read_dbx_symtab, process_one_symbol): Ditto.
	* coffread.c (patch_opaque_types): Ditto.
	* cli/cli-decode.c (delete_cmd): Ditto.
	* cli/cli-cmds.c (pwd_command, list_command): Ditto.
	* c-typeprint.c (c_type_print_base): Ditto.
	* breakpoint.c (bpstat_stop_status): Ditto.
	(clear_command, breakpoint_re_set_one): Ditto.
2003-11-08 00:13:03 +00:00
Andrew Cagney 7be0c53637 2003-11-05 Andrew Cagney <cagney@redhat.com>
* xcoffread.c (find_linenos): Replace "sec_ptr" and "bfd" with
	"struct bfd_section" and "struct bfd".
	* target.h (struct section_table): Ditto.
	* rs6000-nat.c (xcoff_relocate_core): Ditto.
	* solib-svr4.c (elf_locate_base): Ditto.
	* pa64solib.c (dld_cache_t): Ditto.
	* objfiles.h (struct obj_section): Ditto.
	* objfiles.c (add_to_objfile_sections): Ditto.
	* exec.c (bfdsec_to_vmap): Ditto.
	(add_to_section_table): Ditto.
	(build_section_table): Ditto.
	* corelow.c (get_core_register_section): Ditto.
	* coffread.c (find_linenos): Ditto.
	* elfread.c (elf_interpreter): Delete #if0'd function.

	* mips-tdep.c (mips_dump_tdep): Delete code prinint VX_NUM_REGS.
	* config/sparc/tm-vxsparc.h (VX_NUM_REGS): Delete macro.
	* config/mips/tm-vxmips.h (VX_NUM_REGS): Delete macro.
	* config/m68k/tm-vx68.h (VX_NUM_REGS): Delete macro.

	* arch-utils.h (generic_cannot_extract_struct_value_address):
	Delete declaration.
	* wince.c (_initialize_wince): Fix multi-line string.
	* ia64-tdep.c (floatformat_valid): Convert to ISO C.
2003-11-06 02:52:28 +00:00
Jim Blandy e372db4988 * elfread.c (elf_symtab_read): Allocate correct number of tail
elements to sectinfo structure.  (Fix from Woody LaRue.)
2003-10-31 22:47:48 +00:00
Andrew Cagney 52f0bd74b2 2003-09-14 Andrew Cagney <cagney@redhat.com>
* alpha-nat.c: Remove some occurances of "register".
	* alpha-tdep.c, arm-tdep.c, blockframe.c, breakpoint.c: Ditto.
	* buildsym.c, c-typeprint.c, c-valprint.c, coffread.c: Ditto.
	* corefile.c, cp-support.c, cp-valprint.c, cris-tdep.c: Ditto.
	* dbxread.c, dcache.c, dwarf2read.c, elfread.c: Ditto.
	* environ.c, eval.c, event-top.c, f-typeprint.c: Ditto.
	* f-valprint.c, findvar.c, frame.c, gdbtypes.c: Ditto.
	* h8300-tdep.c, hppa-tdep.c, hppab-nat.c, hppah-nat.c: Ditto.
	* hppam3-nat.c, hpread.c, ia64-aix-nat.c, ia64-linux-nat.c: Ditto.
	* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Ditto.
	* infttrace.c, irix5-nat.c, jv-typeprint.c: Ditto.
	* jv-valprint.c, m68k-tdep.c, m68klinux-nat.c, main.c: Ditto.
	* mdebugread.c, minsyms.c, mips-linux-tdep.c: Ditto.
	* mips-nat.c, mips-tdep.c, mipsread.c, mipsv4-nat.c: Ditto.
	* ns32k-tdep.c, objfiles.c, p-typeprint.c: Ditto.
	* p-valprint.c, ppc-linux-nat.c, printcmd.c: Ditto.
	* remote-mips.c, remote-vx.c, rs6000-nat.c: Ditto.
	* rs6000-tdep.c, scm-exp.c, sh-tdep.c, sh64-tdep.c: Ditto.
	* solib.c, somread.c, source.c, sparc-tdep.c: Ditto.
	* stabsread.c, stack.c, standalone.c, symfile.c: Ditto.
	* symmisc.c, symtab.c, top.c, tracepoint.c: Ditto.
	* typeprint.c, utils.c, valarith.c, valops.c: Ditto.
	* values.c, vax-tdep.c, xcoffread.c: Ditto.
2003-09-14 16:32:14 +00:00
Andrew Cagney 625b0b9752 2003-07-18 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (DWARF2_BUILD_FRAME_INFO): Delete method.
	* gdbarch.h, gdbarch.c: Re-generate.
	* i386-tdep.c (i386_gdbarch_init): Do not set
	DWARF2_BUILD_FRAME_INFO.
	* elfread.c (elf_symfile_read): Call dwarf2_build_frame_info
	unconditionally.
	* alpha-tdep.c (alpha_dwarf2_init_abi): Do not set
	DWARF2_BUILD_FRAME_INFO.
2003-07-18 21:31:50 +00:00
Andrew Cagney 9a90a78063 2003-06-07 Andrew Cagney <cagney@redhat.com>
* elfread.c (elf_symtab_read): Replace "special_local_sym_p" and
	"index" with "special_local_sect".  Use strcmp instead of STREQ.
	Append period to coments.
2003-06-07 15:51:05 +00:00
Mark Mitchell a39a16c41b * elfread.c (elf_symtab_read): Avoid use of SECT_OFF_MAX.
(elfstab_offset_sections): Likewise.
	* gdb-stabs.h (stab_section_info): Likewise.
	* i386-interix-tdep.c (pei_adjust_objfile_offsets): Likewise.
	* objfiles.c (objfile_relocate): Likewise.
	* pa64solib.c (pa64_solib_add_solib_objfile): Likewise.
	* remote.c (get_offsets): Likewise.
	(remote_cisco_objfile_relocate): Likewise.
	* somread.c (som_symfile_offsets): Likewise.
	* symfile.c (alloc_section_addr_info): New function.
	(build_section_addr_info_from_section_tab): Use it.
	(free_section_addr_info): Adjust.
	(default_symfile_offsets): Avoid use of SECT_OFF_MAX.
	(syms_from_objfile): Allocate local_addr dynamically.
	(symbol_file_add_with_addrs_or_offsets): Allocate orig_addrs
	dynamically.
	(add_symbol_file_command): Allocate sect_opts dynamically.
	(reread_symbols): Avoid use of SECT_OFF_MAX.
	* symfile.h (section_addr_info): Do not use MAX_SECTIONS.
	(alloc_section_addr_info): Declare it.
	* symtab.h (SIZEOF_SECTION_OFFSETS): Remove.
	* win32-nat.c (solib_symbols_add): Allocate section_addrs
	dynamically.
	* xcoffread.c (xcoff_symfile_offsets): Avoid use of SECT_OFF_MAX.
2003-06-06 23:33:00 +00:00
Daniel Jacobowitz 7134143f53 * coffread.c (coff_symfile_read): Clean up minimal symbols earlier.
* dbxread.c (elfstab_build_psymtabs): Don't call
	install_minimal_symbols.
	(stabsect_build_psymtabs): Likewise.
	* elfread.c (elf_symfile_read): Call install_minimal_symbols
	earlier.
	* somread.c (som_symfile_read): Call install_minimal_symbols
	and do_cleanups earlier.
	* nlmread.c (nlm_symfile_read): Likewise.
	* mdebugread.c (elfmdebug_build_psymtabs): Call
	install_minimal_symbols and make appropriate cleanups.
2003-02-20 18:31:14 +00:00
Daniel Jacobowitz 086df31126 * dbxread.c (stabs_data): New static variable.
(fill_symbuf): Support an in-memory buffer for stabs data.
	(stabs_seek): New function.
	(dbx_psymtab_to_symtab): Relocate the stabs data if necessary.
	(read_ofile_symtab): Use stabs_seek.
	(elfstab_build_psymtabs): Take an asection* instead of
	an offset and size.  Relocate the stabs data if necessary.
	Save the section* for dbx_psymtab_to_symtab.
	* dwarf2read.c: Add section variables for each debug section.
	(dwarf2_locate_sections): Fill them in.
	(dwarf2_read_section): Take an asection* argument.
	Relocate the section contents if necessary.
	(dwarf2_build_psymtabs, dwarf2_build_psymtabs_easy): Update callers.
	* dwarf2cfi.c (parse_frame_info): Take a section argument and pass
	it to dwarf2_read_section.
	(dwarf2_build_frame_info): Update callers.
	* elfread.c (elf_symfile_read): Update call to
	elfstab_build_psymtabs.
	* gdb-stabs.h (struct dbx_symfile_info): Add stab_section.
	(DBX_STAB_SECTION): New macro.
	* stabsread.h (elfstab_build_psymtabs): Update prototype.
	* symfile.c (symfile_dummy_outputs): New function.
	(symfile_relocate_debug_section): New function.
	* symfile.h (symfile_relocate_debug_section): Add prototype.
2003-01-31 19:22:18 +00:00
Andrew Cagney 1bac305b72 2003-01-13 Andrew Cagney <ac131313@redhat.com>
* ax-gdb.c, c-valprint.c, charset.c, corefile.c: Update copyright.
	* demangle.c, disasm.c, dwarf2cfi.c, dwarfread.c: Update copyright.
	* elfread.c, eval.c, expprint.c, expression.h: Update copyright.
	* f-typeprint.c, findvar.c, gcore.c, gdb_mbuild.sh: Update copyright.
	* gdbtypes.h, gnu-v2-abi.c, inferior.h, inftarg.c: Update copyright.
	* language.c, language.h, m32r-tdep.c: Update copyright.
	* mn10200-tdep.c, scm-lang.c, scm-lang.h: Update copyright.
	* somsolib.c, somsolib.h, symfile.c, symtab.h: Update copyright.
	* thread-db.c, typeprint.c, utils.c, valarith.c: Update copyright.
	* values.c, win32-nat.c, x86-64-linux-nat.c: Update copyright.
	* x86-64-linux-tdep.c, z8k-tdep.c: Update copyright.
	* cli/cli-decode.h, config/h8500/tm-h8500.h: Update copyright.

Index: mi/ChangeLog
2003-01-13  Andrew Cagney  <ac131313@redhat.com>

	* mi-cmd-env.c: Update copyright.
2003-01-14 00:49:06 +00:00
Andrew Cagney 1b831c9308 2003-01-02 Andrew Cagney <ac131313@redhat.com>
* valarith.c (value_binop): Delete obsolete code and comments.
	* configure.host: Ditto.
	* buildsym.h (make_blockvector): Ditto.
	* buildsym.c (make_blockvector): Ditto.
	* defs.h (enum language): Ditto.
	(chill_demangle): Ditto.
	* elfread.c (elf_symtab_read): Ditto.
	* dwarfread.c (CHILL_PRODUCER): Ditto.
	(set_cu_language): Ditto.
	(handle_producer): Ditto.
	* expprint.c (print_subexp): Ditto.
	* gdbtypes.c (chill_varying_type): Ditto.
	* gdbtypes.h (builtin_type_chill_bool): Ditto.
	(builtin_type_chill_char, builtin_type_chill_long): Ditto.
	(builtin_type_chill_ulong, builtin_type_chill_real): Ditto.
	(chill_varying_type): Ditto.
	* language.h (_LANG_chill): Ditto.
	* language.c (binop_result_type, integral_type): Ditto.
	(character_type, string_type, structured_type): Ditto.
	(lang_bool_type, binop_type_check): Ditto.
	* stabsread.h (os9k_stabs): Ditto.
	* stabsread.c (os9k_type_vector, dbx_lookup_type): Ditto.
	(define_symbol, read_type, read_struct_fields): Ditto.
	(read_array_type, read_enum_type, read_huge_number): Ditto.
	(read_range_type, start_stabs): Ditto.
	* symfile.c (init_filename_language_table): Ditto.
	(add_psymbol_with_dem_name_to_list): Ditto.
	* symtab.c (symbol_init_language_specific): Ditto.
	(symbol_init_demangled_name, symbol_demangled_name): Ditto.
	* symtab.h (struct general_symbol_info): Ditto.
	(SYMBOL_CHILL_DEMANGLED_NAME): Ditto.
	* typeprint.c (typedef_print): Ditto.
	* utils.c (fprintf_symbol_filtered): Ditto.
	* valops.c (value_cast, search_struct_field, value_slice): Delete
	obsolete code.
	(varying_to_slice): Delete function.
	* value.h (COERCE_VARYING_ARRAY): Delete obsolete macro contents.
	(varying_to_slice): Delete declaration.
	* MAINTAINERS: Update.
2003-01-02 14:27:27 +00:00
Kevin Buettner 231367095d Replace complain() with complaint(). 2002-12-17 00:39:08 +00:00
Andrew Cagney 72367fb45b 2002-10-25 Andrew Cagney <cagney@redhat.com>
* complaints.h (struct deprecated_complaint): Rename `struct
	complaint'.
	* complaints.c (complain): Update.
	* remote-vx68.c, remote-vxmips.c, remote-vxsparc.c: Delete
	incorrect comment indicating that "symfile.h" was being included
	for the `struct complaint' definition.
	* remote-vx.c: Update.
	* objc-lang.c: Update.
	* xcoffread.c: Update.
	* hpread.c: Update.
	* mdebugread.c: Update.
	* stabsread.c: Update.
	* dwarf2read.c: Update.
	* dwarfread.c: Update.
	* elfread.c: Update.
	* coffread.c: Update.
	* stabsread.h: Update.
	* dbxread.c: Update.
	* buildsym.c: Update.
	* gdbtypes.c: Update.
	* macrotab.c: Update.
2002-10-25 22:25:55 +00:00
Andrew Cagney 389e51db10 Revert previous change. Not obvious. 2002-09-19 03:58:41 +00:00
Michael Snyder 3b4efeaa2d 2002-09-18 Michael Snyder <msnyder@redhat.com>
Preliminary support for Objective-C:
	* defs.h (language_objc): New enum value.
	(puts_filtered_tabular): Declaration only, exported from utils.c.
	(skip_quoted): Delete, declared in completer.h.
	* c-exp.y: Include completer.h.
	* p-exp.y: Ditto.
	* jv-exp.y: Ditto.
	* expression.h (OP_MSGCALL, OP_SELECTOR, OP_SELF, OP_NSSTRING):
	New operator enum values.
	* language.h (CAST_IS_CONVERSION): Test for language_objc.
	* language.c (binop_result_type): Handle language_objc case.
	(integral_type, character_type, string_type, boolean_type,
	structured_type, binop_type_check): Ditto.
	* symtab.h (SYMBOL_OBJC_DEMANGLED_NAME): Define.
	(struct objc_specific): Add to general_symbol_info.
	(SYMBOL_INIT_LANGUAGE_SPECIFIC): Add objc initialization.
	(SYMBOL_DEMANGLED_NAME): Handle objc case.
	* parser-defs.h (struct objc_class_str): New struct type.
	(start_msglist, end_msglist, add_msglist): Declaration only,
	exported from objc-lang.c.
	* value.h (value_of_local, value_nsstring,
	call_function_by_hand_expecting_type): Exported from valops.c.
	* valops.c (find_function_addr): Export.
	(call_function_by_hand_expecting_type): New function.
	(value_of_local): New function.
	* symfile.c (init_filename_language_table): Add ".m" extension
	for Objective-C.
	* utils.c (puts_filtered_tabular): New function.
	(fprintf_symbol_filtered): Add objc demangling support (disabled).
	(set/show demangle): Extend help-string to refer to ObjC.
	* elfread.c (elf_symtab_read): Skip Objective-C special symbols.
	* stabsread.c (symbol_reference_defined): Objective-C symbols
	may contain colons: make allowances when scanning stabs strings
	for colons.
	(objc_find_colon): New function.
	* printcmd.c (address_info): If language == objc then print
	"self" instead of "this".
	* parse.c (length_of_subexp): Handle new operators OP_MSGCALL,
	OP_NSSTRING, and OP_SELF.
	(prefixify_subexp): Ditto.
	* source.c (print_source_lines): Mention objc in comment.
	* breakpoint.c (parse_breakpoint_sals): Recognize Objective-C
	method names.
2002-09-19 01:34:51 +00:00
Andrew Cagney 7fb623f7ad Obsolete m88k. 2002-07-24 23:51:36 +00:00
Jim Blandy 78b119cb5d Remove some vestiges of Harris 88k support.
* dwarf2read.c (decode_locdesc): Remove `#if' block for Harris 88k
register numbering quirk.
* elfread.c (elf_symtab_read): Remove `#if' block for skipping
odd symbols occurring in Harris 88k ELF targets.
2002-06-22 00:05:59 +00:00
Alexandre Oliva 12b9c64f8d * coffread.c: Remove redundant static declarations. Replace
occurrences of `PTR' with `void *'.
* elfread.c, mdebugread.c, minsyms.c, mipsread.c: Likewise.
* top.h (quit_cover): Likewise.
* defs.h (catch_errors): Likewise.
2002-03-19 19:00:04 +00:00
Elena Zannoni a2cf933af4 2002-02-04 Elena Zannoni <ezannoni@redhat.com>
* gdbarch.sh: Add definitions for COFF_MAKE_MSYMBOL_SPECIAL and
	ELF_MAKE_MSYMBOL_SPECIAL.
	* gdbarch.c, gdbarch.h: Regenerate.
	* arch-utils.c (default_elf_make_msymbol_special,
        default_coff_make_msymbol_special): New functions.
	* arch-utils.h (default_elf_make_msymbol_special,
        default_coff_make_msymbol_special): Export.
	* elfread.c (elf_symtab_read): Compile use of
	ELF_MAKE_MSYMBOL_SPECIAL unconditionally because it is now
	multiarched.
	* coffread.c (coff_symtab_read): Ditto, for
	COFF_MAKE_MSYMBOL_SPECIAL.
2002-02-06 01:20:23 +00:00
Richard Earnshaw 181c1381a5 * gdbarch.sh (copyright): Update years in generated header.
(SMASH_TEXT_ADDRESS): Add rule.
*gdbarch.h, gdbarch.c: Re-generate.
* coffread.c: Multi-arch uses of SMASH_TEXT_ADDRESS.
* dbxread.c: Likewise.
* dwarfread.c: Likewise.
* elfread.c: Likewise.
* somread.c: Likewise.

* arm-tdep.c (arm_smash_text_address): New function.
* config/arm/tm-arm.h (SMASH_TEXT_ADDRESS): Define in terms of above.
2002-02-04 11:55:36 +00:00