Commit Graph

161 Commits

Author SHA1 Message Date
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
Jan Kratochvil 93f2a35e10 gdb/
Fix compilation --without-expat.
	* solib-svr4.c (svr4_free_so, svr4_free_library_list): Move them here
	from ...
	[HAVE_LIBEXPAT] (svr4_free_so, svr4_free_library_list): ... here.
2011-12-03 18:32:29 +00:00
Jan Kratochvil 2268b414f4 gdb/
* Makefile.in (XMLFILES): Add library-list-svr4.dtd.
	* features/library-list-svr4.dtd: New file.
	* remote.c (PACKET_qXfer_libraries_svr4): New.
	(remote_protocol_features): new entry for PACKET_qXfer_libraries_svr4.
	(remote_xfer_partial): Handle TARGET_OBJECT_LIBRARIES_SVR4.
	* solib-svr4.c (struct svr4_library_list): New.
	[HAVE_LIBEXPAT]: Include xml-support.h.
	[HAVE_LIBEXPAT] (svr4_library_list_start_library)
	[HAVE_LIBEXPAT] (svr4_library_list_start_list, svr4_library_attributes)
	[HAVE_LIBEXPAT] (svr4_library_list_children)
	[HAVE_LIBEXPAT] (svr4_library_list_attributes)
	[HAVE_LIBEXPAT] (svr4_library_list_elements, svr4_parse_libraries)
	[HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries)
	[!HAVE_LIBEXPAT] (svr4_current_sos_via_xfer_libraries): New.
	(svr4_read_so_list): Extend the corruption message by addresses.
	(svr4_current_sos): New variable library_list, call
	svr4_current_sos_via_xfer_libraries.
	* target.h (enum target_object): New TARGET_OBJECT_LIBRARIES_SVR4.

