Commit Graph

60975 Commits

Author SHA1 Message Date
Pedro Alves 95954743cb 2009-04-01 Pedro Alves <pedro@codesourcery.com>
Implement the multiprocess extensions, and add linux multiprocess
	support.

	* server.h (ULONGEST): Declare.
	(struct ptid, ptid_t): New.
	(minus_one_ptid, null_ptid): Declare.
	(ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
	(ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
	(struct inferior_list_entry): Change `id' type from unsigned from
	to ptid_t.
	(struct sym_cache, struct breakpoint, struct
	process_info_private): Forward declare.
	(struct process_info): Declare.
	(current_process): Declare.
	(all_processes): Declare.
	(initialize_inferiors): Declare.
	(add_thread): Adjust to use ptid_t.
	(thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
	(add_process, remove_process, find_thread_pid): Declare.
	(find_inferior_id): Adjust to use ptid_t.
	(cont_thread, general_thread, step_thread): Change type to ptid_t.
	(multi_process): Declare.
	(push_event): Adjust to use ptid_t.
	(read_ptid, write_ptid): Declare.
	(prepare_resume_reply): Adjust to use ptid_t.
	(clear_symbol_cache): Declare.
	* inferiors.c (all_processes): New.
	(null_ptid, minus_one_ptid): New.
	(ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
	(ptid_get_tid, ptid_equal, ptid_is_pid): New.
	(add_thread): Change unsigned long to ptid.  Remove gdb_id
	parameter.  Adjust.
	(thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
	(gdb_id_to_thread): Rename to ...
	(find_thread_pid): ... this.  Change unsigned long to ptid.
	(gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
	(loaded_dll, pull_pid_from_list): Adjust.
	(add_process, remove_process, find_process_pid)
	(get_thread_process, current_process, initialize_inferiors): New.
	* target.h (struct thread_resume) <thread>: Change type to ptid_t.
	(struct target_waitstatus) <related_pid>: Ditto.
	(struct target_ops) <kill, detach>: Add `pid' argument.  Change
	return type to int.
	(struct target_ops) <join>: Add `pid' argument.
	(struct target_ops) <thread_alive>: Change pid's type to ptid_t.
	(struct target_ops) <wait>: Add `ptid' field.  Change return type
	to ptid.
	(kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
	(mywait): Add `ptid' argument.  Change return type to ptid_t.
	(target_pid_to_str): Declare.
	* target.c (set_desired_inferior): Adjust to use ptids.
	(mywait): Add new `ptid' argument.  Adjust.
	(target_pid_to_str): New.
	* mem-break.h (free_all_breakpoints): Declare.
	* mem-break.c (breakpoints): Delelete.
	(set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
	(check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
	to use per-process breakpoint list.
	(free_all_breakpoints): New.
	* remote-utils.c (struct sym_cache) <name>: Drop `const'.
	(symbol_cache, all_symbols_looked_up): Delete.
	(hexchars): New.
	(ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
	read_ptid): New.
	(prepare_resume_reply): Change ptid argument's type from unsigned
	long to ptid_t.  Adjust.  Implement W;process and X;process.
	(free_sym_cache, clear_symbol_cache): New.
	(look_up_one_symbol): Adjust to per-process symbol cache.  *
	* server.c (cont_thread, general_thread, step_thread): Change type
	to ptid_t.
	(attached): Delete.
	(multi_process): New.
	(last_ptid): Change type to ptid_t.
	(struct vstop_notif) <ptid>: Change type to ptid_t.
	(queue_stop_reply, push_event): Change `ptid' argument's type to
	ptid_t.
	(discard_queued_stop_replies): Add `pid' argument.
	(start_inferior): Adjust to use ptids.  Adjust to mywait interface
	changes.  Don't reference the `attached' global.
	(attach_inferior): Adjust to mywait interface changes.
	(handle_query): Adjust to use ptids.  Parse GDB's qSupported
	features.  Handle and report "multiprocess+".  Handle
	"qAttached:PID".
	(handle_v_cont): Adjust to use ptids.  Adjust to mywait interface
	changes.
	(handle_v_kill): New.
	(handle_v_stopped): Adjust to use target_pid_to_str.
	(handle_v_requests): Allow multiple attaches and runs when
	multiprocess extensions are in effect.  Handle "vKill".
	(myresume): Adjust to use ptids.
	(queue_stop_reply_callback): Add `arg' parameter.  Handle it.
	(handle_status): Adjust to discard_queued_stop_replies interface
	change.
	(first_thread_of, kill_inferior_callback)
	(detach_or_kill_inferior_callback, join_inferiors_callback): New.
	(main): Call initialize_inferiors.  Adjust to use ptids, killing
	and detaching from all inferiors.  Handle multiprocess packet
	variants.
	* linux-low.h: Include gdb_proc_service.h.
	(struct process_info_private): New.
	(struct linux_target_ops) <pid_of>: Use ptid_get_pid.
	<lwpid_of>: Use ptid_get_lwp.
	(get_lwp_thread): Adjust.
	(struct lwp_info): Add `dead' member.
	(find_lwp_pid): Declare.
	* linux-low.c (thread_db_active): Delete.
	(new_inferior): Adjust comment.
	(inferior_pid): Delete.
	(linux_add_process): New.
	(handle_extended_wait): Adjust.
	(add_lwp): Change unsigned long to ptid.
	(linux_create_inferior): Add process to processes table.  Adjust
	to use ptids.  Don't set new_inferior here.
	(linux_attach_lwp): Rename to ...
	(linux_attach_lwp_1): ... this.  Add `initial' argument.  Handle
	it.  Adjust to use ptids.
	(linux_attach_lwp): New.
	(linux_attach): Add process to processes table.  Don't set
	new_inferior here.
	(struct counter): New.
	(second_thread_of_pid_p, last_thread_of_process_p): New.
	(linux_kill_one_lwp): Add `args' parameter.  Handle it.  Adjust to
	multiple processes.
	(linux_kill): Add `pid' argument.  Handle it.  Adjust to multiple
	processes.  Remove process from process table.
	(linux_detach_one_lwp): Add `args' parameter.  Handle it.  Adjust
	to multiple processes.
	(any_thread_of): New.
	(linux_detach): Add `pid' argument, and handle it.  Remove process
	from processes table.
	(linux_join): Add `pid' argument.  Handle it.
	(linux_thread_alive): Change unsighed long argument to ptid_t.
	Consider dead lwps as not being alive.
	(status_pending_p): Rename `dummy' argument to `arg'.  Filter out
	threads we're not interested in.
	(same_lwp, find_lwp_pid): New.
	(linux_wait_for_lwp): Change `pid' argument's type from int to
	ptid_t.  Adjust.
	(linux_wait_for_event): Rename to ...
	(linux_wait_for_event_1): ... this.  Change `pid' argument's type
	from int to ptid_t.  Adjust.
	(linux_wait_for_event): New.
	(linux_wait_1): Add `ptid' argument.  Change return type to
	ptid_t.  Adjust.  Use last_thread_of_process_p.  Remove processes
	that exit from the process table.
	(linux_wait): Add `ptid' argument.  Change return type to ptid_t.
	Adjust.
	(mark_lwp_dead): New.
	(wait_for_sigstop): Adjust to use ptids.  If a process exits while
	stopping all threads, mark its main lwp as dead.
	(linux_set_resume_request, linux_resume_one_thread): Adjust to use
	ptids.
	(fetch_register, usr_store_inferior_registers)
	(regsets_fetch_inferior_registers)
	(regsets_store_inferior_registers, linux_read_memory)
	(linux_write_memory): Inline `inferior_pid'.
	(linux_look_up_symbols): Adjust to use per-process
	`thread_db_active'.
	(linux_request_interrupt): Adjust to use ptids.
	(linux_read_auxv): Inline `inferior_pid'.
	(initialize_low): Don't reference thread_db_active.
	* gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
	* proc-service.c (ps_lgetregs): Use find_lwp_pid.
	(ps_getpid): Return the pid of the current inferior.
	* thread-db.c (proc_handle, thread_agent): Delete.
	(thread_db_create_event, thread_db_enable_reporting): Adjust to
	per-process data.
	(find_one_thread): Change argument type to ptid_t.  Adjust to
	per-process data.
	(maybe_attach_thread): Adjust to per-process data and ptids.
	(thread_db_find_new_threads): Ditto.
	(thread_db_init): Ditto.
	* spu-low.c (spu_create_inferior, spu_attach): Add process to
	processes table.  Adjust to use ptids.
	(spu_kill, spu_detach): Adjust interface.  Remove process from
	processes table.
	(spu_join, spu_thread_alive): Adjust interface.
	(spu_wait): Adjust interface.  Remove process from processes
	table.  Adjust to use ptids.
	* win32-low.c (current_inferior_tid): Delete.
	(current_inferior_ptid): New.
	(debug_event_ptid): New.
	(thread_rec): Take a ptid.  Adjust.
	(child_add_thread): Add `pid' argument.  Adjust to use ptids.
	(child_delete_thread): Ditto.
	(do_initial_child_stuff): Add `attached' argument.  Add process to
	processes table.
	(child_fetch_inferior_registers, child_store_inferior_registers):
	Adjust.
	(win32_create_inferior): Pass 0 to do_initial_child_stuff.
	(win32_attach): Pass 1 to do_initial_child_stuff.
	(win32_kill): Adjust interface.  Remove process from processes
	table.
	(win32_detach): Ditto.
	(win32_join): Adjust interface.
	(win32_thread_alive): Take a ptid.
	(win32_resume): Adjust to use ptids.
	(get_child_debug_event): Ditto.
	(win32_wait): Adjust interface.  Remove exiting process from
	processes table.
2009-04-01 22:50:24 +00:00
Pedro Alves bd99dc8583 Non-stop mode support.
* server.h (non_stop): Declare.
	(gdb_client_data, handler_func): Declare.
	(delete_file_handler, add_file_handler, start_event_loop):
	Declare.
	(handle_serial_event, handle_target_event, push_event)
	(putpkt_notif): Declare.
	* target.h (enum resume_kind): New.
	(struct thread_resume): Replace `step' field by `kind' field.
	(TARGET_WNOHANG): Define.
	(struct target_ops) <wait>: Add `options' argument.
	<supports_non_stop, async, start_non_stop>: New fields.
	(target_supports_non_stop, target_async): New.
	(start_non_stop): Declare.
	(mywait): Add `options' argument.
	* target.c (mywait): Add `options' argument.  Print child exit
	notifications here.
	(start_non_stop): New.
	* server.c (non_stop, own_buf, mem_buf): New globals.
	(struct vstop_notif): New.
	(notif_queue): New global.
	(queue_stop_reply, push_event, discard_queued_stop_replies)
	(send_next_stop_reply): New.
	(start_inferior): Adjust to use resume_kind.  Adjust to mywait
	interface changes.
	(attach_inferior): In non-stop mode, don't wait for the target
	here.
	(handle_general_set): Handle QNonStop.
	(handle_query): When handling qC, return the current general
	thread, instead of the first thread of the list.
	(handle_query): If the backend supports non-stop mode, include
	QNonStop+ in the qSupported query response.
	(handle_v_cont): Adjust to use resume_kind.  Handle resume_stop
	and non-stop mode.
	(handle_v_attach, handle_v_run): Handle non-stop mode.
	(handle_v_stopped): New.
	(handle_v_requests): Report support for vCont;t.  Handle vStopped.
	(myresume): Adjust to use resume_kind.  Handle non-stop.
	(queue_stop_reply_callback): New.
	(handle_status): Handle non-stop mode.
	(main): Clear non_stop flag on reconnection.  Use the event-loop.
	Refactor serial protocol handling from here ...
	(process_serial_event): ... to this new function.  When GDB
	selects any thread, select one here.  In non-stop mode, wait until
	GDB acks all pending events before exiting.
	(handle_serial_event, handle_target_event): New.
	* remote-utils.c (remote_open): Install remote_desc in the event
	loop.
	(remote_close): Remove remote_desc from the event loop.
	(putpkt_binary): Rename to...
	(putpkt_binary_1): ... this.  Add `is_notic' argument.  Handle it.
	(putpkt_binary): New as wrapper around putpkt_binary_1.
	(putpkt_notif): New.
	(prepare_resume_reply): In non-stop mode, don't change the
	general_thread.
	* event-loop.c: New.
	* Makefile.in (OBJ): Add event-loop.o.
	(event-loop.o): New rule.

	* linux-low.h (pid_of): Moved here.
	(lwpid_of): New.
	(get_lwp_thread): Use lwpid_of.
	(struct lwp_info): Delete `lwpid' field.  Add `suspended' field.
	* linux-low.c (pid_of): Delete.
	(inferior_pid): Use lwpid_of.
	(linux_event_pipe): New.
	(target_is_async_p): New.
	(delete_lwp): New.
	(handle_extended_wait): Use lwpid_of.
	(add_lwp): Don't set lwpid field.
	(linux_attach_lwp): Adjust debug output.  Use lwpid_of.
	(linux_kill_one_lwp): If killing a running lwp, stop it first.
	Use lwpid_of.  Adjust to linux_wait_for_event interface changes.
	(linux_detach_one_lwp): If detaching from a running lwp, stop it
	first.  Adjust to linux_wait_for_event interface changes.  Use
	lwpid_of.
	(linux_detach): Don't delete the main lwp here.
	(linux_join): Use my_waitpid.  Avoid signal_pid.  Use lwpid_of.
	(status_pending_p): Don't consider explicitly suspended lwps.
	(linux_wait_for_lwp): Take an integer pid instead of a lwp_info
	pointer.  Add OPTIONS argument.  Change return type to int.  Use
	my_waitpid instead of sleeping.  Handle WNOHANG.  Use lwpid_of.
	(linux_wait_for_event): Take an integer pid instead of a lwp_info
	pointer.  Add status pointer argument.  Return a pid instead of a
	status.  Use lwpid_of.  Adjust to linux_wait_for_lwp interface
	changes.  In non-stop mode, don't switch to a random thread.
	(linux_wait): Rename to...
	(linux_wait_1): ... this.  Add target_options argument, and handle
	it.  Adjust to use resume_kind.  Use lwpid_of.  In non-stop mode,
	don't handle the continue thread.  Handle TARGET_WNOHANG.  Merge
	clean exit and signal exit code.  Don't stop all threads in
	non-stop mode.  In all-stop mode, only stop all threads when
	reporting a stop to GDB.  Handle explicit thread stop requests.
	(async_file_flush, async_file_mark): New.
	(linux_wait): New.
	(send_sigstop): Use lwpid_of.
	(wait_for_sigstop): Use lwpid_of.  Adjust to linux_wait_for_event
	interface changes.  In non-stop mode, don't switch to a random
	thread.
	(linux_resume_one_lwp): Use lwpid_of.
	(linux_continue_one_thread, linux_queue_one_thread): Merge into ...
	(linux_resume_one_thread): ... this.  Handle resume_stop.  In
	non-stop mode, don't look for pending flag in all threads.
	(resume_status_pending_p): Don't consider explicitly suspended
	threads.
	(my_waitpid): Reimplement.  Emulate __WALL.
	(linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
	Use lwpid_of.
	(sigchld_handler, linux_supports_non_stop, linux_async)
	(linux_start_non_stop): New.
	(linux_target_ops): Register linux_supports_non_stop, linux_async
	and linux_start_non_stop.
	(initialize_low): Install SIGCHLD handler.
	* thread-db.c (thread_db_create_event, find_one_thread)
	(thread_db_get_tls_address): Use lwpid_of.
	* win32-low.c (win32_detach): Adjust to use resume_kind.
	(win32_wait): Add `options' argument.
	* spu-low.c (spu_resume): Adjust to use resume_kind.
	(spu_wait): Add `options' argument.
2009-04-01 22:48:05 +00:00
Pedro Alves 5b1c542ea1 Decouple target code from remote protocol.
* target.h (enum target_waitkind): New.
	(struct target_waitstatus): New.
	(struct target_ops) <wait>: Return an unsigned long.  Take a
	target_waitstatus pointer instead of a char pointer.
	(mywait): Likewise.
	* target.c (mywait): Change prototype to return an unsigned long.
	Take a target_waitstatus pointer instead of a char pointer.  Adjust.
	* server.h (thread_from_wait, old_thread_from_wait): Delete
	declarations.
	(prepare_resume_reply): Change prototype to take a
	target_waitstatus.
	* server.c (thread_from_wait, old_thread_from_wait): Delete.
	(last_status, last_ptid): New.
	(start_inferior): Remove "statusptr" argument.  Adjust.  Return a
	pid instead of a signal.
	(attach_inferior): Remove "status" and "signal" parameters.
	Adjust.
	(handle_query): For qGetTLSAddr, parse the thread id with strtol,
	not as an address.
	(handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
	(handle_v_requests, myresume): Remove "status" and "signal"
	parameters.  Adjust.
	(handle_status): New.
	(main): Delete local `status'.  Adjust.
	* remote-utils.c: Include target.h.
	(prepare_resume_reply): Change prototype to take a
	target_waitstatus.  Adjust.

	* linux-low.c (linux_wait): Adjust to new target_ops->wait
	interface.
	* spu-low.c (spu_wait): Adjust.
	* win32-low.c (enum target_waitkind, struct target_waitstatus):
	Delete.
	(win32_wait): Adjust.
2009-04-01 22:31:45 +00:00
Pedro Alves 2bd7c093f6 * target.h (struct thread_resume): Delete leave_stopped member.
(struct target_ops): Add a `n' argument to the `resume' callback.
	* server.c (start_inferior): Adjust.
	(handle_v_cont, myresume): Adjust.
	* linux-low.c (check_removed_breakpoint): Adjust to resume
	interface change, and to removed leave_stopped field.
	(resume_ptr): Delete.
	(struct thread_resume_array): New.
	(linux_set_resume_request): Add new `arg' parameter.  Adjust to
	resume interface change.
	(linux_continue_one_thread, linux_queue_one_thread)
	(resume_status_pending_p): Check if the resume field is NULL
	instead of checking the leave_stopped member.
	(linux_resume): Adjust to the target resume interface change.
	* spu-low.c (spu_resume): Adjust to the target resume interface
	change.
	* win32-low.c (win32_detach, win32_resume): Ditto.
2009-04-01 22:29:33 +00:00
Pedro Alves c35fafde7c gdb/gdbserver/
* linux-low.c (linux_wait_for_event): Don't clear the `stepping'
	flag.
	(wait_for_sigstop): Don't leave a finished single-step SIGTRAP
	pending.
	(linux_continue_one_thread): Only preserve the stepping flag if
	there's a pending breakpoint.

gdb/testsuite/

	* gdb.threads/pending-step.c, gdb.threads/pending-step.exp: New.
2009-04-01 22:25:44 +00:00
Joel Brobecker f8a8dce68f * gdb.base/funcargs.exp: Set print frame-arguments to "all".
* gdb.base/call-ar-st.exp: Set print frame-arguments to "all".
        * gdb.ada/ref_param.exp: Set print frame-arguments to "all".
        * gdb.ada/lang_switch.exp: Set print frame-arguments to "all".
2009-04-01 22:08:03 +00:00
Joel Brobecker 476f7b68eb * stack.c (print_frame_arguments): Set initial value to "scalars". 2009-04-01 22:05:30 +00:00
Sterling Augustine 1ec520b7b1 2009-04-01 Sterling Augustine <sterling@jaw.hq.tensilica.com>
* config/tc-xtensa.c (parse_arguments): call demand_empty_rest_of_line
2009-04-01 21:07:14 +00:00
Richard Sandiford ee69830047 bfd/
* xcofflink.c (xcoff_archive_info): Add contains_shared_object_p
	and know_contains_shared_object_p.
	(xcoff_archive_contains_shared_object_p): Add an "info" parameter.
	Cache the result in the archive_info table.
	(xcoff_auto_export_p): Add an "info" parameter and update the
	call to xcoff_archive_contains_shared_object_p.
	(xcoff_mark_auto_exports): Update accordingly.
	(xcoff_post_gc_symbol): Likewise.
2009-04-01 20:13:10 +00:00
Richard Sandiford 54e2dbe0fc bfd/
* xcofflink.c (bfd_link_input_bfd): Treat __rtinit as C_HIDEXT
	rather than C_EXT.

ld/testsuite/
	* ld-powerpc/aix-gc-1.nd: New test.
	* ld-powerpc/aix52.exp: Run it.
2009-04-01 20:09:03 +00:00
Richard Sandiford 2e470849cc bfd/
* coff-rs6000.c (member_layout): New structure.
	(archive_iterator): Likewise.
	(member_layout_init): New function.
	(archive_iterator_begin): Likewise.
	(archive_iterator_next): Likewise.
	(xcoff_write_armap_old): Use the new iterator functions.
	(do_shared_object_padding): Delete.
	(xcoff_write_armap_big): Use the new iterator functions.  Simplify
	handling of arch_info.
	(xcoff_write_archive_contents_old): Allocate arelt_data in the
	first loop rather than the second.  Allocate a member header if
	there isn't one, then work out the stat information and length
	in the first loop too.  Use the new iterators for the second loop.
	(xcoff_write_archive_contents_big): Likewise.
2009-04-01 20:04:28 +00:00
Richard Sandiford 24c611d1c4 bfd/
* bfd-in.h (bfd_xcoff_split_import_path): Declare.
	(bfd_xcoff_set_archive_import_path): Likewise.
	* bfd-in2.h: Regenerate.
	* xcofflink.c: Include libiberty.h.
	(xcoff_archive_info): New structure.
	(xcoff_archive_info_hash): New function.
	(xcoff_archive_info_eq): Likewise.
	(xcoff_get_archive_info): Likewise.
	(_bfd_xcoff_bfd_link_hash_table_create): Initialize archive_info.
	(bfd_xcoff_split_import_path): New function.
	(bfd_xcoff_set_archive_import_path): Likewise.
	(xcoff_set_import_path): Move earlier in file.
	(xcoff_link_add_dynamic_symbols): Set the import path of a non-archive
	object to the the directory part of the bfd's filename.  Get the
	import path and filename of an archive object from the archive's
	xcoff_tdata, initializing it if necessary.  Update use of
	import_file_id.
	(bfd_link_input_bfd): Update use of import_file_id.
	(xcoff_write_global_symbol): Likewise.

ld/
	* emultempl/aix.em (gld${EMULATION_NAME}_open_dynamic_archive): New
	function.
	(ld_${EMULATION_NAME}_emulation): Use it.
2009-04-01 19:53:53 +00:00
Richard Sandiford d286971a6b include/coff/
* xcoff.h (xcoff_link_hash_table): Move to bfd/xcofflink.c.

bfd/
	* xcofflink.c (xcoff_link_hash_table): Moved from include/coff/xcoff.h.
2009-04-01 19:38:11 +00:00
Richard Sandiford b3d1832c34 bfd/
* xcofflink.c (xcoff_link_create_extra_sections): Don't create
	a .loader section for relocatable links.
	(xcoff_need_ldrel_p): New function.
	(xcoff_mark): Use it.
	(bfd_xcoff_link_count_reloc): Only count loader relocs if there's
	a loader section.
	(xcoff_build_ldsym): New function, split out from...
	(xcoff_build_ldsyms): ...here.  Rename to...
	(xcoff_post_gc_symbol): ...this.  Only export symbols, and only
	call xcoff_build_ldsym, if there's a loader section.
	(xcoff_build_loader_section): New function, extracted verbatim from...
	(bfd_xcoff_size_dynamic_sections): ...here.  Only call it if
	there's a loader section.  Only add an __rtinit loader symbol
	if there's a loader section.  Update after above name change.
	(xcoff_symbol_section, xcoff_create_ldrel): New functions.
	(bfd_link_input_bfd): Use xcoff_need_ldrel_p, xcoff_symbol_section
	and xcoff_create_ldrel.
	(xcoff_write_global_symbol): Use xcoff_create_ldrel.
	(xcoff_reloc_link_order): Likewise, but only call it if there's
	a loader section.  Use xcoff_symbol_section.
	(_bfd_xcoff_bfd_final_link): Only use fdinfo.ldrel and fdinfo.ldsym
	if there's a loader section.

ld/testsuite/
	* ld-powerpc/aix-rel-1.s, ld-powerpc/aix-rel-1.od: New test.
	* ld-powerpc/aix52.exp: Run it.
2009-04-01 19:27:38 +00:00
Aleksandar Ristovski 865093a3bf * mips-tdep.c (mips_numeric_register_alieses): New definition.
(mips_gdbarch_init): Add user registers from
mips_numeric_register_aliases.
2009-04-01 19:13:42 +00:00
Joel Brobecker 5d3b6af6f9 * linux-nat.c (linux_nat_filter_event): Minor comment reformatting. 2009-04-01 19:07:50 +00:00
Richard Sandiford 8707bb8715 bfd/
* xcofflink.c (bfd_link_input_bfd): Fix buffer overrun.
2009-04-01 19:05:53 +00:00
Joel Brobecker 9db037429b * linux-nat.c (linux_nat_filter_events): Do not delete the lwp if
this is the last one.
2009-04-01 18:56:30 +00:00
Pedro Alves 0d8f58ca94 * remote.c (append_resumption): New.
(remote_vcont_resume): Use it.
2009-04-01 17:42:03 +00:00
H.J. Lu 96b2958fe9 2009-04-01 H.J. Lu <hongjiu.lu@intel.com>
* common.h (EM_INTEL178): Removed.
	(EM_INTEL179): Likewise.
	(EM_ETPU): New.
	(EM_SLE9X): Likewise.
	(EM_INTEL181): Likewise.
	(EM_INTEL182): Likewise.
2009-04-01 17:30:35 +00:00
Dave Korn 2fe50fe3ef binutils/ChangeLog
* dlltool.c (set_dll_name_from_def):  Accept new second arg that
	indicates if we are building DLL or EXE, and use it to add a
	default suffix to the output filename when none is already present.
	(def_name):  Indicate we are building an EXE when calling it.
	(def_library):  Indicate we are building a DLL when calling it.

ld/testsuite/ChangeLog

	* ld-cygwin/exe-export.exp:  Add "-lkernel32" when linking test exe.
	* ld-cygwin/testexe.c (testexe_main):  Indicate whether global_a
	was set to correct final value using error return status.
	(testexe_dummy):  Dummy function calls an import from kernel32.dll
	to ensure it is mapped into the process space at runtime.
2009-04-01 17:20:19 +00:00
Ramana Radhakrishnan 4343666d14 2009-04-01 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* config/tc-arm.c (arm_validate_fix): Define only for OBJ_COFF.
	(find_real_start): Likewise.
	* config/tc-arm.h (TC_VALIDATE_FIX): Likewise
2009-04-01 16:49:32 +00:00
Joel Brobecker 1e2f1c5caa * windows-nat.c (+windows_get_ada_task_ptid): New function.
(init_windows_ops): Set windows_ops.to_get_ada_task_ptid.
2009-04-01 16:35:41 +00:00
Christophe Lyon b8f9ee44f9 2009-04-01 Christophe Lyon <christophe.lyon@st.com>
opcodes/
	* arm-dis.c (print_insn): Print BE8 opcodes in little endianness.

	ld/testsuite/
	* ld-arm/arm-elf.exp: BE8 tests expect the same output as the
	default ones.
	* ld-arm/arm-be8.d: Print opcodes in little endian.
	* ld-arm/farcall-thumb-arm-be8.d: Removed useless expected result.
	* ld-arm/farcall-arm-arm-be8.d: Likewise.
2009-04-01 15:45:13 +00:00
Christophe Lyon e780aef286 2009-04-01 Christophe Lyon <christophe.lyon@st.com>
bfd/
	* elf32-arm.c (group_sections): Rewrite loops for better
	readability.
2009-04-01 15:34:12 +00:00
Nick Clifton ffbe5983cb PR 9972
* doc/binutils.texi (strings): Document the -V alias for the
        --version option.
        * strings.c (usage): Likewise.
2009-04-01 14:57:11 +00:00
Nathan Sidwell e7495e4595 * config/tc-arm.c (do_nop): Generate v6k nops whenever possible.
(arm_handle_align): Generate v6k ARM, thumb2 wide & narrow nops
	whenever possible.

	testsuite/
	* gas/arm/align.s, gas/arm/align.d: New.
	* gas/arm/thumb32.d, gas/arm/arch6zk.d, gas/arm/arch6zk.s,
	arm/thumb2_relax.d: Adjust for align changes.
2009-04-01 14:02:57 +00:00
Peter Bergner 42240548bf gas/
* config/tc-ppc.c (ppc_handle_align): Handle power7's group ending nop.

gas/testsuite/
	* gas/ppc/power7.d ("ori", ".p2align"): Add tests for group ending nop.
	* gas/ppc/power7.s: Likewise.
	* gas/ppc/power6.d: Likewise.
	* gas/ppc/power6.s: Likewise.
2009-04-01 01:41:07 +00:00
DJ Delorie 1aa34cc52c merge from gcc 2009-04-01 01:23:18 +00:00
Alan Modra a54217b469 daily update 2009-04-01 00:00:04 +00:00
gdbadmin 3f36520177 *** empty log message *** 2009-04-01 00:00:03 +00:00
Pedro Alves 0a59d50b2d * server.c (main): After the inferior having exited, call
remote_close before exiting gdbserver.
2009-03-31 22:46:36 +00:00
Paul Pluzhnikov 1b88d5c487 [obvious] Kill left-over merge marker 2009-03-31 22:39:27 +00:00
H.J. Lu f47a1d2eb8 2009-03-31 H.J. Lu <hongjiu.lu@intel.com>
* common.h (EM_INTEL178): New.
	(EM_INTEL179): Likewise.
	(EM_INTEL180): Likewise.
2009-03-31 21:19:03 +00:00
Tom Tromey 71c25deab3 gdb
2009-03-31  Daniel Jacobowitz  <dan@codesourcery.com>
	    Keith Seitz  <keiths@redhat.com>
	    Jan Kratochvil  <jan.kratochvil@redhat.com>

	PR gdb/6817
	* Makefile.in (dbxread.o): Update.
	* dbxread.c (read_dbx_symtab): Use cp_canonicalize_string.
	* dwarf2read.c (GDB_FORM_cached_string): New.
	(read_partial_die): Use dwarf2_canonicalize_name.
	(dwarf2_linkage_name): Use dwarf2_name.
	(dwarf2_canonicalize_name): New.
	(dwarf2_name): Use dwarf2_canonicalize_name.
	(dwarf_form_name, dump_die): Handle GDB_FORM_cached_string.
	* stabsread.c (define_symbol, read_type): Use cp_canonicalize_string.
	* symtab.c (lookup_symbol_in_language): Canonicalize input before
	searching.
	* cp-name-parser.y: operator() requires two parameters,
	according to libiberty.
	* minsyms.c (lookup_minimal_symbol): Canonicalize input
	before searching.
	* NEWS: Update.

gdb/testsuite

2009-03-31  Daniel Jacobowitz  <dan@codesourcery.com>
	    Jan Kratochvil  <jan.kratochvil@redhat.com>

	PR gdb/931
	* gdb.cp/gdb1355.exp (f_li, f_lui, f_si, f_sui): Allow canonical
	output.
	* gdb.cp/templates.exp: Allow canonical output.  Remove KFAILs
	for gdb/931.
	* dw2-strp.S (DW_AT_language): Change to C++.
	(DW_TAG_variable (name ""), Abbrev code 7, .Lemptyname): New.
2009-03-31 20:21:08 +00:00
Joel Brobecker 45ac276db3 * gdb.texinfo (Ada Tasks): Add documentation about task-specific
breakpoints.
        (Set Breaks): Add reference to thread-specific and task-specific
        breakpoints.
2009-03-31 16:51:02 +00:00
Joel Brobecker 02d9a9cebf * gdb.ada/tasks: New testcase. 2009-03-31 16:48:49 +00:00
Joel Brobecker 4a306c9a89 Provide support for (Ada) task-specific breakpoints.
* ada-lang.h (ada_get_task_number): Add declaration.
        (breakpoint_ada_task_match): Delete declaration.
        * ada-tasks.c (ada_get_task_number): Make non-static.
        * breakpoint.h (struct breakpoint): Add field "task".
        * breakpoint.c (print_one_breakpoint_location): Add handling of
        task-specific breakpoints.
        (create_breakpoint, create_breakpoints, find_condition_and_thread):
        New parameter "task".
        (break_command_really): Update calls to find_condition_and_thread
        and create_breakpoints.
        (breakpoint_re_set_one): Update call to find_condition_and_thread.
        Set b->task.
2009-03-31 16:44:18 +00:00
Joel Brobecker 32cd1edcd2 * gdb.texinfo (Ada Tasks): Remove the documentation about
the "Running" state, as this state has been eliminated.
        Now all runnable tasks are shown as "Runnable".
2009-03-31 16:33:37 +00:00
Joel Brobecker 4a5a99175a * ada-tasks.c (short_task_info): Eliminate the "Running" task state. 2009-03-31 16:31:24 +00:00
Pedro Alves bad34192e5 * remote.c (remote_notice_new_inferior): Use ptid_is_pid. Check
if the thread's ptid without a thread id field is in the list
	before calling thread_change_ptid.
	(extended_remote_attach_1): In non-stop mode, do not rely on
	querying the current thread, instead, query the thread list, and
	select the first thread of the process.
	* gdbthread.h (first_thread_of_process): Declare.
	* thread.c (first_thread_of_process): Define.
2009-03-31 15:23:57 +00:00
Nick Clifton e352511738 PR 9992
* configure.in: Import Solaris specific largefile test from
        bfd/configure.in.
        * configure: Regenerate.
2009-03-31 08:08:33 +00:00
Stan Shebs 1042e4c058 2009-03-30 Stan Shebs <stan@codesourcery.com>
Make tracepoints into a type of breakpoint.
	* breakpoint.h (enum bptype): Add bp_tracepoint.
	(struct breakpoint): Add fields step_count, pass_count, actions.
	(get_tracepoint, get_tracepoint_by_number): Declare.
	(all_tracepoints): Declare.
	* breakpoint.c: Include tracepoint.h, readline.h.
	(ALL_TRACEPOINTS): Move here from tracepoint.c.
	(tracepoint_count): Ditto.
	(should_be_inserted): GDB does not insert tracepoints itself.
	(print_it_typical): Add tracepoint case.
	(bpstat_what): Ditto.
	(print_one_breakpoint_location): Ditto, and add printing for
	pass count, step count, and action list.
	(user_settable_breakpoint): Add tracepoint case.
	(allocate_bp_location): Ditto.
	(set_breakpoint_location_function): Ditto.
	(disable_breakpoints_in_shlibs): Ditto.
	(mention): Ditto.
	(break_command_really): Add argument traceflag, use to choose
	basic breakpoint type.
	(break_command_1): Pass extra argument.
	(set_breakpoint, handle_gnu_v3_exceptions): Ditto.
	(breakpoint_re_set_one): Add tracepoint case.
	(disable_command, enable_command): Ditto.
	(set_tracepoint_count): Move here from tracepoint.c.
	(trace_command): Move here from tracepoint.c and use
	break_command_really.
	(tracepoints_info): Move here from tracepoint.c and call
	breakpoints_info.
	(enable_trace_command): Move here from tracepoint.c and call
	enable_command.
	(disable_trace_command): Move here from tracepoint.c and call
	disable_command.
	(delete_trace_command): Move here from tracepoint.c and call
	delete_breakpoint.
	(trace_pass_command): Move here from tracepoint.c.
	(get_tracepoint_by_number): Ditto.
	(tracepoint_save_command): Ditto.
	(get_tracepoint): New function.
	(all_tracepoints): New function.
	(_initialize_breakpoint): Move tracepoint init from tracepoint.c,
	deprecate "enable trace" and "disable trace" commands.
	* tracepoint.h (struct tracepoint): Remove.
	(tracepoint_chain): Remove decl.
	(deprecated_create_tracepoint_hook): Remove decl.
	(deprecated_delete_tracepoint_hook): Remove decl.
	(deprecated_modify_tracepoint_hook): Remove decl.
	(ALL_TRACEPOINTS, ALL_TRACEPOINTS_SAFE): Remove.
	(free_actions): Update signature.
	(validate_actionline): Update signature.
	(end_actions_pseudocommand): Declare.
	(while_stepping_pseudocommand): Declare.
	* tracepoint.c: Include breakpoint.h.
	(tracepoint_chain, tracepoint_count): Remove.
	(free_actions, make_cleanup_free_actions): Update signature.
	(trace_command, set_raw_tracepoint): Remove.
	(trace_mention): Remove.
	(tracepoints_info): Remove.
	(tracepoint_operation, map_args_over_tracepoints): Remove.
	(get_tracepoint_by_number): Remove.
	(enable_trace_command, disable_trace_command): Remove.
	(delete_trace_command, trace_pass_command): Remove.
	(trace_actions_command, read_actions): Update signature.
	(validate_actionline): Update signature, use bp loc.
	(encode_actions): Ditto.
	(download_tracepoint): New function, body of trace_start_command.
	(trace_start_command): Call it, use all_tracepoints.
	(tracepoint_save_command): Remove.
	(tracepoint_dump_command): Use get_tracepoint.
	(end_actions_pseudocommand): Make globally visible.
	(while_stepping_pseudocommand): Ditto.
	(_initialize_tracepoint): Move command definitions to breakpoint.c.

	doc/
	* gdb.texinfo (Tracepoints): Describe tracepoints as a
	special case of breakpoints.
	(Enable and Disable Tracepoints): Mention deprecation.
	(Listing Tracepoints): Update description and example.

	testsuite/
	* gdb.trace/actions.exp: Update to match new info trace format.
	* gdb.trace/deltrace.exp: Ditto.
	* gdb.trace/infotrace.exp: Ditto.
	* gdb.trace/passcount.exp: Ditto.
	* gdb.trace/save-trace.exp: Ditto.
	* gdb.trace/while-stepping.exp: Ditto.
	* gdb.trace/tracecmd.exp: Ditto, plus don't allow pending option.

	gdbtk/
	* generic/gdbtk-bp.c (gdb_actions_command): Update to handle
	tracepoints as breakpoints.
	(gdb_get_tracepoint_info): Ditto, plus use get_tracepoint and
	breakpoint locations.
	(tracepoint_exists): Ditto, plus use all_tracepoints.
2009-03-31 05:08:37 +00:00
Dave Korn adfd732835 * doc/internals.texi: Fix trivial syntax errors. 2009-03-31 04:57:48 +00:00
DJ Delorie c301e70067 * elflink.c (elf_link_input_bfd): Don't try to resolve complex
relocs when doing a relocatable link.
2009-03-31 01:42:29 +00:00
Alan Modra 4a19ce7eb9 daily update 2009-03-31 00:00:09 +00:00
gdbadmin 4da75b00e8 *** empty log message *** 2009-03-31 00:00:03 +00:00
Ian Lance Taylor 154b857c95 * ffsll.c (ffsll): Correct implementation. 2009-03-30 23:17:11 +00:00
Richard Sandiford 93abc97ad2 binutils/
* MAINTAINERS: Add self.
2009-03-30 20:39:43 +00:00
Thiago Jung Bauermann f8f6f20b6e gdb/
Expose frames to Python.
	* Makefile.in (SUBDIR_PYTHON_OBS): Add python-frame.o.
	(SUBDIR_PYTHON_SRCS): Add python-frame.c.
	(python-frame.o): New target.
	* python/python-frame.c: New file.
	* python/python-internal.h (gdbpy_frames, gdbpy_newest_frame,
	gdbpy_frame_stop_reason_string, gdbpy_selected_frame,
	gdbpy_initialize_frames): New prototypes.
	* python/python.c (_initialize_python): Call gdbpy_initialize_frames.
	(GdbMethods): Add `selected_frame' and `frame_stop_reason_string'
	entries.
	* stack.c (find_frame_funname): New function, factored out of
	print_frame.
	(print_frame): Call find_frame_funname.
	* stack.h (find_frame_funname): Add prototype.

gdb/doc/
	* gdb.texinfo (Frames in Python): New node.
	(Python API): Update.

gdb/testsuite/
	* gdb.python/python-frame.c: New file.
	* gdb.python/python-frame.exp: New file.
2009-03-30 19:54:33 +00:00