gdb/gdbserver/
	* linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
	(read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
	New.
	(struct linux_target_ops): Install linux_qxfer_libraries_svr4.
	* linux-low.h (struct process_info_private): New member r_debug.
	* server.c (handle_qxfer_libraries): Call
	the_target->qxfer_libraries_svr4.
	(handle_qxfer_libraries_svr4): New function.
	(qxfer_packets): New entry "libraries-svr4".
	(handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
	* target.h (struct target_ops): New member qxfer_libraries_svr4.
	* remote.c (remote_xfer_partial): Call add_packet_config_cmd for
	PACKET_qXfer_libraries_svr4.

gdb/doc/
	* gdb.texinfo (Requirements, Remote Protocol): Reference also `Library
	List Format for SVR4 Targets'.
	(General Query Packets): New item qXfer:libraries-svr4:read.
	(Library List Format for SVR4 Targets): New node.

gdb/testsuite/
	* gdb.base/solib-corrupted.exp: Suppress test on is_remote target.
	(corrupted list): Adjust the expectation.
2011-12-02 22:26:54 +00:00
Aleksandar Ristovski 4313697959 * solib-svr4.c (read_program_header): New variables pt_phdr, pt_phdr_p,
initialize them from target PT_PHDR p_vaddr, relocate sect_addr by
	pt_phdr if PT_PHDR was found.

	* gdb.base/attach-pie-noexec.c: New files.
	* gdb.base/attach-pie-noexec.exp: New files.
2011-10-18 14:00:42 +00:00
Jan Kratochvil 3957565a96 gdb/
Drop lazy lm_info reading.
	* solib-svr4.c (struct lm_info): Remove field lm.  New fields l_addr_p,
	l_addr_inferior, l_ld, l_next, l_prev and l_name.
	(lm_info_read): New function.
	(lm_addr_from_link_map, lm_dynamic_from_link_map): Remove.
	(lm_addr_check): Use l_addr_p.  No longer use lm_addr_from_link_map and
	lm_dynamic_from_link_map.
	(lm_next, lm_prev, lm_name): Remove.
	(svr4_keep_data_in_core): Use lm_info_read, drop the lm_info entries
	initialization incl. read_memory.  No longer use lm_name.
	(svr4_free_so): Drop lm_info->lm freeing.
	(svr4_default_sos): Initialize lminfo with zeroes.  Use l_addr_p.  Drop
	explicit lm_addr and lm initialization.
	(svr4_read_so_list): Use lm_info_read, drop the initailization of
	fields by hand, incl. read_memory.  No longer use lm_next, lm_prev and
	lm_name.
2011-10-14 07:58:58 +00:00
Jan Kratochvil cb08cc53a9 gdb/
* defs.h (struct so_list): New forward declaration.
	(make_cleanup_free_so): New declaration.
	* solib-svr4.c (ignore_first_link_map_entry): Remove.
	(svr4_free_so): Move the function here from downwards.  Handle NULL
	so->lm_info.
	(svr4_free_library_list): New.
	(svr4_read_so_list): New, moved here code from svr4_current_sos.
	Use more cleanups.  Use new parameter ignore_first instead of
	ignore_first_link_map_entry.
	(svr4_current_sos): New variable ignore_first, initialize it.  New
	variable back_to, use it for svr4_free_library_list protection.
	(svr4_free_so): Remove - move upwards.
	* utils.c: Include solist.h.
	(do_free_so, make_cleanup_free_so): New functions.
2011-10-14 07:55:26 +00:00
Jan Kratochvil 8e5c319d86 gdb/
Code cleanup.
	* solib-svr4.c (svr4_default_sos):  Remove variables head and link_ptr.
	Rearrange the code for it.
2011-10-02 21:05:59 +00:00
Yao Qi cb457ae284 gdb/
* solib-dsbt.c (bfd_lookup_symbol): Removed.
	(cmp_name): New.
	(enable_break2): Update caller.
	* solib-frv.c (bfd_lookup_symbol): Removed.
	(cmp_name): New.
	(enable_break2): Update caller.
	* solib-pa64.c (bfd_lookup_symbol): Removed.
	(cmp_name): New.
	* solib-svr4.c (bfd_lookup_symbol): Removed.
	(cmp_name_and_sec_flags): New.
	(enable_break): Update caller.
	* solib.c (gdb_bfd_lookup_symbol_from_symtab): New.
	(gdb_bfd_lookup_symbol_from_dyn_symtab): New.
	(gdb_bfd_lookup_symbol): New.
	* solib.h: Functions declarations.
2011-08-30 02:48:05 +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 d989b28323 Clean up trailing white space 2011-08-05 15:17:23 +00:00
Tom Tromey 3bb47e8bce * symfile-mem.c (symbol_file_add_from_memory): Call do_cleanups.
* solib-svr4.c (open_symbol_file_object): Call do_cleanups on all
	return paths.  Defer final do_cleanups until last return.
	* arm-tdep.c (arm_exidx_new_objfile): Make null cleanup after
	early return.
2011-06-30 18:48:19 +00:00
Pedro Alves c91c8c1612 2011-05-24 Pedro Alves <pedro@codesourcery.com>
gdb/
	* solib-svr4.c (svr4_solib_create_inferior_hook): Skip setting
	shared library event breakpoint if there's no execution.

	gdb/testsuite/
	* gdb.trace/tfile.exp: Add test that opening the basic.tf trace
	file doesn't error, using MI.
2011-05-24 10:48:19 +00:00
Pedro Alves e4c8541fca 2011-05-09 Pedro Alves <pedro@codesourcery.com>
* inferior.h (wait_for_inferior): Remove `thread_exec_as_sigtrap'
	parameter.
	* infrun.c (proceed, start_remote): Adjust.
	(wait_for_inferior): Remove `thread_exec_as_sigtrap' parameter,
	and adjust to not handle it.
	* solib-irix.c (irix_solib_create_inferior_hook): Adjust.
	* solib-osf.c (osf_solib_create_inferior_hook): Adjust.
	* solib-sunos.c (sunos_solib_create_inferior_hook): Adjust.
	* solib-svr4.c (svr4_solib_create_inferior_hook): Adjust.
	* windows-nat.c (do_initial_windows_stuff): Adjust.
	* infcmd.c (attach_command): Adjust.
	(notice_new_inferior): Adjust.
2011-05-09 14:25:37 +00:00
Pierre Muller 74de023457 * solib-svr4.c (svr4_keep_data_in_core): Rename local variable
lm_name to name_lm to avoid conflict with lm_name function.
2011-04-19 12:32:20 +00:00
Pierre Muller b23518f0c8 ARI fixes: Use only lowercase function name for static functions.
* nto-tdep.c (LM_ADDR): Rename to...
	(lm_addr): New function name.
	(nto_relocate_section_addresses): Adapt to change above.
	* solib-sunos.c (LM_ADDR): Rename to...
	(lm_addr): New function name.
	(LM_NEXT): Rename to...
	(lm_next): New function name.
	(sunos_current_sos, sunos_relocate_section_addresses): Adapt to
	function name changes above.
	* solib-svr4.c (LM_ADDR_FROM_LINK_MAP): Rename to...
	(lm_addr_from_link_map): New function name.
	(HAS_LM_DYNAMIC_FROM_LINK_MAP): Rename to...
	(has_lm_dynamic_from_link_map): New function name.
	(LM_DYNAMIC_FROM_LINK_MAP): Rename to...
	(lm_dynamic_from_link_map): New function name.
	(LM_ADDR_CHECK): Rename to...
	(lm_addr_check): New function name.
	(LM_NEXT): Rename to...
	(lm_next): New function name.
	(LM_PREV): Rename to...
	(lm_prev): New function name.
	(LM_NAME): Rename to...
	(lm_name): New function name.
	(IGNORE_FIRST_LINK_MAP_ENTRY): Rename to...
	(ignore_first_link_map_entry): New function name.
	(svr4_keep_data_in_core): Adapt to function name changes above.
	(svr4_current_sos): Likewise.
	(enable_break): Likewise.
	(svr4_relocate_section_addresses): Likewise.
2011-04-19 11:38:40 +00:00
Jan Kratochvil 0283589814 gdb/
Fix libraries displacement if they change whether they were prelinked.
	* solib-svr4.c (LM_ADDR_CHECK): Set L_ADDR even if the DYNAMIC pointer
	does not match.  Comment why.

gdb/testsuite/
	* gdb.base/break-interp-lib.c (v, vptr): New variables.
	* gdb.base/break-interp.exp (test_attach): New comment.
2011-04-17 19:17:10 +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
Michael Snyder c378eb4eaa 2011-01-11 Michael Snyder <msnyder@vmware.com>
* s390-tdep.c: Comment cleanup, mostly periods and spaces.
	* score-tdep.c: Ditto.
	* score-tdep.h: Ditto.
	* ser-base.c: Ditto.
	* ser-go32.c: Ditto.
	* serial.c: Ditto.
	* serial.h: Ditto.
	* ser-mingw.c: Ditto.
	* ser-pipe.c: Ditto.
	* ser-tcp.c: Ditto.
	* ser-unix.c: Ditto.
	* sh64-tdep.c: Ditto.
	* shnbsd-nat.c: Ditto.
	* sh-tdep.c: Ditto.
	* sh-tdep.h: Ditto.
	* solib.c: Ditto.
	* solib-darwin.c: Ditto.
	* solib-frv.c: Ditto.
	* solib.h: Ditto.
	* solib-irix.c: Ditto.
	* solib-osf.c: Ditto.
	* solib-pa64.c: Ditto.
	* solib-som.c: Ditto.
	* solib-spu.c: Ditto.
	* solib-sunos.c: Ditto.
	* solib-svr4.c: Ditto.
	* solist.h: Ditto.
	* sol-thread.c: Ditto.
	* somread.c: Ditto.
	* source.c: Ditto.
	* source.h: Ditto.
	* sparc64-linux-tdep.c: Ditto.
	* sparc64-tdep.c: Ditto.
	* sparc-linux-nat.c: Ditto.
	* sparc-linux-tdep.c: Ditto.
	* sparc-sol2-nat.c: Ditto.
	* sparc-sol2-tdep.c: Ditto.
	* sparc-tdep.c: Ditto.
	* sparc-tdep.h: Ditto.
	* spu-tdep.c: Ditto.
	* stabsread.c: Ditto.
	* stabsread.h: Ditto.
	* stack.c: Ditto.
	* symfile.c: Ditto.
	* symfile.h: Ditto.
	* symmisc.c: Ditto.
	* symtab.c: Ditto.
	* symtab.h: Ditto.
	* target.c: Ditto.
	* target-descriptions.c: Ditto.
	* target-descriptions.h: Ditto.
	* target.h: Ditto.
	* target-memory.c: Ditto.
	* terminal.h: Ditto.
	* thread.c: Ditto.
	* top.c: Ditto.
	* tracepoint.c: Ditto.
	* tracepoint.h: Ditto.
	* trad-frame.h: Ditto.
	* typeprint.c: Ditto.
2011-01-11 21:53:25 +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
Kevin Buettner c6490bf2ed * solib-svr4.c (enable_break): Don't attempt to place breakpoints,
when attaching, on the names in bkpt_names: _start, __start, and
	main.
2010-12-13 15:45:55 +00:00
Jan Kratochvil 16c381f058 gdb/
Rename and move inferior_thread_state and inferior_status.
	* gdbthread.h (struct thread_control_state): New struct, move fields
	step_range_start, step_range_end, step_frame_id, step_stack_frame_id,
	trap_expected, proceed_to_finish, in_infcall, step_over_calls,
	stop_step and stop_bpstat here from struct thread_info.
	(struct thread_suspend_state): New struct, move field stop_signal here
	from struct thread_info.
	(struct thread_info): Move the fields above from this struct.
	* inferior.h: Move the inferior_thread_state and inferior_status
	declarations comment to their definitions at infrun.c.
	(struct inferior_control_state): New struct, move field stop_soon from
	struct inferior here.
	(struct inferior_suspend_state): New empty struct.
	(struct inferior): New fields control and suspend.  Move out field
	stop_soon.
	* infrun.c (struct inferior_thread_state): Rename to ...
	(infcall_suspend_state): ... here.  Replace field stop_signal by
	fields thread_suspend and inferior_suspend.
	(save_inferior_thread_state): Rename to ...
	(save_infcall_suspend_state): ... here.  New variable inf.  Update the
	code for new fields.
	(restore_inferior_thread_state): Rename to ...
	(restore_infcall_suspend_state): ... here.  New variable inf.  Update
	the code for new fields.
	(do_restore_inferior_thread_state_cleanup): Rename to ...
	(do_restore_infcall_suspend_state_cleanup): ... here.
	(make_cleanup_restore_inferior_thread_state): Rename to ...
	(make_cleanup_restore_infcall_suspend_state): ... here.
	(discard_inferior_thread_state): Rename to ...
	(discard_infcall_suspend_state): ... here.
	(get_inferior_thread_state_regcache): Rename to ...
	(get_infcall_suspend_state_regcache): ... here.
	(struct inferior_status): Rename to ...
	(struct infcall_control_state): ... here.  Replace fields
	step_range_start, step_range_end, step_frame_id, step_stack_frame_id,
	trap_expected, proceed_to_finish, in_infcall, step_over_calls,
	stop_step, stop_bpstat and stop_soon by fields thread_control and
	inferior_control.
	(save_inferior_status): Rename to ...
	(save_infcall_control_state): ... here.  Update the code for new
	fields.
	(restore_inferior_status): Rename to ...
	(restore_infcall_control_state): ... here.  Update the code for new
	fields.
	(do_restore_inferior_status_cleanup): Rename to ...
	(do_restore_infcall_control_state_cleanup): ... here.
	(make_cleanup_restore_inferior_status): Rename to ...
	(make_cleanup_restore_infcall_control_state): ... here.
	(discard_inferior_status): Rename to ...
	(discard_infcall_control_state): ... here.
	* alpha-tdep.c, breakpoint.c, dummy-frame.c, dummy-frame.h,
	exceptions.c, fbsd-nat.c, gdbthread.h, infcall.c, infcmd.c,
	inferior.c, inferior.h, infrun.c, linux-nat.c, mi/mi-interp.c,
	mips-tdep.c, procfs.c, solib-irix.c, solib-osf.c, solib-spu.c,
	solib-sunos.c, solib-svr4.c, thread.c, windows-nat.c: Update all the
	references to the moved fields and renamed functions.
2010-11-28 04:31:25 +00:00
Jan Kratochvil 43b8e24199 gdb/
Fix attaching to re-prelinked executables on ppc64.
	* solib-svr4.c (svr4_exec_displacement): New variable plt2_asect,
	initialize it, try to adjust FILESZ field by it.
2010-10-11 08:50:33 +00:00
Doug Evans bc043ef3f9 * breakpoint.c (bpdisp_text): Constify bpdisps.
* solib-svr4.c (solib_break_names): Constify.
	(bkpt_names, main_name_list): Constify.
	(match_main): Constify soname arg.
	(bfd_lookup_symbol): Constify symname arg.
	(enable_break): Constify bkpt_namep.
	* symtab.c (search_symbols): Constify types, types2, types3, types4.
	(symtab_symbol_info): Constify classnames.
2010-08-03 22:35:41 +00:00
Jan Kratochvil 4e5799b6d2 gdb/
Fix re-run of PIE executable, PR shlibs/11776.
	* solib-svr4.c (svr4_relocate_main_executable) <symfile_objfile>: Remove
	the part of pre-set SYMFILE_OBJFILE->SECTION_OFFSETS.

gdb/testsuite/
	Fix re-run of PIE executable, PR shlibs/11776.
	* gdb.base/break-interp.exp (test_ld): Turn off "disable-randomization".
	Remove $displacement_main to match the solib-svr4.c change.  New "kill"
	and re-"run" of the inferior.
2010-07-05 18:04:33 +00:00
Jan Kratochvil 86e4bafc3b gdb/
* auxv.c (memory_xfer_auxv): Update attach comment.
	* solib-svr4.c (svr4_special_symbol_handling): Remove the call to
	svr4_relocate_main_executable.
	(svr4_solib_create_inferior_hook): Make the call to
	svr4_relocate_main_executable unconditional.

gdb/testsuite/
	* gdb.base/attach-pie-misread.exp, gdb.base/attach-pie-misread.c: New.
	* gdb.base/break-interp.exp (reach, test_core, test_ld): Require each
	displacement message exactly once.
2010-07-05 18:00:40 +00:00
Jan Kratochvil 0a1e94c73e gdb/
Fix attaching to PIEs prelinked on the disk after the process was
	started.
	* solib-svr4.c (svr4_exec_displacement): New variable arch_size.
	Verify it against bfd_get_arch_size.  Try to match arbitrary
	displacement for the phdrs comparison.

gdb/testsuite/
	* gdb.base/break-interp.exp: Run $binpie with new value "ATTACH", new
	code for it.  New variable relink_args.
	(prelinkYES): Call prelinkNO.
	(test_attach): Accept new parameter relink_args.  Re-prelink the binary
	in such case.  Move the core code to ...
	(test_attach_gdb): ... a new function.  Send GDB command "file".
	Extend expected "Attaching to " string.
2010-07-05 17:57:50 +00:00
Michael Snyder 433759f709 2010-05-16 Michael Snyder <msnyder@vmware.com>
* scm-exp.c: White space.
	* scm-lang.c: White space.
	* scm-valprint.c: White space.
	* sentinel-frame.c: White space.
	* ser-base.c: White space.
	* ser-go32.c: White space.
	* serial.c: White space.
	* ser-mingw.c: White space.
	* ser-pipe.c: White space.
	* ser-tcp.c: White space.
	* ser-unix.c: White space.
	* solib.c: White space.
	* solib-darwin.c: White space.
	* solib-frv.c: White space.
	* solib-irix.c: White space.
	* solib-osf.c: White space.
	* solib-pa64.c: White space.
	* solib-som.c: White space.
	* solib-spu.c: White space.
	* solib-svr4.c: White space.
	* solib-target.c: White space.
	* source.c: White space.
	* stabsread.c: White space.
	* stack.c: White space.
	* std-regs.c: White space.
	* symfile.c: White space.
	* symmisc.c: White space.
	* symtab.c: White space.
2010-05-16 23:49:58 +00:00
Michael Snyder 1cd337a56b 2010-05-05 Michael Snyder <msnyder@vmware.com>
* solib-svr4.c (find_program_interpreter): Delete unused variable.
	(svr4_solib_create_inferior_hook): Add ifdef around
	conditionally-used variable declarations.
2010-05-05 19:50:10 +00:00
Joel Brobecker 6f992fbf7f Expand description of solib-svr4.c:solib_svr4_r_map
2010-04-27  Joel Brobecker  <brobecker@adacore.com>

        * solib-svr4.c (solib_svr4_r_map): Expand function description.
2010-04-27 21:02:11 +00:00
Jan Kratochvil 492928e407 gdb/
Fix deadlock on looped list of loaded shared objects.
	* solib-svr4.c (LM_PREV): New function.
	(IGNORE_FIRST_LINK_MAP_ENTRY): Use it.
	(svr4_current_sos): Check for correct l_prev.  New variables prev_lm
	and next_lm.  Clear prev_lm for solib_svr4_r_ldsomap.
	* config/djgpp/fnchange.lst: Add translation for solib-corrupted.exp.

gdb/testsuite/
	Fix deadlock on looped list of loaded shared objects.
	* gdb.base/solib-corrupted.exp: New.
2010-04-23 21:44:20 +00:00
Jan Kratochvil ccf2624776 gdb/
* solib-svr4.c (LM_ADDR_CHECK) <info_verbose>: Use printf_unfiltered
	for the PIC displacement, print also the displacement value.
	(svr4_exec_displacement):  Print DISPLACEMENT if INFO_VERBOSE.

gdb/testsuite/
	* gdb.base/break-interp.exp: Create new displacement parameter value
	for the test_ld calls.
	(reach): New parameter displacement, verify its content.  New push of
	pf_prefix "reach-$func:".  Import global expect_out.
	(test_core): New parameter displacement, verify its content.  New push
	of pf_prefix "core:".  New command "set verbose on".  Import global
	expect_out.
	(test_attach): New parameter displacement, verify its content.  New
	push of pf_prefix "attach:".  New command "set verbose on".  Import
	global expect_out.
	(test_ld): New parameter displacement, pass it to the reach, test_core
	and test_attach calls and verify its content in the "ld.so exit" test.
	* gdb.base/prelink.exp: Remove gdb_exit and final return.
	(prelink): Update expected text, use gdb_test.
2010-03-11 22:07:03 +00:00
Jan Kratochvil 01c30d6e99 gdb/
* solib-svr4.c (svr4_exec_displacement): Return now success, new
	parameter displacementp.  Update comment.
	(svr4_relocate_main_executable): Return if non-zero SECTION_OFFSETS
	element exists.  Return if svr4_exec_displacement was not successful.
	Update comment.
2010-03-10 20:55:44 +00:00
Jan Kratochvil 09919ac266 gdb/
* solib-svr4.c (read_program_header): Support type == -1 to read
	all program headers.
	(read_program_headers_from_bfd): New function.
	(svr4_static_exec_displacement): Remove and move the comment ...
	(svr4_exec_displacement): ... here.  Remove variable found.  New
	variable displacement.  Check also DYNAMIC.  Verify DISPLACEMENT
	alignment for ELF targets.  Compare target vs. exec_bfd PHDRs for ELF
	targets using read_program_headers_from_bfd.  Remove the call of
	svr4_static_exec_displacement.
2010-03-10 20:50:55 +00:00
Keith Seitz 94af9270db dwarf2_physname patchset:
Based on work from Daniel Jacobowitz  <dan@codesourcery.com>
	* c-typeprint.c (cp_type_print_method_args): For non-static methods,
	print out const or volatile qualifiers, too.
	(c_type_print_args): Add parameters show_artificial and language.
	Skip artificial parameters when requested.
	Use the appropriate language printer.
	(c_type_print_varspec): Tell c_type_print_args to skip artificial
	parameters and pass language_c.
	* dwarf2read.c (die_list): New file global.
	(struct partial_die_info): Update comments for name field.
	(pdi_needs_namespace): Renamed to ...
	(die_needs_namespace): ... this. Rewrite.
	(dwarf2_linkage_name): Remove.
	(add_partial_symbol): Do not predicate the call to
	partial_die_full_name based on pdi_needs_namespace.
	Remove call to cp_check_possible_namespace_symbols and associated
	outdated comments.
	(guess_structure_name): Do not inspect child subprogram DIEs.
	(dwarf2_fullname): Update comments.
	Use die_needs_namespace to assist in computing the name.
	(read_func_scope): Use dwarf2_name to get the DIE's name.
	Use dwarf2_physname to get the "linkage name" of the DIE.
	(dwarf2_add_member_field): Use dwarf2_physname instead of
	dwarf2_linkage_name.
	(read_structure_type): For structs and classes, set TYPE_NAME, too.
	(determine_class): Remove.
	(read_partial_die): Ignore DW_AT_MIPS_linkage_name for all languages
	except Ada.
	(new_symbol): Unconditionally call dwarf2_name.
	Compute the "linkage name" using dwarf2_physname.
	Use dwarf2_name instead of dwarf2_full_name for enumerator DIEs.
	When determining to scan for anonymous C++ namespaces, ignore
	the linkage name.
	(dwarf2_physname): New function.
	(dwarf2_full_name): Move content to new function and call
	that.
	(dwarf2_compute_name): "New" function.
	(_initialize_dwarf2_read): Initialize die_list.
	* gnu-v3-eabi.c (gnu_v3_find_method_in): Remove unused variable
	physname.
	(gnu_v3_print_method_ptr): Use the physname for virtual methods
	without a demangled name.
	Print out type information for non-virtual methods.
        * linespec.c (decode_line_1): Force ANY string using "::" (or
	"." for java) to use decode_compound, and clean up any stray quoting.
        If we found a file symtab, re-evaluate whether the remainder is_quoted.
        (decode_compound): Stop consuming at an open parenthesis.
        Keep template parameters.
        Keep any overload information.
        Keep keywords like "const".
        Remove paren_pointer.
        Move is_quoted check from set_flags to here.
        Remove #if 0 code from 2000. Ten years is long enough.
        (find_method): Before comparing symbol names, canonicalize the string
        from the user.
        If a specific overload is requested, find it. Otherwise throw an error.
	(find_method_overload_end): New function.
	(set_flags): Remove.
        (decode_compound): Assume that parentheses are matched.
        It's a lot easier.
	* symtab.c (symbol_find_demangled_name): Add DMGL_VERBOSE flag
	to cplus_demangle.
	* linespec.c (decode_line_1): Keep important keywords like
	"const" and "volatile".
	* symtab.h (SYMBOL_CPLUS_DEMANGLED_NAME): Remove.
	* typeprint.h (c_type_print_args): Add declaration.
	* ui-file.c (do_ui_file_obsavestring): New function.
	(ui_file_obsavestring): New function.
	* ui-file.h (ui_file_obsavestring): Add declaration.
	* valops.c (find_overload_match): Resolve the object to
	a non-pointer type.
	If the object is a data member, search the object for the member
	and return with staticp set.
	Use SYMBOL_NATURAL_NAME instead of SYMBOL_CPLUS_DEMANGLED_NAME.
	Do not attempt to extract a function name from non-function types.
	If the extracted function name and the original name are the same,
	we don't have a C++ method.

	From Jan Kratochvil  <jan.kratochvil@redhat.com>:
    	* dwarf2read.c (new_symbol <DW_TAG_enumerator>): Call dwarf2_full_name.

	* ada-lang.c (ada_lookup_symbol): Remove linkage_name parameters
	and arguments from symbol lookups.
	* ax-gdb.c (gen_expr): Likewise.
	* cp-namespace.c (cp_lookup_symbol_nonlocal, lookup_namespace_scope,
	cp_lookup_symbol_namespace, lookup_symbol_file, lookup_nested_type,
	lookup_possible_namespace_symbol): Likewise.
	* cp-support.c (read_in_psymtabs): Likewise.
	* cp-support.h (cp_lookup_symbol_nonlocal): Likewise.
	* language.h (la_lookup_symbol_nonlocal): Likewise.
	* scm-valprint.c (scm_inferior_print): Likewise.
	* solib-darwin.c (darwin_relocate_section_addresses): Likewise.
	* solib-svr.c (elf_lookup_lib): Likewise.
	* solib.c (show_auto_solib_add): Likewise.
	* solist.h (lookup_lib_global, solib_global_lookup): Likewise.
	* symmisc.c (maintenance_check_symtabs): Likewise.
	* symtab.c (lookup_symbol_in_language, lookup_symbol_aux,
	lookup_symbol_aux_local, lookup_symbol_aux_block,
	lookup_symbol_from_objfile, lookup_symbol_aux_symtabs,
	lookup_symbol_aux_psymtabs,basic_lookup_symbol_nonlocal,
	lookup_symbol_static, lookup_symbol_global, symbol_matches_domain,
	basic_lookup_transparent_type, find_main_psymtab,
	lookup_block_symbol): Likewise.
	* symtab.h (basic_lookp_symbol_nonlocal, lookup_symbol_static,
	lookup_symbol_global, lookup_symbol_aux_block,
	lookup_symbol_partial_symbol, lookup_block_symbol,
	lookup_global_symbol, value_maybe_namespace_elt): Likewise.
2010-03-09 18:09:08 +00:00
Joel Brobecker 08597104eb Memory error when reading wrong core file.
* solib-svr4.c (solib_svr4_r_map): catch and print all exception
        errors while reading the inferior memory, and return zero if
        an exception was raised.
2010-03-08 07:45:49 +00:00
Pedro Alves ab92d69b1e * breakpoint.c (breakpoint_init_inferior): Also delete
bp_shlib_event breakpoints.
	* solib-frv.c (enable_break): Remove call to
	remove_solib_event_breakpoints.
	* solib-svr4.c (enable_break): Ditto.
	* solib-darwin.c (darwin_solib_create_inferior_hook): Ditto.
	* solib-pa64.c (pa64_solib_create_inferior_hook): Ditto.
	* solib-som.c (som_solib_create_inferior_hook): Ditto.
	* solib-spu.c (spu_enable_break): Ditto.
2010-02-24 00:29:02 +00:00
H.J. Lu d182d0578f Use CORE_ADDR instead of ULONGEST on address.
2010-02-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR shlibs/11293
	* solib-svr4.c (enable_break): Check size of CORE_ADDR instead
	of ULONGEST for address size.
2010-02-17 20:47:08 +00:00
Jan Kratochvil ad3a0e5b17 gdb/
* solib-svr4.c (enable_break <target_auxv_search>): New variable
	addr_bit.  Adjust LOAD_ADDR sign for cross-arch inferiors.
2010-02-17 11:37:23 +00:00
Jan Kratochvil 4e1fc9c971 gdb/
* solib-svr4.c (LM_ADDR_CHECK): New variable minpagesize.  Optionally
	initialize it from ELF BFD.  Extend the prelink condition by it.
2010-02-15 17:37:35 +00:00
Jan Kratochvil 28f34a8f20 gdb/
* solib-svr4.c: (LM_ADDR_CHECK): Move variable align to a more inner
	block.
2010-02-13 13:36:55 +00:00
Jan Kratochvil 701ed6dcfb gdb/
* solib-svr4.c: (LM_ADDR_CHECK): Print successful prelink adjustment
	only if INFO_VERBOSE.

gdb/testsuite/
	* gdb.base/prelink.exp (set verbose on): New.
2010-02-13 12:02:29 +00:00
Jan Kratochvil 5c0d192f85 gdb/
* solib-svr4.c (LM_ADDR_CHECK): New comment on PPC-aware condition.
2010-02-11 23:07:23 +00:00
Doug Evans 48379de60b * solib-svr4.c (enable_break): Add comment. 2010-02-04 22:54:41 +00:00
Jan Kratochvil b381ea14bd gdb/
* solib-svr4.c (scan_dyntag): New variable dyn_addr.  Replace gdb_assert
	by a conditional setting DYN_ADDR.  Use DYN_ADDR.
	* config/djgpp/fnchange.lst: Add translations for
	symbol-without-target_section.exp and symbol-without-target_section.c.

gdb/testsuite/
	* gdb.base/symbol-without-target_section.exp,
	gdb.base/symbol-without-target_section.c: New.
2010-02-01 19:27:55 +00:00
Doug Evans 4c7dcb841c * solib-svr4.c (solib_break_names): Add __dl_rtld_db_dlactivity. 2010-01-27 00:32:09 +00:00
Jan Kratochvil 4175219298 gdb/
* solib-svr4.c (svr4_exec_displacement): New comment for entry_point.
	Replace exec_entry_point call by bfd_get_start_address.
2010-01-14 21:16:52 +00:00
Jan Kratochvil 9f2982ff0b gdb/
Support Valgrind attachments broken by the PIE support.
	* auxv.c: Include gdbcore.h.
	(procfs_xfer_auxv): Make static.  Reduce its comment.  Drop its
	parameters ops, object and annex.  Remove their assertions.
	(ld_so_xfer_auxv, memory_xfer_auxv): New function.
	* auxv.h (procfs_xfer_auxv): Remove comment.  Rename to ...
	(memory_xfer_auxv): ... here.
	* linux-nat.c (linux_xfer_partial): Rename procfs_xfer_auxv to
	memory_xfer_auxv.
	* procfs.c (procfs_xfer_partial): Likewise.
	* solib-svr4.c (svr4_relocate_main_executable): New prototype.
	(svr4_special_symbol_handling): Call svr4_relocate_main_executable.
	(svr4_solib_create_inferior_hook): Conditionalize the
	svr4_relocate_main_executable call.

gdb/testsuite/
	* gdb.base/valgrind-db-attach.exp, gdb.base/valgrind-db-attach.c: New.
2010-01-14 21:15:00 +00:00
Jan Kratochvil 61f0d76280 gdb/
* solib-svr4.c (scan_dyntag): Remove variable dyn_addr.  New variable
	target_section.  Find SECT in current_target_sections, gdb_assert it.
	(elf_lookup_lib_symbol): Pass the binary file if given symfile_objfile.
	New variable abfd.
	* symtab.c (lookup_objfile_from_block): Return the binary file instead
	of separate debug info file.

gdb/testsuite/
	* gdb.base/break-interp.exp (test_core): New proc.
	(test_ld): Call it.
2010-01-14 21:09:05 +00:00
Jan Kratochvil 51bee8e9b7 gdb/
Support PIEs with no symfile_objfile.
	* exec.c (print_section_info <abfd == exec_bfd>): Relocate Entry point.
	* solib-svr4.c (svr4_relocate_main_executable <exec_bfd>): New block.

gdb/testsuite/
	Support PIEs with no symfile_objfile.
	* gdb.base/break-interp.exp: New argument at the test_ld calls.
	(test_ld): New parameter trynosym.
	(test_ld <$trynosym>): New block.
2010-01-14 21:01:25 +00:00