]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2006-05-13 Changes based on Apple GDB (CVS repository 5th Sept 2005)
authorNick Roberts <nickrob@snap.net.nz>
Fri, 12 May 2006 07:40:24 +0000 (07:40 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Fri, 12 May 2006 07:40:24 +0000 (07:40 +0000)
* async-nat-inferior.c, async-nat-inferior.h,
* async-nat-sigthread.c, async-nat-sigthread.h: New files

* linux-nat.c: Include async-nat-inferior.h.
(linux_nat_wait): Add extra argument.  If target_can_async_p
do something completely different.

* interps.h (interp_set, interp_set_quiet): New externs.

* interps.c (interp_set): Make asynchronous.
(interp_set_quiet): Don't make static.
(current_interp_command_loop): Call functions with new arguments.

* target.h (target_wait): Add extra argument.
(gdb_override_async, gdb_set_async_override) New externs.
(target_can_async_p): Make conditional on gdb_override_async.

* target.c (gdb_override_async): New variable.
(gdb_set_async_override, do_restore_target_async_mask):
New functions.
(debug_to_wait): Add extra argument.

* linux-thread-db.c (thread_db_wait): Add extra argument.

* wrapper.h (safe_execute_command): Declare structure.

* top.c (*deprecated_target_wait_hook): Add extra argument.
(read_command_file): Make asynchronous.

* remote.c (remote_wait, remote_async_wait): Add extra argument.

* infrun.c: Include event-top.h
(wait_for_inferior, fetch_inferior_event): Add extra argument to
target_wait.
(proceed): Set target_executing = 0.
(handle_inferior_event): Call async_disable_stdin if async.

* inf-ptrace.c: Include inf-loop.h, async-nat-inferior.h.
(inf_ptrace_him): Create a signal thread.
(inf_ptrace_wait): Add extra argument to target_wait.

* inf-loop.c (inferior_event_handler, complete_execution):
Changes for asynchronous operation (copied verbatim).

* inf-child.c: Include async-nat-inferior.h.
(inf_child_target): Use methods async_terminal_inferior
and async_terminal_ours.

* i386-linux-nat.c: Include inf-loop.h, async-nat-inferior.h.
(i386_linux_resume): Call gdb_process_events and then
async methods.

* exec.c: Include event-loop.h, async-nat-inferior.h.
(async_file_handler, standard_async, standard_is_async_p)
(standard_can_async_p): New functions.
(init_exec_ops): Initialise above methods.

* event-top.h (cli_command_loop): Make argument void*.

* event-top.c (display_gdb_prompt, async_enable_stdin)
(async_disable_stdin, handle_sigint, async_request_quit)
(gdb_setup_readline, _initialize_event_loop):
Changes for asynchronous operation (copied verbatim).
(cli_command_loop): Make argument void*.

* event-loop.h (gdb_client_data): Move typedef to defs.h.
(gdb_create_event): Declare.
(event_handler_func): Move typedef from event-loop.c.

* event-loop.c (use_poll): Set to 0.
(gdb_queue_event, gdb_create_event): New functions.
(async_queue_event): Don't make static.
(create_file_event): Use gdb_create_event.
(gdb_event): Change component from int to void*.
(process_event, handle_file_event, handle_timer_event):
Change according to gdb_event.
(event_handler_func): Move typedef to event-loop.c.

* defs.h: (gdb_mi_run_status, event_loop_p): New externs.
(gdb_client_data): Move typedef from event-loop.h.
(*deprecated_command_loop_hook): Make argument void*.
(*deprecated_target_wait_hook): Add argument.

* cli-out.h (cli_quoted_out_new): Declare.

* cli-out.c (cli_quoted_out_new): New function.
Include mi/mi-console.h.

* cli/cli-interp.c: Include inferior.h, mi/mi-console.h.
(safe_execute_command): Make static.
(cli_interpreter_resume, cli_interpreter_exec):
Make asynchronous.
(cli_quoted_interpreter_resume): New function.
(_initialize_cli_interp): Add li_command_loop to procs.
Initialize the console-quoted interpreter.

* tui/tui-hooks.c (tui_target_wait_hook): Add extra argument.

* mi/mi-main.h (mi_dont_register_continuation)
(current_command_token,  mi_interp, mi_interpreter_exec_continuation)
(mi_continuation_arg): New externs.
(mi_setup_continuation_arg): Declare.

* mi/mi-main.c: Include wrapper.h.
(struct mi_continuation_arg): New structure.
(mi_interpreter_exec_continuation): Move to mi-interp.c.
(mi_execute_async_cli_command)
(mi_exec_async_cli_cmd_continuation): Make asynchronous.
(mi_setup_continuation_arg): New function.

* mi/mi-interp.c (mi_interpreter_exec_continuation):
Move from mi-main.c
(mi_cmd_interpreter_exec): Switch interpreters.  Make
asynchronous.
(mi1_command_loop, mi2_command_loop, mi3_command_loop):
Make argument void*.

* Makefile.in (async_nat_inferior_h, async_nat_sigthread_h):
New variables.
(gdb$(EXEEXT), $(TUI)$(EXEEXT)): Link with libpthread.
(async-nat-inferior.o, async-nat-sigthread.o): New rules.
(COMMON_OBS): Add above object files.
(exec.o, i386-linux-nat.o, inf-ptrace.o, linux-nat.o):
Update dependencies.

2006-05-13  Nick Roberts  <nickrob@snap.net.nz>

* main.c: (event_loop_p): Re-instate variable.
(captured_main): Re-instate async/noasync option.
(print_gdb_help): Describe option again.

* exec.c(init_exec_ops): Only initialise async methods with async
option.

* inf-ptrace.c (inf_ptrace_him): Only reate a signal thread with
async option.

* README.async, TODO.async, PROBLEMS.async: New files.

35 files changed:
gdb/ChangeLog
gdb/PROBLEMS.async [new file with mode: 0644]
gdb/README.async [new file with mode: 0644]
gdb/TODO.async [new file with mode: 0644]
gdb/async-nat-inferior.c [new file with mode: 0644]
gdb/async-nat-inferior.h [new file with mode: 0644]
gdb/async-nat-sigthread.c [new file with mode: 0644]
gdb/async-nat-sigthread.h [new file with mode: 0644]
gdb/cli-out.c
gdb/cli-out.h
gdb/cli/cli-interp.c
gdb/defs.h
gdb/event-loop.c
gdb/event-loop.h
gdb/event-top.c
gdb/event-top.h
gdb/exec.c
gdb/i386-linux-nat.c
gdb/inf-child.c
gdb/inf-loop.c
gdb/infrun.c
gdb/interps.c
gdb/interps.h
gdb/linux-thread-db.c
gdb/main.c
gdb/mi/mi-interp.c
gdb/mi/mi-main.c
gdb/mi/mi-main.h
gdb/remote.c
gdb/target.c
gdb/target.h
gdb/top.c
gdb/tui/tui-hooks.c
gdb/version.in
gdb/wrapper.h

index 6842b6b7c3e5d145d7364b5f7d884158ebe212b0..26505c28afde0b45ebab9c7c78c43489e8aecf38 100644 (file)
-2006-05-11  Alfred M. Szmidt  <ams@gnu.org>
+2006-05-13    Changes based on Apple GDB (CVS repository 5th Sept 2005)
 
-       * gnu-nat.c (inf_validate_procs): Don't use lvalue in assignments.
-
-2006-05-11  Fred Fish  <fnf@specifix.com>
-
-       * symtab.c (skip_prologue_using_sal): Handle single line functions
-       like "foo(){}", which may optimize down to a single return inst.
-
-2006-05-10  Steve Ellcey  <sje@cup.hp.com>
-
-       * hppa-hpux-tdep.c (initialize_hp_cxx_exception_support): Remove
-       message.
-
-2006-05-09  Andreas Schwab  <schwab@suse.de>
-
-       * dwarf2-frame.c (struct dwarf2_fde): Add eh_frame_p.
-       (execute_cfa_program): Add parameter eh_frame_p.  Call
-       dwarf2_frame_eh_frame_regnum when true.
-       (dwarf2_frame_cache): Pass eh_frame_p from fde to
-       execute_cfa_program.
-       (decode_frame_entry_1): Call dwarf2_frame_eh_frame_regnum when
-       processing .eh_frame.  Copy eh_frame_p to the new fde.
-       (struct dwarf2_frame_ops): Add eh_frame_regnum.
-       (dwarf2_frame_set_eh_frame_regnum): Define.
-       (dwarf2_frame_eh_frame_regnum): Define.
-
-       * dwarf2-frame.h (dwarf2_frame_set_eh_frame_regnum): Declare.
-       (dwarf2_frame_eh_frame_regnum): Declare.
-
-2006-05-06  David S. Miller  <davem@sunset.davemloft.net>
-
-       * linux-nat.c (linux_nat_do_thread_registers): Check for
-       NULL collect_regset method.
-
-2006-05-06  Ulrich Weigand  <uweigand@de.ibm.com>
-
-       * s390-tdep.c (s390_collect_regset): New function.
-       (s390_gregset, s390x_gregset, s390_fpregset): Add it.
-
-2006-05-06  Nick Roberts  <nickrob@snap.net.nz>
-
-       * dwarf2read.c: Make LOC_OPTIMIZED_OUT the default value for a
-       symbol.
-
-2006-05-05  Ulrich Weigand  <uweigand@de.ibm.com>
-
-       * linux-nat.c (exit_lwp): Fix NULL pointer access.
-       (linux_nat_handle_extended): New parameter STOPPING.
-       (wait_lwp): Call it with STOPPING equals 1.
-       (linux_nat_wait): Call it with STOPPING equals 0.
-
-2006-05-05  Ulrich Weigand  <uweigand@de.ibm.com>
-
-       * linux-nat.c (linux_nat_wait): Do not short-cut reporting
-       of 'uninteresting' signals when single-stepping.
-
-2006-05-05  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * MAINTAINERS: Move NEWS to the documentation entry.
-
-2006-05-05  David S. Miller  <davem@sunset.davemloft.net>
-
-       * linux-nat.c (linux_nat_do_thread_registers): Use the
-       regset_from_core_section infrastructure if the target
-       supports it.
-       * Makefile.in: Update dependencies.
-       * linux-thread-db.c (thread_db_store_registers): Use
-       regcache_raw_collect.
-
-2006-05-05:  Paul Gilliam  <pgilliam@us.ibm.com>
-
-       * ppc-linux-nat.c: Clean up types for ptrace.
-       Replace (CORE_ADDR) with  (uintptr_t) to avoid the size difference
-       between a CORE_ADDR and a void* on ppc64 systems compiled for 32-bits.
-
-2006-05-05  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * remote.c (remote_disconnect): Add TARGET argument.
-       * target.c (debug_to_disconnect): Delete.
-       (update_current_target): Do not inherit to_disconnect.
-       (target_disconnect): Search for a target to implement to_disconnect.
-       (setup_target_debug): Do not reference to_disconnect.
-       * target.h (struct target_ops): Add target argument to
-       to_disconnect.
-
-2006-05-06  Fred Fish  <fnf@specifix.com>
-
-       * mips-tdep.c (mips_o64_push_dummy_call): Left shift big endian
-       structs or unions independent of ABI register size.
-
-2006-05-06  Fred Fish  <fnf@specifix.com>
-
-       * mips-tdep.c (mips_o64_return_value): Replace stub that always
-       returned RETURN_VALUE_STRUCT_CONVENTION with a real function.
-
-2006-05-05  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * mi/mi-main.c (captured_mi_execute_command): Check the return
-       value of -interpreter-exec.
-
-2006-05-03  Vladimir Prus  <ghost@cs.msu.su>
-
-       * varobj.c (c_value_of_variable): Ignore top-level references.
-       (Committed by Jim Blandy.)
-
-2006-04-30  Mark Kettenis  <kettenis@gnu.org>
-
-       * breakpoint.c (insert_single_step_breakpoint): Make a failure to
-       insert a single-step breakpoint an error instead of a warning.
-
-2006-05-01  Nathan J. Williams  <nathanw@wasabisystems.com>
-
-       * ppcnbsd-tdep.c (ppcnbsd_return_value): Change type of last two
-       arguments from void * to gdb_byte *.
-
-2006-04-26  Michael Snyder  <msnyder@redhat.com>
-
-       * linux-fork.c (_initialize_linux_fork): Rename "delete-fork"
-       command to "delete fork" (no hyphen), compatible with other
-       "delete" commands.
-       (info_forks_command): Accept a fork ID argument, for info
-       on a single fork.  Report if no matching forks.
-
-2006-04-25  Mark Kettenis  <kettenis@gnu.org>
-
-       * breakpoint.c (remove_single_step_breakpoints): Bail out early if
-       no breakpoints are inserted.
-
-       From Masaki MURANAKA <monaka@monami-software.com>:
-       * mips-mdebug-tdep.c (mips_mdebug_frame_prev_register): Change
-       type of last argument to `gdb_byte *'
-
-2006-04-25  Jim Blandy  <jimb@codesourcery.com>
-
-       Add support for 'target remote |' on MinGW.
-       * ser-mingw.c (struct pipe_state): New structure.
-       (make_pipe_state, free_pipe_state, cleanup_pipe_state)
-       (pipe_windows_open, pipe_windows_close, pipe_windows_read)
-       (pipe_windows_write, pipe_wait_handle): New functions.
-       (_initialize_ser_windows): Register a "pipe" interface based on
-       them.
-
-2006-04-24  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * ser-mingw.c: Include <conio.h>.
-       (struct ser_console_state, struct net_windows_state): Add exit_select,
-       have_stopped, thread.
-       (pipe_select_thread, console_select_thread)
-       (net_windows_select_thread): Don't create a local state copy or
-       close stop_select.  Exit on exit_select instead of stop_select.  Set
-       have_stopped.
-       (console_select_thread): Don't report control keypresses as pending
-       input.
-       (pipe_select_thread): Allow stop_select to interrupt sleeping.
-       (set_console_wait_handle): Create exit_select and have_stopped.
-       Save the thread handle.  Check _kbhit before starting a thread.
-       (ser_console_done_wait_handle): New.
-       (ser_console_close): Close new handles.  Wait for the thread to
-       exit.
-       (new_windows_select_thread): Assert that an event occurred.
-       (net_windows_wait_handle): Check for pending input before starting
-       a thread.
-       (net_windows_done_wait_handle): New.
-       (net_windows_open): Create exit_select and have_stopped.
-       Save the thread handle.
-       (net_windows_close): Close new handles.  Wait for the thread to
-       exit.
-       (_intiialize_ser_windows): Register done_wait_handle methods.
-
-       * serial.c [USE_WIN32API] (serial_done_wait_handle): New.
-       * serial.h [USE_WIN32API] (struct serial_ops): Add done_wait_handle.
-       [USE_WIN32API] (serial_done_wait_handle): New prototype.
-       * mingw-hdep.c (gdb_select): Use serial_done_wait_handle.
-
-2006-04-23  Andreas Schwab  <schwab@suse.de>
-
-       * rs6000-tdep.c: Include "reggroups.h" only once.
-       * Makefile.in (rs6000-tdep.o): Update dependencies.
-
-2006-04-21  Frederic Riss  <frederic.riss@st.com>
-
-       * dwarf2read.c (dwarf2_start_subfile): Change prototype to accept
-       compilation directory as last argument. 
-       Always pass comp_dir as second argument to start_subfile and prepend
-       dirname to the filename when necessary. 
-       Remove now superfluous search for pre-existing subfile.
-       (dwarf_decode_lines): Pass the compilation directory to
-       dwarf2_start_subfile.
-
-2006-04-20  Michael Snyder  <msnyder@redhat.com>
-
-       * 2006-03-22  Jim Blandy  <jimb@redhat.com>
-       Add support for the Renesas M32C and M16C.
-
-       * configure.tgt (m32c-*-*): New entry.
-       * config/m32c/m32c.mt: New file.
-       * m32c-tdep.c: New file.
-       * Makefile.in (elf_m32c_h): New variable.
-       (m32c-tdep.o): New rule.
-       * NEWS: Mention new target.
-       * MAINTAINERS: Designate Jim Blandy as responsible maintainer.
-
-2006-04-20  Michael Snyder  <msnyder@redhat.com>
-
-       * remote.c: Fix spelling error in comment.
-
-2006-04-20  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * m68klinux-tdep.c (m68k_linux_sigtramp_frame_prev_register):
-       Correct type of VALUEP.  Reported by Jean-Rene Peulve
-       <jr.peulve@wanadoo.fr>.
-
-2006-04-19  Masaki Muranaka  <monaka@monami-software.com>
-
-       * m32r-rom.c: On MinGW, include winsock.h instead of sys/types.h,
-       netdb.h, netinet/in.h.
-       (m32r_upload_command); Add calls WSAStartup().
-       * remote-m32r-sdi.c: On MinGW, include winsock.h instead of
-       netinet/in.h.
-
-2006-04-18  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * breakpoint.c (deprecated_read_memory_nobpt): Update to use
-       shadow_len.
-       (insert_bp_location, reattach_breakpoints, remove_breakpoint)
-       (delete_breakpoint): Update calls to changed methods.
-       (deprecated_insert_raw_breakpoint, deprecated_remove_raw_breakpoint)
-       (single_step_breakpoints, insert_single_step_breakpoint)
-       (remove_single_step_breakpoints): New.
-       * breakpoint.h (struct bp_target_info): New.
-       (struct bp_location): Replace shadow_contents with
-       target_info and overlay_target_info.
-       (deprecated_insert_raw_breakpoint, deprecated_remove_raw_breakpoint)
-       (insert_single_step_breakpoint, remove_single_step_breakpoints): New
-       prototypes.
-       * gdbarch.sh: Forward declare struct bp_target_info in gdbarch.h.
-       (memory_insert_breakpoint, memory_remove_breakpoint): Update second
-       argument.
-       * mem-break.c (default_memory_insert_breakpoint): Update.  Set
-       placed_address, placed_size, and shadow_len.
-       (default_memory_remove_breakpoint): Update.  Don't use
-       BREAKPOINT_FROM_PC.
-       (memory_insert_breakpoint, memory_remove_breakpoint): Update.
-       * target.c (update_current_target): Update prototypes for changed
-       functions.
-       (debug_to_insert_breakpoint, debug_to_remove_breakpoint)
-       (debug_to_insert_hw_breakpoint, debug_to_remove_hw_breakpoint):
-       Update.
-       * target.h: Forward declare struct bp_target_info.
-       (struct target_ops): Use a bp_target_info argument for
-       to_insert_breakpoint, to_remove_breakpoint,
-       to_insert_hw_breakpoint, and to_remove_hw_breakpoint.
-       (target_insert_breakpoint, target_remove_breakpoint)
-       (target_insert_hw_breakpoint, target_remove_hw_breakpoint)
-       (memory_insert_breakpoint, memory_remove_breakpoint)
-       (default_memory_insert_breakpoint, default_memory_remove_breakpoint):
-       Update.
-       * config/i386/nm-i386.h: Forward declare struct bp_target_info.
-       (i386_insert_hw_breakpoint, i386_remove_hw_breakpoint): Update.
-       (target_insert_hw_breakpoint, target_remove_hw_breakpoint): Likewise.
-
-       * gdbarch.c, gdbarch.h: Regenerated.
-
-       * alpha-tdep.c (alpha_software_single_step): Use
-       insert_single_step_breakpoint and remove_single_step_breakpoints.
-       Remove unused statics.
-       * arm-tdep.c (arm_software_single_step): Likewise.  Add a note.
-       * cris-tdep.c (cris_software_single_step): Likewise.
-       * mips-tdep.c (mips_software_single_step): Likewise.
-       * rs6000-tdep.c (rs6000_software_single_step): Likewise.
-       * sparc-tdep.c (sparc_software_single_step): Likewise.
-       * wince.c (struct thread_info_struct): Remove step_prev.
-       (undoSStep): Use remove_single_step_breakpoints.
-       (wince_software_single_step): Use insert_single_step_breakpoint.
-
-       * corelow.c (ignore): Remove unneeded prototype.  Update arguments.
-       * exec.c (ignore): Likewise.
-       * sol-thread.c (ignore): Likewise.
-
-       * procfs.c (dbx_link_shadow_contents): Delete.
-       (dbx_link_bpt): New.
-       (procfs_mourn_inferior): Remove it if necessary.
-       (remove_dbx_link_breakpoint): Use it.
-       (insert_dbx_link_bpt_in_file): Set it.
-       (procfs_init_inferior): Don't update dbx_link_bpt_addr.
-       * rs6000-nat.c (exec_one_dummy_insn): Use
-       deprecated_insert_raw_breakpoint and
-       deprecated_remove_raw_breakpoint.
-       * solib-irix.c (shadow_contents, breakpoint_addr): Delete.
-       (base_breakpoint): New.
-       (disable_break): Use it.
-       (enable_break): Set it.
-
-       * i386-nat.c (i386_insert_hw_breakpoint, i386_remove_hw_breakpoint):
-       Update.
-       * ia64-tdep.c (ia64_memory_insert_breakpoint)
-       (ia64_memory_remove_breakpoint): Likewise.
-       * m32r-tdep.c (m32r_memory_insert_breakpoint)
-       (m32r_memory_remove_breakpoint): Likewise.
-       * monitor.c (monitor_insert_breakpoint, monitor_remove_breakpoint):
-       Likewise.  Remove unnecessary prototypes.  Use placed_address
-       and placed_size.  Removed useless read from memory.
-       * nto-procfs.c (procfs_insert_breakpoint)
-       (procfs_remove_breakpoint, procfs_insert_hw_breakpoint)
-       (procfs_remove_hw_breakpoint): Update.
-       * ocd.c (ocd_insert_breakpoint, ocd_remove_breakpoint): Likewise.
-       * ocd.h (ocd_insert_breakpoint, ocd_remove_breakpoint): Likewise.
-       * ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Likewise.
-       * ppc-tdep.h (ppc_linux_memory_remove_breakpoint): Likewise.
-       * remote-e7000.c (e7000_insert_breakpoint)
-       (e7000_remove_breakpoint): Likewise.
-       * remote-m32r-sdi.c (m32r_insert_breakpoint)
-       (m32r_remove_breakpoint): Likewise.
-       * remote-mips.c (mips_insert_breakpoint)
-       (mips_remove_breakpoint): Likewise.
-       * remote-rdp.c (remote_rdp_insert_breakpoint)
-       (remote_rdp_remove_breakpoint): Likewise.
-       (rdp_step): Use deprecated_insert_raw_breakpoint and
-       deprecated_remove_raw_breakpoint.
-       * remote-sds.c (sds_insert_breakpoint, sds_remove_breakpoint):
-       Update.
-       * remote-sim.c (gdbsim_insert_breakpoint, gdbsim_remove_breakpoint):
-       Delete.
-       (init_gdbsim_ops): Use memory_insert_breakpoint and
-       memory_remove_breakpoint.
-       * remote-st.c (st2000_insert_breakpoint)
-       (st2000_remove_breakpoint): Update.  Remove unused
-       BREAKPOINT_FROM_PC.
-       * remote.c (remote_insert_breakpoint, remote_remove_breakpoint):
-       Update.  Use placed_address and placed_size.
-       (remote_insert_hw_breakpoint, remote_remove_hw_breakpoint): Likewise.
-
-2006-04-12  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * remote.c (extended_remote_restart): Pass the correct length
-       to getpkt.
-
-2006-04-11  Jim Blandy  <jimb@codesourcery.com>
-
-       * serial.c (serial_open): Check for special cases at the front of
-       the "device" name before scanning for the ':' that would indicate
-       an IP-based connection.
-
-2006-04-10  Christopher Faylor  <cgf@timesys.com>
-
-       * win32-nat.c (open_symbol_file_object): New function.
-       (in_dynsym_resolve_code): Ditto.
-       (init_win32_ops): Fill in fields which ought not to be NULL.
-
-2006-04-10  Christopher Faylor  <cgf@timesys.com>
-
-       * win32-nat.c (do_win32_fetch_inferior_registers): Don't do anything
-       with saved context if __COPY_CONTEXT_SIZE is not defined.
-       (handle_output_debug_string): Ditto.
-
-2006-04-10  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * arm-linux-tdep.c (arm_linux_extract_return_value): Use gdb_byte.
-
-2006-04-09  David S. Miller  <davem@sunset.davemloft.net>
-
-       * sparc64-linux-tdep.c (sparc64_linux_init_abi): Append dwarf2
-       frame sniffer.
-       * sparc-tdep.c (sparc32_gdbarch_init): Make sure to call
-       dwarf2_frame_set_init_reg() before gdbarch_init_osabi() so
-       that the latter can override.
-       * Makefile.in (sparc64-linux-tdep.o): Update dependencies.
-
-2006-04-09  Ulrich Weigand  <uweigand@de.ibm.com>
-
-       * s390-tdep.c (struct s390_prologue_data): New field 'stack'.
-       (s390_store): Call pv_area_store to track stack slots.
-       (s390_load): Call pv_area_fetch to track stack slots.
-       (s390_check_for_saved): New function.
-       (s390_analyze_prologue): Call pv_area_scan.  Allocate and free stack.
-
-2006-04-09  Ulrich Weigand  <uweigand@de.ibm.com>
-
-       * Makefile.in (s390-tdep.o): Add dependency on $(prologue_value_h).
-       * s390-tdep.c: Include "prologue-value.h".
-       (struct prologue_value): Remove.
-       (pv_set_to_unknown, pv_set_to_constant, pv_set_to_register,
-       pv_constant_last, pv_add, pv_add_constant, pv_subtract,
-       pv_logical_and, pv_is_identical, pv_is_register): Remove.
-       (compute_x_addr): Remove, replace by ...
-       (s390_addr): ... this new function.
-       (struct s390_prologue_data): Use pv_t instead of prologue_value.
-       (s390_store, s390_load): Likewise.
-       (s390_prologue_frame_unwind_cache): Likewise.
-       (s390_analyze_prologue): Likewise.  Also, simplify and combine
-       several conditional statements.
-
-2006-04-08  Jim Blandy  <jimb@codesourcery.com>
-
-       * Makefile.in (COMMON_OBS): List prologue-value.o.  (Omitted from
-       last patch.)
-
-2006-04-08  David S. Miller  <davem@sunset.davemloft.net>
-
-       * sparc-linux-tdep.c (sparc32_linux_step_trap): New.
-       (sparc32_linux_init_abi): Hook it into tdep->step_trap.
-       (sparc32_linux_core_gregset,
-       sparc32_linux_supply_core_gregset,
-       sparc32_linux_collect_core_gregset,
-       sparc32_linux_supply_core_fpregset,
-       sparc32_linux_collect_core_fpregset): New.
-       (sparc32_linux_init_abi): Register them with generic sparc
-       core regset infrastructure.
-       * sparc64-linux-tdep.c (sparc64_linux_step_trap): New.
-       (sparc64_linux_init_abi): Hook it into tdep->step_trap.
-       (sparc64_linux_core_gregset,
-       sparc64_linux_supply_core_gregset,
-       sparc64_linux_collect_core_gregset,
-       sparc64_linux_supply_core_fpregset,
-       sparc64_linux_collect_core_fpregset): New.
-       (sparc64_linux_init_abi): Register them with generic sparc
-       core regset infrastructure.     
-       * Makefile.in: Update dependencies.
-
-2006-04-07  David S. Miller  <davem@sunset.davemloft.net>
-
-       * linux-nat.c (linux_nat_thread_alive): Handle targets that
-       do not implement PTRACE_PEEKUSER.
-
-2006-04-07  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * remote.c (remote_wait): Convert warning to error before
-       parsing corrupt packets.
-
-2006-04-07  Andrew Stubbs  <andrew.stubbs@st.com>
-
-       * cli/cli-script.c (struct user_args): Add command field.
-       (arg_cleanup): Free command string.
-       (setup_user_args): Copy the command line before relying on it.
-
-2006-04-06  Joel Brobecker  <brobecker@adacore.com>
-
-       * breakpoint.c (_initialize_breakpoint): Add "del" as an alias
-       of the "delete" command.
-
-2006-04-06  Randolph Chung  <tausq@debian.org>
-
-       * MAINTAINERS (Patch champions): Add myself.
-
-2006-04-05  Andreas Schwab  <schwab@suse.de>
-
-       * Makefile.in: Update dependencies.
-
-2006-04-05  David S. Miller  <davem@sunset.davemloft.net>
-
-       * sparc-tdep.c (sparc32_dwarf2_frame_init_reg): New.
-       (sparc32_gdbarch_init): Pass it to dwarf2_frame_set_init_reg.
-       * Makefile.in (sparc-tdep.o): Update dependencies.
-       * sparc-linux-tdep.c (sparc32_linux_sigframe_init): Pull register
-       window out of the correct stack frame.
-       * sparc64-linux-tdep.c (sparc64_linux_sigframe_init): Likewise.
-       * dwarf2-frame.c (dwarf2_frame_ops init_reg): Add "next_frame"
-       argument.
-       (dwarf2_frame_default_init_reg): Likewise.
-       (dwarf2_frame_set_init_reg): Update init_reg arg.
-       (dwarf2_frame_init_reg): Take "next_frame" and pass it to
-       ops->init_reg().
-       (dwarf2_frame_cache): Pass next_frame to dwarf2_frame_init_reg.
-       * dwarf2-frame.h (dwarf2-frame_set_init_reg): Update declaration.
-       * cris-tdep.c (cris_dwarf2_frame_init_reg): Add next_frame arg.
-       * s390-tdep.c (s390_dwarf2_frame_init_reg): Likewise.
-       * sh-tdep.c (sh_dwarf2_frame_init_reg): Likewise.
-       * sparc64-tdep.c (sparc64_dwarf2_frame_init_reg): Likewise.
-       * sparc-tdep.c (sparc32_struct_return_from_sym): New function.
-       (sparc32_frame_cache): Call it.
-       (sparc32_dwarf2_struct_return_p): New function.
-       (sparc_dwarf2_frame_init_reg): Use it to determine if the function
-       returns a structure and thus we have to indicate the return PC and
-       NPC are 4 bytes later than usual.
-       * sparc-linux-tdep.c (sparc32_linux_init_abi): Append
-       dwarf2 frame sniffer.
-       * Makefile.in (sparc-linux-tdep.o): Update dependencies.
-       
-2006-04-04  David S. Miller  <davem@davemloft.net>
-
-       * config/linux.mh (NATDEPFILES): Remove sparc-sol2-nat.o
-       * config/linux64.h (NATDEPFILES): Likewise
-       * sparc-linux-nat.c (supply_gregset, supply_fpregset, fill_gregset,
-       fill_fpregset): New.
-       * sparc64-linux-nat.c (supply_gregset, supply_fpregset, fill_gregset,
-       fill_fpregset): New.
-       * Makefile.in (sparc-linux-nat.o, sparc64-linux-nat.o): Update for
-       new includes.
-       
-2006-04-04  Andreas Schwab  <schwab@suse.de>
-
-       * Makefile.in (elf_common_h): Define.
-
-2006-04-03  Andrew Stubbs  <andrew.stubbs@st.com>
-
-       * sh-tdep.c (sh_dwarf2_frame_init_reg): New function.
-       (sh_gdbarch_init): Call dwarf2_frame_set_init_reg().
-
-2006-03-31  Andrew Stubbs  <andrew.stubbs@st.com>
-
-       * value.h (struct internalvar): Add field 'endian'.
-       * value.c (lookup_internalvar): Initialise endian.
-       (value_of_internalvar): Flip the endian of built-in types if required.
-       (set_internalvar): Set the endian.
-       (show_convenience): Access the value through value_of_internalvar().
-
-2006-03-30  Vladimir Prus  <ghost@cs.msu.su>
-
-       * remote.c (watchpoint_to_Z_packet): Use values of Z_packet_type enum
-       instead of hardcoded integer literals.
-
-2006-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * cli/cli-script.c (insert_args): Handle NULL user_args.
-
-2006-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * arm-tdep.c (thumb_scan_prologue): Don't try to analyze
-       the function at zero if we have no symbols.
-
-2006-03-30  Adrien Kunysz  <a_kunysz@yahoo.com>
-
-       * i386-stub.c (getpacket): Fix array overflow.
-       * m32r-stub.c (getpacket): Likewise.
-       * m68k-stub.c (getpacket): Likewise.
-       * sh-stub.c (getpacket): Likewise.
-       * sparc-stub.c (getpacket): Likewise.
-
-2006-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
-       * frame.h (set_current_sal_from_frame): New prototype.
-       * stack.c (set_current_sal_from_frame): Make global.
-       * infrun.c (normal_stop): Call set_current_sal_from_frame.
-
-2006-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * linux-thread-db.c: Include "linux-nat.h".
-       (check_for_thread_db): New function, split out from
-       thread_db_new_objfile.  Remove dead check for active
-       thread_db on inapplicable targets.
-       (thread_db_new_objfile): Call check_for_thread_db.
-       * Makefile.in (linux-thread-db.o): Update.
-       * linux-nat.c (child_post_attach): Call check_for_thread_db.
-       (linux_child_post_startup_inferior): Likewise.
-       (lin_lwp_attach_lwp): Call target_post_attach instead of
-       child_post_attach.
-       * linux-nat.h (check_for_thread_db): New prototype.
-
-2006-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * remote.c (struct remote_state): Add BUF and BUF_SIZE.
-       (init_remote_state): Initialize the new fields.
-       (get_memory_packet_size): Update BUF and BUF_SIZE if necessary.
-       (set_thread, remote_thread_alive, remote_unpack_thread_info_response)
-       (remote_get_threadinfo, parse_threadlist_response)
-       (remote_get_threadlist, remote_current_thread, remote_threads_info)
-       (remote_threads_extra_info, extended_remote_restart, get_offsets)
-       (remote_check_symbols, remote_open_1, remote_detach)
-       (remove_vcont_probe, remote_vcont_resume, remote_resume)
-       (remote_wait, remote_async_wait, fetch_register_using_p)
-       (remote_fetch_registers, store_register_using_P)
-       (remote_store_registers, check_binary_download, remote_write_bytes)
-       (remote_read_bytes, remote_insert_breakpoint)
-       (remote_remove_breakpoint, remote_insert_watchpoint)
-       (remote_remove_watchpoint, remote_insert_hw_breakpoint)
-       (remote_remove_hw_breakpoint, compare_sections_command)
-       (remote_xfer_partial, remote_rcmd, packet_command)
-       (remote_get_thread_local_address): Use the global incoming buffer
-       instead of alloca or xmalloc.  Limit outgoing packets to
-       rs->remote_packet_size and incoming packets to rs->buf_size.
-       Update calls to getpkt and remote_send.
-       (remote_send): Take arguments by reference.
-       (putpkt_binary): Eliminate junkbuf.  Use skip_frame.
-       (skip_frame): New function.
-       (read_frame): Take arguments by reference.  Expand the packet
-       buffer instead of issuing an error.
-       (getpkt, getpkt_sane): Take arguments by reference.
-       * remote.h (getpkt): Update prototype and doc.
-       * tracepoint.c (remote_get_noisy_reply): Take arguments by
-       reference.
-       (target_buf): Change from array to pointer.
-       (target_buf_size): New variable.
-       (remote_set_transparent_ranges): Update call to getpkt.
-       (trace_start_command, trace_stop_command, trace_status_command):
-       Update calls to remote_get_noisy_reply.
-       (finish_tfind_command): Take arguments by reference.
-       (trace_find_command, trace_find_pc_command)
-       (trace_find_tracepoint_command, trace_find_line_command):
-       (trace_find_range_command, trace_find_outside_command): Update
-       calls to finish_tfind_command.
-       (_initialize_tracepoint): Initialize target_buf_size and target_buf.
-
-2005-03-30  Randolph Chung  <tausq@debian.org>
-
-       * hppa-linux-tdep.c: Include regset.h.
-       (GR_REGNUM, TR_REGNUM, greg_map): New.
-       (hppa_linux_supply_regset, hppa_linux_supply_fpregset): New.
-       (hppa_linux_regset, hppa_linux_fpregset): New.
-       (hppa_linux_regset_from_core_section): New.
-       (hppa_linux_init_abi): Set regset_from_core_section.
-       (_initialize_hppa_linux_tdep): Register osabi handler for
-       64-bit Linux.
-       * Makefile.in (hppa-linux-tdep.o): Update dependencies.
-       * config/pa/linux.mh: Stop using core-regset.o
-
-2006-03-30  Randolph Chung  <tausq@debian.org>
-
-       * hppa-tdep.c (hppa_find_unwind_entry_in_block): New.
-       (hppa_frame_cache): Use new function to find unwind entry.
-       (hppa_frame_this_id): Likewise.
-       (hppa_frame_unwind_sniffer): Likewise.
-
-2006-03-29  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * NEWS: Mention the removal of NLM.
-
-2006-03-29  Steve Ellcey  <sje@cup.hp.com>
-
-       * Makefile.in (nlm): Remove target.
-       * configure.tgt (i[34567]86-*-netware*): Do not set build_nlm.
-       * configure.ac: Remove AC_CONFIG_SUBDIRS of nlm.
-       * configure: Regenerate.
-       * doc/gdb.texinfo: Remove gdbserve.nlm documentation.
-       * nlm: Remove directory.
-
-2006-03-29  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * Makefile.in (utils.o): Update.
-       * top.c (in_user_command): New.
-       (command_line_input): Use input_from_terminal_p.
-       (input_from_terminal_p): Don't check caution.  Handle
-       stdin == NULL for Insight.
-       * top.h (in_user_command, caution): New declarations.
-       * utils.c: Include "top.h".
-       (query, defaulted_query): Check caution here.  Move the call
-       to input_from_terminal_p higher.
-       * cli/cli-script.c (do_restore_user_call_depth): Only decrement
-       the depth.  Update in_user_command if necessary.
-       (execute_user_command): Don't clobber old_chain.  Set
-       in_user_command.  Let do_restore_user_call_depth handle
-       user_call_depth.
-       (read_command_lines): Check whether to prompt before calling
-       Insight hooks.
-       * tui/tui-hooks.c (tui_query_hook): Remove newly unnecessary
-       input_from_terminal_p check.
-
-2006-03-29  Ulrich Weigand  <uweigand@de.ibm.com>
-
-       * s390-nat.c (s390_insert_watchpoint): Add missing argument.
-       (s390_remove_watchpoint): Likewise.
-
-2006-03-28  Jim Blandy  <jimb@codesourcery.com>
-
-       * prologue-value.c, prologue-value.h: New files.
-       * Makefile.in (prologue_value_h): New variable.
-       (HFILES_NO_SRCDIR): List prologue-value.h.
-       (SFILES): List prologue-value.c.
-       (COMMON_OBS): List prologue-value.o.
-       (prologue-value.o): New rule.
-
-2006-03-27  Michael Snyder  <msnyder@redhat.com>
-
-       * xstormy16-tdep.c (xstormy16_return_value, xstormy16_push_dummy_call,
-       xstormy16_pointer_to_address, xstormy16_address_to_pointer, 
-       xstormy16_frame_prev_register): Change void* to gdb_byte*.
-       (xstormy16_push_dummy_call): Add block-local char* val, 
-       to avoid type conflict with outer scope variable.
-
-2006-03-27  Andrew Stubbs  <andrew.stubbs@st.com>
-
-       * sh-tdep.c (sh_gdbarch_init): Add missing architectures.
-
-2006-03-27  Nick Roberts  <nickrob@snap.net.nz>
-
-       * varobj.c (c_name_of_child, c_value_of_child): Allow non-zero
-       offsets for languages like Fortran.
-
-2006-03-26  Randolph Chung  <tausq@debian.org>
-
-       * config/pa/hppa64.mt: Use HPUX version of the tm file.
-
-2006-03-25  Nick Roberts  <nickrob@snap.net.nz>
-
-       * mi/gdb-mi.el (gdbmi-send): Improve regexp to repeat commands.
-       Try to deal with continuation line.
-       (gdbmi, gdbmi-prompt1, gud-gdbmi-marker-filter): Update to new
-       variable names.
-       (gdb-break-list-regexp, gdb-stack-list-frames-regexp): 
-       Future proof against new fields being added to MI output.
-       (gdbmi-prompt2, gdb-break-list-handler,gdb-get-source-file)
-       (gdbmi-frame-handler): Update to new variable name
-       gdb-get-buffer-create.
-       (gdbmi-frame-handler): Use hollow-right-triangle for all selected
-       frames which except the innermost (where execution has stopped).
-
-2006-03-24  Randolph Chung  <tausq@debian.org>
-
-       * solib-som.c (link_map_start): Don't error out if there is
-       not yet a link map.
-
-2006-03-24  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * linux-nat.c (linux_ops_saved): New.
-       (super_mourn_inferior, kill_inferior, threaded, linux_nat_ops)
-       (child_mourn_inferior, child_wait, linux_nat_create_inferior)
-       (linux_nat_fetch_registers, linux_nat_store_registers)
-       (linux_nat_child_post_startup_inferior, init_linux_nat_ops): Delete.
-       (init_lwp_list): Don't set threaded.
-       (add_lwp): Don't modify threaded.
-       (delete_lwp): Don't mention non-threaded mode.
-       (linux_nat_switch_fork): New.
-       (linux_nat_attach): Update inferior_ptid.
-       (linux_nat_wait): Handle num_lwps == 0 at entry.  Don't check
-       threaded flag.
-       (linux_nat_kill): Handle pending forks and saved forks.
-       (linux_nat_mourn_inferior): Handle saved forks.
-       (linux_nat_pid_to_str): Don't use the LWP form when there is
-       only one thread.
-       (linux_target): Don't set to_wait, to_kill, or to_mourn_inferior.
-       (linux_nat_add_target): New.
-       (_initialize_linux_nat): Don't initialize the linux native target
-       here.
-       * linux-nat.h (linux_nat_add_target, linux_nat_switch_fork): New
-       prototypes.
-       * linux-fork.c: Include "linux-nat.h".
-       (add_fork): Update initial PID.
-       (fork_load_infrun_state): Call linux_nat_switch_fork.
-       * Makefile.in (linux-fork.o): Update.
-
-       * alpha-linux-nat.c (_initialize_alpha_linux_nat): Use
-       linux_nat_add_target instead of add_target.
-       * amd64-linux-nat.c (_initialize_amd64_linux_nat): Likewise.
-       * arm-linux-nat.c (_initialize_arm_linux_nat): Likewise.
-       * hppa-linux-nat.c (_initialize_hppa_linux_nat): Likewise.
-       * ia64-linux-nat.c (_initialize_ia64_linux_nat): Likewise.
-       * i386-linux-nat.c (_initialize_i386_linux_nat): Likewise.
-       * m32r-linux-nat.c (_initialize_m32r_linux_nat): Likewise.
-       * m68klinux-nat.c (_initialize_m68k_linux_nat): Likewise.
-       * mips-linux-nat.c (_initialize_mips_linux_nat): Likewise.
-       * ppc-linux-nat.c (_initialize_ppc_linux_nat): Likewise.
-       * s390-nat.c (_initialize_s390_nat): Likewise.
-       * sparc-linux-nat.c (_initialize_sparc_linux_nat): Likewise.
-       * sparc64-linux-nat.c (_initialize_sparc64_linux_nat): Likewise.
-
-2006-03-24  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * linux-fork.c: Include "gdb_assert.h".
-       (fork_load_infrun_state): Set inferior_ptid and stop_pc here.
-       Update the register cache and selected frame also.
-       (linux_fork_mourn_inferior): Use fork_load_infrun_state.  Return
-       to single fork mode if necessary.
-       (linux_fork_context): Remove bits handled by fork_load_infrun_state.
-       * Makefile.in (linux_fork_h): New.
-       (linux-fork.o, linux-nat.o): Update.
-
-2006-03-23  Andreas Schwab  <schwab@suse.de>
-
-       * config/s390/s390.mh (NATDEPFILES): Add linux-fork.o.
-
-2006-03-18  Jim Blandy  <jimb@codesourcery.com>
-
-       * symtab.h (enum address_class): Doc fix.
-
-2006-03-16  Michael Snyder  <msnyder@redhat.com>
-
-       * tracepoint.c (tracepoint_save_command): Fix typo in error msg.
-       * target.c (push_target): Fix typo in comment.
-       * remote.c (remote_watch_data_address): Fix typo in comment.
-       * i386-tdep.c (i386_push_dummy_call): Fix typo in comment.
-
-2006-03-15  Kevin Buettner  <kevinb@redhat.com>
-
-       * frv-linux-tdep.c (gdbcore.h, regcache.h, regset.h, gdb_string.h):
-       Include.
-       (FRV_ELF_NGREG, FRV_PT_PSR, FRV_PT_ISR, FRV_PT_CCR, FRV_PT_CCCR)
-       (FRV_PT_LR, FRV_PT_LCR, FRV_PT_PC, FRV_PT_GNER0, FRV_PT_GNER1)
-       (FRV_PT_IACC0H, FRV_PT_IACC0L, FRV_PT_GR, FRV_PT_TBR)
-       (FRV_PT_EXEC_FDPIC_LOADMAP, FRV_PT_INTERP_FDPIC_LOADMAP): Define.
-       (frv_elf_greg_t, frv_elf_gregset_t, frv_elf_fpreg_t)
-       (frv_elf_fpregset_t): Define types.
-       (frv_linux_supply_gregset, frv_linux_supply_fpregset)
-       (frv_linux_regset_from_core_section: New functions.
-       (frv_linux_gregset, frv_linux_fpregset): New static globals.
-       (frv_linux_init_abi): Register the `regset_from_core_section' method.
-       * Makefile.in (frv-linux-tdep.o): Update dependencies.
-       * solib-frv.c (frv_current_sos): Relocate main executable after
-       loading core file.
-       (frv_clear_solib): Clean up space associated with
-       `main_executable_lm_info'.
-       * config/frv/frv.mt (TDEPFILES): Add corelow.o to this list.
-
-2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * Makefile.in (mips_linux_tdep_h): New.
-       (mpis-linux-nat.o, mips-linux-tdep.o): Update.
-       * mips-linux-nat.c: Include "inferior.h", "mips-linux-tdep.h", and
-       <sys/ptrace.h>.
-       (have_ptrace_regsets, super_fetch_registers, super_store_registers)
-       (mips64_linux_regsets_fetch_registers)
-       (mips64_linux_regsets_store_registers, mips64_linux_fetch_registers)
-       (mips64_linux_store_registers): New.
-       (_initialize_mips_linux_nat): Override to_fetch_registers and
-       to_store_registers.
-       * mips-linux-tdep.h: New file.
-       * mips-linux-tdep.c: Include "mips-linux-tdep.c".
-       (ELF_NGREG, ELF_NFPREG, elf_greg_t, elf_gregset_t, elf_fpreg_t)
-       (elf_fpregset_t, FPR_BASE, PC, CAUSE, BADVADDR, MMHI, MMLO)
-       (FPC_CSR, FPC_EIR, EF_REG0, EF_REG31, EF_LO, EF_HI, EF_CP0_EPC)
-       (EF_CP0_BADVADDR, EF_CP0_STATUS, EF_CP0_CAUSE, EF_SIZE)
-       (MIPS64_ELF_NGREG, MIPS64_ELF_NFPREG, mips64_elf_greg_t)
-       (mips64_elf_gregset_t, mips64_elf_fpreg_t, mips64_elf_fpregset_t)
-       (MIPS64_FPR_BASE, MIPS64_PC, MIPS64_CAUSE, MIPS64_BADVADDR)
-       (MIPS64_MMHI, MIPS64_MMLO, MIPS64_FPC_CSR, MIPS64_FPC_EIR)
-       (MIPS64_EF_REG0, MIPS64_EF_REG31, MIPS64_EF_LO, MIPS64_EF_HI)
-       (MIPS64_EF_CP0_EPC, MIPS64_EF_CP0_BADVADDR, MIPS64_EF_CP0_STATUS)
-       (MIPS64_EF_CP0_CAUSE, MIPS64_EF_SIZE): Delete.
-       (supply_32bit_reg): Use gdb_byte.
-       (supply_64bit_reg): New.
-       (mips_supply_gregset, mips_fill_gregset, mips_supply_fpregset)
-       (mips_fill_fpregset, fetch_core_registers, supply_gregset)
-       (fill_gregset, supply_fpregset): Update for renamed types.
-       (mips64_supply_gregset): Use gdb_byte and supply_64bit_reg.
-       (mips64_fill_gregset): Make global.  Handle 32-bit register
-       sizes.
-       (mips64_fill_fpregset): Make global.  Use gdb_byte.  Handle
-       FP regsets properly.
-
-2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * mips-linux-tdep.c (mips_supply_gregset): Renamed from supply_gregset.
-       (mips_fill_gregset): Renamed from fill_gregset.
-       (mips_supply_fpregset): Renamed from supply_fpregset.
-       (mips_fill_fpregset): Renamed from fill_fpregset.
-       (fetch_core_registers): Update calls.
-       (supply_gregset, fill_gregset, supply_fpregset, fill_fpregset): New
-       functions.
-
-2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * mips-tdep.c (mips_gdbarch_init): Default 64-bit ELF files to N64.
-
-2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * mips-tdep.c (is_mips16_addr, mips32_next_pc, add_offset_16):
-       Correct arithmetic for 64-bit CORE_ADDR.
-
-2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * mips-linux-tdep.c: Include "floatformat.h".
-       (mips_linux_init_abi): Use 128-bit long double for N32 and N64.
-       * mips-tdep.c (mips_n32n64_return_value): Support 128-bit long
-       double.
-       (print_gp_register_row): Don't print spaces before ignored
-       or floating point registers.
-       * Makefile.in (mips-linux-tdep.o): Update.
-
-2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * mips-mdebug-tdep.c (compare_pdr_entries): Use bfd_get_signed_32
-       for code addresses.
-       (non_heuristic_proc_desc): Likewise.
-
-2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * mips-linux-nat.c: Include "gdb_proc_service.h".
-       (PTRACE_GET_THREAD_AREA): Define.
-       (ps_get_thread_area): New.
-       * Makefile.in (mips-linux-nat.o): Update.
-
-2006-03-13  Jim Blandy  <jimb@codesourcery.com>
-
-       * MAINTAINERS: Use my work address.
-
-2006-03-09  Michael Snyder  <msnyder@redhat.com>
-
-       * linux-nat.c (kill_inferior): Just call target_mourn_inferior
-       instead of getting tricky for the multi-fork case.
-       * linux-fork.c (linux_fork_killall): Call PT_KILL and waitpid
-       for each fork, and then use init_fork_list to delete them.
-
-2006-03-08  Alexandre Oliva  <aoliva@redhat.com>
-
-       * solib-svr4.c (svr4_current_sos): Move up initialization of
-       l_addr, such that it clearly covers all cases.
-
-2006-03-08  Andreas Schwab  <schwab@suse.de>
-
-       * ia64-tdep.c (ia64_libunwind_frame_this_id): Adapt use of
-       libunwind_frame_prev_register to use a gdb_byte buffer and
-       extract_unsigned_integer.
-       (ia64_libunwind_sigtramp_frame_prev_register): Likewise.
-
-       * libunwind-frame.c (libunwind_frame_prev_register): Change type
-       of last argument to `gdb_byte *'
-       * libunwind-frame.h: Adjust declaration.
-
-2006-03-08  Paul Brook  <paul@codesourcery.com>
-
-       * arm-tdep.c (arm_push_dummy_call): Remove stack alignment.
-       (arm_frame_align): New function.
-       (arm_gdbarch_init): Use it.
-
-2006-03-03  Khem Raj <khem@mvista.com>
-
-       * remote-rdp.c (remote_rdp_xfer_inferior_memory): Use gdb_byte.
-       Committed by Andrew Cagney.
-       
-2006-03-02  Corinna Vinschen  <vinschen@redhat.com>
-
-       * mn10300-tdep.c (mn10300_push_dummy_call): Write breakpoint
-       address to MDR register.
-
-2006-03-01  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * gdbtypes.c (lookup_struct_elt_type): Correct noerr for recursive
-       calls.
-
-2006-03-01  Randolph Chung  <tausq@debian.org>
-
-       * somread.c (som_symfile_read): Update comment and remove unneeded 
-       use of a deprecated variable.
-
-2006-03-01  Randolph Chung  <tausq@debian.org>
-
-       * hppa-tdep.h (unwind_table_entry): Update field names to match HP
-       runtime specification.
-       * hppa-tdep.c (internalize_unwinds, hppa_frame_cache): Likewise.
-       (unwind_command): Likewise.
-
-2006-03-01  Randolph Chung  <tausq@debian.org>
-
-       * hppa-tdep.c (hppa_frame_cache): Handle Region_Description and
-       Pseudo_SP_Set in unwind record.
-
-2006-03-01  Randolph Chung  <tausq@debian.org>
-
-       * hppa-hpux-tdep.c (initialize_hp_cxx_exception_support): Use
-       TDEP->is_elf to determine if we are working with a SOM binary.
-       (null_symtab_and_line): Remove unused variable.
-       * config/pa/hppa64.mt: Use tm-hppa.h.
-       * config/pa/tm-hppa64.h: Remove file.
-
-2006-03-01  Wu Zhou  <woodzltc@cn.ibm.com>
-
-        * f-typeprint.c (f_type_print_base): Delete the redundant space.
-
-2006-02-28  Kevin Buettner  <kevinb@redhat.com>
-
-       * Makefile.in (mn10300-linux-tdep.o): Update dependencies.
-       * mn10300-linux-tdep.c (frame.h, trad-frame.h, tramp-frame.h):
-       Include.
-       (am33_linux_sigframe_cache_init): New function.
-       (am33_linux_sigframe, am33_linux_rt_sigframe): New signal frame
-       descriptions.
-       (AM33_SIGCONTEXT_D0, AM33_SIGCONTEXT_D1, AM33_SIGCONTEXT_D2)
-       (AM33_SIGCONTEXT_D3, AM33_SIGCONTEXT_A0, AM33_SIGCONTEXT_A1)
-       (AM33_SIGCONTEXT_A2, AM33_SIGCONTEXT_A3, AM33_SIGCONTEXT_E0)
-       (AM33_SIGCONTEXT_E1, AM33_SIGCONTEXT_E2, AM33_SIGCONTEXT_E3)
-       (AM33_SIGCONTEXT_E4, AM33_SIGCONTEXT_E5, AM33_SIGCONTEXT_E6)
-       (AM33_SIGCONTEXT_E7, AM33_SIGCONTEXT_LAR, AM33_SIGCONTEXT_LIR)
-       (AM33_SIGCONTEXT_MDR, AM33_SIGCONTEXT_MCVF, AM33_SIGCONTEXT_MCRL)
-       (AM33_SIGCONTEXT_MCRH, AM33_SIGCONTEXT_MDRQ, AM33_SIGCONTEXT_SP)
-       (AM33_SIGCONTEXT_EPSW, AM33_SIGCONTEXT_PC, AM33_SIGCONTEXT_FPUCONTEXT):
-       New constants.
-       (am33_linux_init_osabi): Register signal frame unwinders.
-
-2006-02-28  Kevin Buettner  <kevinb@redhat.com>
-
-       * mn10300-tdep.c (mn10300_analyze_prologue):  Implement backtrack
-       out of pattern match by saving relevant state.  Fix stack size
-       adjustment bug.
-
-2006-02-28  Alexandre Oliva  <aoliva@redhat.com>
-
-       * solib-svr4.h (struct link_map_offsets): Add l_ld_offset and
-       l_ld_size fields.
-       * solib-svr4.c (struct lm_info): Add l_addr field.
-       (LM_ADDR_FROM_LINK_MAP): Renamed from LM_ADDR.
-       (HAS_LM_DYNAMIC_FROM_LINK_MAP): New.
-       (LM_DYNAMIC_FROM_LINK_MAP): New.
-       (LM_ADDR_CHECK): New.  Use it instead of LM_ADDR.
-       (svr4_current_sos): Initialize l_addr.  Adjust.
-       (svr4_relocate_section_addresses): Adjust.
-       (svr4_ilp32_fetch_link_map_offsets): Define new members.
-       (svr4_lp64_fetch_link_map_offsets): Likewise.
-       * solib-legacy.c (legacy_svr4_fetch_link_map_offsets): Likewise.
-       * mipsnbsd-tdep.c (mipsnbsd_ilp32_fetch_link_map_offsets): Likewise.
-       (mipsnbsd_lp64_fetch_link_map_offsets): Likewise.
-       * Makefile.in (solib-svr4.o): Depend on $(elf_bfd_h).
-
-2006-02-26  David S. Miller  <davem@sunset.davemloft.net>
-
-       * config/sparc/linux.mt (TDEPFILES): Add sol2-tdep.o.
-       * config/sparc/linux64.mt (TDEPFILES): Likewise.
-
-2006-02-27  Alan Modra  <amodra@bigpond.net.au>
-
-       * ppc-linux-nat.c (ppc_linux_insert_watchpoint): Correct return type.
-       (ppc_linux_remove_watchpoint): Likewise, and args.
-
-2006-02-26  Mark Kettenis  <kettenis@gnu.org>
-
-       * i386obsd-tdep.c (i386obsd_trapframe_sniffer): Also recognize
-       "soft" interrupts.
-
-2006-02-24  Charles Wilson  <cygwin@cwilson.fastmail.fm>
-
-       * gdb/defs.h: unconditionally include <fcntl.h>, and
-       ensure that O_BINARY is defined.
-       * gdb/solib.c(solib_open): ensure solib files are opened in
-       binary mode.
-       * gdb/corelow.c: Remove O_BINARY macro definition.
-       * gdb/exec.c: Remove O_BINARY macro definition
-       * gdb/remote-rdp.c: Remove O_BINARY macro definition
-       * gdb/source.c: Remove O_BINARY macro definition
-       * gdb/symfile.c: Remove O_BINARY macro definition
-
-2006-02-24  Randolph Chung  <tausq@debian.org>
-
-        * hppa-hpux-tdep.c (hppa_hpux_push_dummy_code): Initialize 
-       argreg.
-        * solib-som.c (som_solib_remove_inferior_hook): Remove unused 
-       function.
-
-2006-02-24  Wu Zhou  <woodzltc@cn.ibm.com>
-
-       * f-exp.y: Symbol '%' is not used as the modulus operator in
-       Fortran.  Delete this from Fortran expression.
-       It is now used by Fortran 90 and later to access the member
-       of derived type.  Add this into Fortran expression.
-       * f-valprint.c (f_val_print): Add code to handle TYPE_CODE_STRUCT.
-       Print each elements in the derived type.
-       * f-typeprint.c (print_equivalent_f77_float_type): Add a parameter
-       level into the function definition to do indented printing.  And
-       call fprintfi_filtered instead to do indented printing.
-       (f_type_print_base): Replace fprintf_filtered with the indented
-       version (fprintfi_filtered).
-       (f_type_print_base): Call indented print_equivalent_f77_float_type.
-       (f_type_print_base): Add code to handle TYPE_CODE_STRUCT.  Print
-       the definition of the derived type.
-
-2006-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * gdb_curses.h: Provide a fallback prototype for tgetnum.
-
-2006-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * doublest.h: Conditionalize DOUBLEST on PRINTF_HAS_LONG_DOUBLE
-       also.
-       (DOUBLEST_FORMAT): Rename to DOUBLEST_PRINT_FORMAT.
-       (DOUBLEST_SCAN_FORMAT): New.
-       * ada-lex.l (PRINTF_HAS_LONG_DOUBLE): Remove redefinitions.
-       (processReal): Use DOUBLEST_SCAN_FORMAT.
-       * c-exp.y (parse_number): Likewise.
-       * jv-exp.y (parse_number): Likewise.
-       * objc-exp.y (parse_number): Likewise.
-       * p-exp.y (parse_number): Likewise.
-
-2006-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * event-top.c (async_do_nothing, async_disconnect)
-       (async_stop_sig, async_float_handler): Remove duplicated
-       prototypes.
-       (handle_sighup): Guard prototype with SIGHUP.
-       (async_do_nothing): Guard function and prototype with
-       SIGQUIT || SIGHUP.
-       (async_disconnect): Guard prototype with SIGHUP.
-       (async_stop_sig): Guard prototype with STOP_SIGNAL.
-
-2006-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * maint.c (maintenance_dump_me): Remove unnecessary prototype.
-
-2006-02-23  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * win32-termcap.c (tputs): Return 0.
-
-2006-02-21  Mark Kettenis  <kettenis@gnu.org>
-
-       * configure.ac: Introduce ---enable-werror, which adds -Werror to
-       the compiler command line.  Enabled by default.  Disable with
-       --disable-werror.
-       * configure regenerate.
-
-2006-02-21  Daniel Jacobowitz  <dan@codesourcery.com>
-
-        * elfread.c (elf_symtab_read): Skip symbols which BFD considers
-       special.
-
-2006-02-21  Andrew Stubbs  <andrew.stubbs@st.com>
-
-       * defs.h (directory_switch): Add prototype.
-       * main.c (captured_main): Use directory_switch() instead of
-       directory_command() to add directories from the -d switch.
-       * source.c (directory_switch): New function.
-       (add_path): Use buildargv() to parse spaces in filenames properly.
-       Strip multiple trailing '/' rather than just one.
-
-2006-02-21  Andrew Stubbs  <andrew.stubbs@st.com>
-
-       * symfile.c (add_symbol_file_command): Use buildargv(), instead of
-       hand decoding the command line, to allow use of quotes and spaces.
-       (_initialize_symfile): Reorganize the help message for add-symbol-file
-       such that 'help files' shows a better message.
-
-2006-02-21  Andrew Stubbs  <andrew.stubbs@st.com>
-
-       * sh-tdep.c (sh_generic_show_regs): Reformat both code and output.
-       (sh3_show_regs, sh2e_show_regs, sh2a_show_regs): Likewise.
-       (sh2a_nofpu_show_regs, sh3e_show_regs, sh3_dsp_show_regs): Likewise.
-       (sh4_show_regs, sh4_nofpu_show_regs, sh_dsp_show_regs): Likewise.
-
-2006-02-20  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * linux-nat.c (lin_thread_get_thread_signals): Default to __SIGRTMIN
-       and __SIGRTMIN + 1.
-
-2006-02-20  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * remote.c: Add an enumeration for configurable remote
-       packets.
-       (remote_protocol_packets, set_remote_protocol_packet_cmd)
-       (show_remote_protocol_packet_cmd): New.
-       (remote_protocol_vcont)
-       (set_remote_protocol_vcont_packet_cmd)
-       (show_remote_protocol_vcont_packet_cmd)
-       (remote_protocol_qSymbol)
-       (set_remote_protocol_qSymbol_packet_cmd)
-       (show_remote_protocol_qSymbol_packet_cmd)
-       (remote_protocol_P, set_remote_protocol_P_packet_cmd)
-       (show_remote_protocol_P_packet_cmd)
-       (remote_protocol_Z)
-       (set_remote_protocol_Z_software_bp_packet_cmd)
-       (show_remote_protocol_Z_software_bp_packet_cmd)
-       (set_remote_protocol_Z_hardware_bp_packet_cmd)
-       (show_remote_protocol_Z_hardware_bp_packet_cmd)
-       (set_remote_protocol_Z_write_wp_packet_cmd)
-       (show_remote_protocol_Z_write_wp_packet_cmd)
-       (set_remote_protocol_Z_read_wp_packet_cmd)
-       (show_remote_protocol_Z_read_wp_packet_cmd)
-       (set_remote_protocol_Z_access_wp_packet_cmd)
-       (show_remote_protocol_Z_access_wp_packet_cmd)
-       (remote_protocol_binary_download)
-       (set_remote_protocol_binary_download_cmd)
-       (show_remote_protocol_binary_download_cmd)
-       (remote_protocol_qPart_auxv)
-       (set_remote_protocol_qPart_auxv_packet_cmd)
-       (show_remote_protocol_qPart_auxv_packet_cmd)
-       (remote_protocol_qGetTLSAddr)
-       (set_remote_protocol_qGetTLSAddr_packet_cmd)
-       (show_remote_protocol_qGetTLSAddr_packet_cmd)
-       (remote_protocol_p)
-       (set_remote_protocol_p_packet_cmd)
-       (show_remote_protocol_p_packet_cmd): Delete.
-
-       (init_all_packet_configs): Simplify.
-       (set_remote_protocol_Z_packet_cmd)
-       (show_remote_protocol_Z_packet_cmd)
-       (remote_check_symbols, remote_vcont_probe, remote_vcont_resume)
-       (remote_fetch_registers, remote_prepare_to_store)
-       (remote_store_registers, check_binary_download)
-       (remote_write_bytes, remote_insert_breakpoint)
-       (remote_remove_breakpoint, remote_insert_watchpoint)
-       (remote_remove_watchpoint, remote_insert_hw_breakpoint)
-       (remote_remove_hw_breakpoint, remote_xfer_partial)
-       (remote_get_thread_local_address): Update for packet array.
-       (_initialize_remote): Likewise; also update for common
-       set/show commands.
-
-2006-02-20  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * symfile.c (place_section): Correct retry logic.
-
-2006-02-19  Christopher Faylor  <cgf@timesys.com>
-
-       * win32_nat.c (cygwin_load_start): New variable.
-       (cygwin_load_end): Ditto.
-       (have_saved_context): Ditto.
-       (saved_context): Ditto.
-       (max_dll_name_len): Delete obsolete variable.
-       (do_win32_fetch_inferior_registers): Use context saved from cygwin1.dll
-       if we are in a cygwin signal rather than a windows signal.
-       (solib_symbols_add): Detect and store beginning and end of cygwin DLL
-       if dll being loaded is the cygwin DLL.
-       (register_loaded_dll): Remove calculation of max_dll_name_len.
-       (win32_clear_solib): Ditto.
-       (handle_load_dll): Delete obsolete variable.  Remove unneeded call to
-       solib_add.
-       (handle_output_debug_string): Detect and store signal information sent
-       by Cygwin here.
-       (handle_exception): Silently pass on errors in the cygwin DLL.  Return
-       -1 on first pass exception.
-       (win32_continue): Remove spurious clearing of continue_status.
-       (get_win32_debug_event): Deal differently first chance exception.
-
-2006-02-19  Randolph Chung  <tausq@debian.org>
-
-       * hppa-tdep.c (hppa_in_solib_call_trampoline): Only use if no
-       unwind entry.
-
-2006-02-16  Fred Fish  <fnf@specifix.com>
-
-       * eval.c (evaluate_subexp_standard):  For OP_TYPE, return
-       a non lval value zero, of the appropriate type, when avoiding
-       side effects.
-       * typeprint.c (ptype_eval): Remove function and declaration.
-       (ptype_command): Simplify to just a call to whatis_exp.
-
-2006-02-15  Paul Brook  <paul@codesourcery.com>
-
-       * arm-tdep.c (arm_skip_prologue, thumb_get_next_pc, arm_get_next_pc):
-       Load insn opcodes as unsigned values.
-
-2006-02-14  Alexandre Oliva  <aoliva@redhat.com>
-
-       * doublest.h (DOUBLEST): Use long double only if we can scan
-       it in.  Undefine HAVE_LONG_DOUBLE otherwise.
-       (DOUBLEST_FORMAT): New.
-       * c-exp.y (parse_number): Use it.
-       * jv-exp.y (parse_number): Likewise.
-       * objc-exp.y (parse_number): Likewise.
-       * p-exp.y (parse_number): Likewise.
-       * varobj.c (free_variable): Silence type-punning warnings.
-       * tui/tui-data.h (struct tui_list): Change type of list member.
-       * tui/tui-data.c: Remove no-longer-needed type casts.
-       (source_windows): Silence type-punning warnings.
-       * tui/tui-stack.c, tui/tui-win.c, tui/tui-winsource.c: Likewise.
-
-2006-02-13  Mark Kettenis  <kettenis@gnu.org>
-
-       Fix PR breakpoints/2080.
-       * i386-tdep.c (struct i386_frame_cache): Add stack_align member.
-       (i386_analyze_stack_align): New function.
-       (i386_analyze_prologue): Use i386_analyze_stack_align.
-       (i386_frame_cache): Deal with stack realignment.
-
-2006-02-14  Nick Roberts  <nickrob@snap.net.nz>
-
-       * mi/gdb-mi.el: Use more functions from gdb-ui.el.
-       (gdb-break-list-regexp): Match "what" field if present.
-       (gdb-stack-list-frames-regexp): Match "from" field if present.
-       (gdb-stack-list-frames-handler): Present output like "info
-       breakpoints" so regexps can be shared with gdb-ui
-
-2006-02-10  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * NEWS: Mention native Windows support.
-       * Makefile.in (gdb_select_h, ser_tcp_h): New.
-       (ALLDEPFILES): Add ser-mingw.c.
-       (event-loop.o, inflow.o, mingw-hdep.o, posix-hdep.o, ser-base.o)
-       (ser-tcp.o, ser-unix.o): Update.
-       (ser-mingw.o): New rule.
-       * configure: Regenerated.
-       * configure.ac: Add ser-mingw.o for mingw32.
-       * ser-mingw.c: New file.
-       * event-loop.c: Include "gdb_select.h".
-       (gdb_select): Remove, moved to mingw-hdep.c and posix-hdep.c.
-       * ser-base.c: Include "gdb_select.h".
-       (ser_base_wait_for): Use gdb_select.
-       * serial.c (serial_for_fd): New function.
-       (serial_fdopen): Try "terminal" before "hardwire".  Initialize
-       the allocated struct serial.
-       (serial_wait_handle): New function.
-       * serial.h (serial_for_fd, serial_wait_handle): New prototypes.
-       (struct serial_ops) [USE_WIN32API]: Add wait_handle.
-       * gdb_select.h: New file.
-       * ser-tcp.c: Include "ser-tcp.h".  Remove unused "ser-unix.h" include.
-       (net_close, net_read_prim, net_write_prim): Make global.
-       (net_open): Likewise.  Pass an exception set to select.  Whitespace fix.
-       Document why we can not use gdb_select.
-       (_initialize_ser_tcp) [USE_WIN32API]: Do not register TCP support here.
-       * ser-tcp.h: New file.
-       * inflow.c (gdb_has_a_terminal): Don't initialize stdin_serial here.
-       (handle_sigio): Use gdb_select.
-       (initialize_stdin_serial): New function.
-       * terminal.h (initialize_stdin_serial): New prototype.
-       * top.c (gdb_init): Call initialize_stdin_serial.
-       * mingw-hdep.c (gdb_select): New function, moved from gdb_select in
-       event-loop.c.  Add exception condition support.  Use serial_for_fd
-       and serial_wait_handle.  Fix timeout handling.
-       * posix-hdep.c: Include "gdb_select.h".
-       (gdb_select): New function.
-       * remote-st.c (connect_command): Use gdb_select.
-       * ser-unix.c: Include "gdb_select.h".
-       (hardwire_send_break, wait_for): Use gdb_select.
-
-2006-02-10  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * Makefile.in (mingw-hdep.o, posix-hdep.o): New dependencies.
-       (ALLDEPFILES): Add mingw-hdep.c and posix-hdep.c.
-       * configure.ac: Add gdb_host_obs to CONFIG_OBS.  Set gdb_host_obs
-       to posix-hdep.o by default.
-       * configure: Regenerated.
-       * configure.host: Document gdb_host_obs.  Add an entry for
-       i[34567]86-*-mingw32*.
-       * mingw-hdep.c, posix-hdep.c: New files.
-       * utils.c (safe_strerror): Remove, moved to posix-hdep.o.
-
-2006-02-10  Joel Brobecker  <brobecker@adacore.com>
-
-       * defs.h (gdb_osabi): New enum value GDB_OSABI_AIX.
-       * osabi.c (gdb_osabi_name): Add name of new value GDB_OSABI_AIX.
-       * rs6000-tdep.h: New file.
-       * rs6000-tdep.c: Include "rs6000-tdep.h".
-       (rs6000_gdbarch_init): Remove enabling of software single step.
-       Will be done in the AIX-specific initialization routine.
-       * rs6000-aix-tdep.c: New file.
-       * config/powerpc/aix.mt (TDEPFILES): Add rs6000-aix-tdep.o.
-       * Makefile.in (rs6000_tdep_h): New variable.
-       (rs6000-tdep.o): Update dependencies.
-       (rs6000-aix-tdep.o): New rule.
-
-2006-02-10  Joel Brobecker  <brobecker@adacore.com>
-
-        * aix-thread.c (_initialize_aix_thread): Use add_setshow_boolean_cmd
-        instead of add_setshow_zinteger_cmd to defined the aix-thread
-        boolean setting.
-
-2006-02-10  Nick Roberts  <nickrob@snap.net.nz>
-
-       * mi/gdb-mi.el: Update to reflect changes in Emacs 22.0.50.
-
-2006-02-09  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * dwarf2read.c (struct dwarf2_per_cu_data): Reduce length to
-       30 bits.  Add load_all_dies flag.
-       (load_partial_dies): Load all DIEs if per_cu->load_all_dies is set.
-       Load DW_TAG_member by default.  Remove internal_error call.
-       (find_partial_die): Reload the compilation unit if we can not find
-       a DIE in the cache.  Call internal_error here if we still can not
-       find the DIE.
-
-2006-02-10  Nick Roberts  <nickrob@snap.net.nz>
-
-       * breakpoint.c (print_one_breakpoint): Add break to case
-       bp_catch_vfork in switch statement.
-
-2006-02-08  Wu Zhou  <woodzltc@cn.ibm.com>
-
-       * config/i386/nm-i386sol2.h: Update copyright year.
-       * config/mips/nm-irix5.h: Ditto.
-       * config/sparc/nm-sol2.h: Ditto.
-       * s390-nat.c: Ditto.
-       * ppc-linux-nat.c: Ditto.
-
-2006-02-08  Wu Zhou  <woodzltc@cn.ibm.com>
-
-       * breakpoint.c (TARGET_REGION_OK_FOR_HW_WATCHPOINT): Delete.
-       * config/i386/nm-i386sol2.h (TARGET_REGION_OK_FOR_HW_WATCHPOINT): New.
-       (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT): Delete.
-       * config/mips/nm-irix5.h (TARGET_REGION_OK_FOR_HW_WATCHPOINT): New.
-       (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT): Delete.
-       * config/sparc/nm-sol2.h (TARGET_REGION_OK_FOR_HW_WATCHPOINT): New.
-       (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT): Delete.
-       * inf-ttrace.c (inf_ttrace_region_ok_for_hw_watchpoint): New.
-       (inf_ttrace_region_size_ok_for_hw_watchpoint): Delete.
-       (inf_ttrace_target): Delete to_region_size_ok_for_hw_watchpoint and
-       add to_region_ok_for_hw_watchpoint.
-       * s390-nat.c (s390_region_size_ok_for_hw_watchpoint): Delete.
-       (s390_region_ok_for_hw_watchpoint): New.
-       (_initialize_s390_nat): Delete to_region_size_ok_for_hw_watchpoint
-       and add to_region_ok_for_hw_watchpoint.
-       * target.c (default_region_size_ok_for_hw_watchpoint, 
-       debug_to_region_size_ok_for_hw_watchpoint): Delete prototype.
-       (update_current_target): Delete to_region_size_ok_for_hw_watchpoint
-       inheritance and default_region_size_ok_for_hw_watchpoint.
-       (default_region_ok_for_hw_watchpoint): If len is less than or equal
-       the length of void pointer, return ok.
-       (default_region_size_ok_for_hw_watchpoint): Delete.
-       (debug_to_region_size_ok_for_hw_watchpoint): Delete.
-       (setup_target_debug): Delete to_region_size_ok_for_hw_watchpoint.
-       * target.h (struct target_ops): Delete 
-       to_region_size_ok_for_hw_watchpoint.
-       (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT): Delete.
+       * async-nat-inferior.c, async-nat-inferior.h,
+       * async-nat-sigthread.c, async-nat-sigthread.h: New files
        
-2006-02-08  Ben Elliston  <bje@au1.ibm.com>
-           Wu Zhou  <woodzltc@cn.ibm.com>
-
-       * ppc-linux-nat.c (PTRACE_GET_DEBUGREG, PTRACE_SET_DEBUGREG,
-       PTRACE_GETSIGINFO): Define.
-       (last_stopped_data_address): New.
-       (ppc_linux_check_watch_resources): New function.
-       (ppc_linux_region_ok_for_hw_watchpoint): New function.
-       (ppc_linux_insert_watchpoint): New function.
-       (ppc_linux_remove_watchpoint): New function.
-       (ppc_linux_stopped_data_address): New function.
-       (ppc_linux_stopped_by_watchpoint): New function.
-       (_initialize_ppc_linux_nat): Set the above hardware watchpoint
-       related target vectors.
-       * rs6000-tdep.c (rs6000_gdbarch_init): Set PPC architectures
-       to have nonsteppable watchpoint.
-       * target.c (default_region_ok_for_hw_watchpoint,
-       debug_to_region_ok_for_hw_watchpoint): New prototypes.
-       (update_current_target): Inherit to_region_ok_for_hw_watchpoint
-       and set default to_region_ok_for_hw_watchpoint.
-       (default_region_ok_for_hw_watchpoint): New function.
-       (debug_to_region_ok_for_hw_watchpoint): New function.
-       (setup_target_debug): Set to_region_ok_for_hw_watchpoint of 
-       debug_target.
-       * target.h (struct target_ops): Add a new target vector 
-       to_region_ok_for_hw_watchpoint.
-       (TARGET_REGION_OK_FOR_HW_WATCHPOINT): Define this if it is not
-       defined anyplace else.
-
-2005-02-07  Joel Brobecker  <brobecker@adacore.com>
-       * symfile.c (add_symbol_file_command): Abort if the user forgot
-       to provide the address when the file has been loaded.
-
-2006-02-07  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * MAINTAINERS: Update file based on maintainers survey.  Add
-       a note to Past Maintainers.  Move unresponsive or inactive
-       maintainers to Authorized Committers or Past Maintainers as
-       appropriate.  Correct Jim Kingdon's email address.  Remove
-       vacant areas of responsibility.
-
-2006-02-06  Vladimir Prus  <ghost@cs.msu.su>
-
-       * breakpoint.c (print_one_breakpoint): For MI-like UI, output
-       fullname field.
-
-2006-02-03  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * exceptions.h (enum errors): Rename NO_ERROR to GDB_NO_ERROR.
-       * exceptions.c (exception_none, exceptions_state_mc_init)
-       (throw_vfatal): Use GDB_NO_ERROR.
-
-2006-02-02  Mark Kettenis  <kettenis@gnu.org>
-
-       * solib-svr4.h (struct link_map_offsets): Remove r_debug_size and
-       r_map_size members.  Add r_version_offset, r_version_size and
-       r_ldsomap_offset members.
-       * solib-svr4.c (solib_svr4_r_map): Renamed from
-       fetch_link_map_member.  Simplify using read_memory_typed_address.
-       (solib_svr4_r_ldsomap): New function.
-       (open_symbol_file_object): Use solib_svr_r_map.
-       (svr4_current_sos): Use solib_svr4_r_map and look for the dynamic
-       linker by using solib_svr4_r_ldsomap.
-       (svr4_ilp32_fetch_link_map_offsets)
-       (svr4_lp64_fetch_link_map_offsets): Adjust for changes to `struct
-       link_map_offsets'.
-       * solib-legacy.c (legacy_svr4_fetch_link_map_offsets): Adjust for
-       changes to `struct link_map_offsets'.
-       * mipsnbsd-tdep.c (mipsnbsd_ilp32_fetch_link_map_offsets)
-       (mipsnbsd_lp64_fetch_link_map_offsets): Adjust for changes to
-       `struct link_map_offsets'.
-
-2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * linux-nat.c (struct saved_ptids, threads_to_delete)
-       (record_dead_thread, prune_lwps, find_thread_from_lwp)
-       (exit_lwp): New.
-       (linux_nat_resume): Call prune_lwps.
-       (wait_lwp, linux_nat_wait): Call exit_lwp.
-
-2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * printcmd.c (printf_command): Make format string checking
-       stricter.  Add separate cases for long_arg, ptr_arg, and
-       long_double_arg.
-       * utils.c (xstrvprintf): Improve the error message issued
-       for a bad format string.
-       * Makefile.in (GDB_WARN_CFLAGS_NO_FORMAT, INTERNAL_CFLAGS_BASE):
-       New variables.
-       (gnu-v3-abi.o, monitor.o, procfs.o, linux-thread-db.o): Remove
-       $(NO_WERROR_CFLAGS).
-       (printcmd.o): Likewise.  Use $(GDB_WARN_CFLAGS_NO_FORMAT) and
-       enable -Werror.
-
-2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * Makefile.in (remote.o): Update.
-       * remote.c (show_packet_config_cmd): Shorten messages.
-       (remote_set_cmdlist, remote_show_cmdlist): Make file-static.
-       (show_remote_cmd): Iterate.
-       (_initialize_remote): Remove remote_set_cmdlist,
-       remote_show_cmdlist.
-
-2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * Makefile.in (gdbtypes_h, gdbtypes.o, utils.o): Update.
-       * defs.h (hashtab_obstack_allocate, dummy_obstack_deallocate): Add
-       prototypes.
-       * dwarf2read.c (read_subroutine_type): Use TYPE_ZALLOC.
-       (hashtab_obstack_allocate, dummy_obstack_deallocate): Moved to...
-       * utils.c (hashtab_obstack_allocate, dummy_obstack_deallocate):
-       ...here.
-       * gdbtypes.c: Include "hashtab.h".
-       (build_gdbtypes): Remove extra prototype.
-       (struct type_pair, type_pair_hash, type_pair_eq)
-       (create_copied_types_hash, copy_type_recursive): New.
-       * gdbtypes.h: Include "hashtab.h".
-       (TYPE_ZALLOC): New.
-       (create_copied_types_hash, copy_type_recursive): New prototypes.
-       * objfiles.c (free_objfile): Call preserve_values.
-       * symfile.c (reread_symbols): Likewise.
-       (clear_symtab_users): Remove calls to clear_value_history and
-       clear_internalvars.
-       * value.c (clear_value_history, clear_internalvars): Removed.
-       (preserve_one_value, preserve_values): New functions.
-       * value.h (clear_value_history, clear_internalvars): Removed.
-       (preserve_values): New prototype.
-
-       * tracepoint.c (_initialize_tracepoint): Do not initialize convenience
-       variables here.
-
-2006-01-29  Mark Kettenis  <kettenis@gnu.org>
-
-       * amd64-tdep.c (amd64_classify): Handle TYPE_CODE_BOOL.
-       Fixes PR tdep/2075.
-
-2006-01-27  Joel Brobecker  <brobecker@adacore.com>
-
-       * MAINTAINERS: Use a consistent email address for brobecker.
-
-2006-01-27  Joel Brobecker  <brobecker@adacore.com>
-
-       * infcmd.c (post_create_inferior): Fix copy/paste error introduced
-       in the previous change.
-
-2006-01-24  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       PR gdb/1914
-       * fork-child.c (fork_inferior): Don't call
-       solib_create_inferior_hook.
-       * infcmd.c (post_create_inferior): Call solib_add,
-       solib_create_inferior_hook, and re_enable_breakpoints_in_shlibs.
-       (attach_command): Don't call solib_add or
-       re_enable_breakpoints_in_shlibs.  Call post_create_inferior
-       instead.
-       * remote.c (remote_open_1): Don't call solib_create_inferior_hook
-       or observer_notify_inferior_created.  Call post_create_inferior
-       instead.
-       * corelow.c: Don't include "observer.h".
-       (solib_add_stub): Deleted.
-       (core_open): Don't call observer_notify_inferior_created or
-       solib_add_stub.  Call post_create_inferior instead.
-       * inf-ptrace.c: Don't include "observer.h".
-       (inf_ptrace_attach): Don't call observer_notify_inferior_created.
-       * inf-ttrace.c: Don't include "observer.h".
-       (inf_ttrace_attach): Don't call observer_notify_inferior_created.
-       * inferior.h (solib_create_inferior_hook): Remove redundant
-       prototype.
-       * inftarg.c: Don't include "observer.h".
-       (child_attach): Don't call observer_notify_inferior_created.
-       * Makefile.in: Update dependencies.
-
-2006-01-24  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * infcmd.c: Include "observer.h".
-       (post_create_inferior): New function.
-       (run_command_1): Call it.  Also call proceed.
-       * inferior.h (post_create_inferior): New prototype.
-       * Makefile.in (infcmd.o): Update.
-
-       * gnu-nat.c (gnu_create_inferior): Don't call proceed.
-       * go32-nat.c (go32_create_inferior): Likewise.
-       * nto-procfs.c (procfs_create_inferior): Likewise.
-       * procfs.c (procfs_create_inferior): Likewise.
-       * remote-sim.c (gdbsim_create_inferior): Likewise.
-       * remote.c (extended_remote_create_inferior)
-       (extended_remote_async_create_inferior): Likewise.
-       * win32-nat.c (win32_create_inferior): Likewise.
-       * wince.c (child_create_inferior): Likewise.
-
-       * monitor.c (monitor_create_inferior): Don't call proceed.
-       Set the PC manually.
-       * ocd.c (ocd_create_inferior): Likewise.
-       * remote-e7000.c (e7000_create_inferior): Likewise.
-       * remote-m32r-sdi.c (m32r_create_inferior): Likewise.
-       * remote-mips.c (mips_create_inferior): Likewise.
-       * remote-rdp.c (remote_rdp_create_inferior): Likewise.
-       * remote-sds.c (sds_create_inferior): Likewise.
-       * remote-st.c (st2000_create_inferior): Likewise.
-
-       * inf-ptrace.c (inf_ptrace_create_inferior): Don't call
-       proceed or observer_notify_inferior_created.
-       * inf-ttrace.c (inf_ttrace_create_inferior): Likewise.
-       * inftarg.c (child_create_inferior): Likewise.
-
-2006-01-24  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * linux-thread-db.c (thread_db_mourn_inferior): Remove breakpoints
-       after mourning the inferior.
-
-2006-01-24  Jim Blandy  <jimb@redhat.com>
-
-       * valarith.c (binop_user_defined_p): Handle refs to typedefs.
-
-2006-01-24  Fred Fish  <fnf@specifix.com>
-
-       * parse.c (source.h): Include.
-       (parse_exp_in_context):  Use static source context if no
-       other context found.
-
-2006-01-23  Andrew Stubbs  <andrew.stubbs@st.com>
-
-       * sh-tdep.c: Include reggroups.h.
-       (sh_register_reggroup_p): New function.
-       (sh_gdbarch_init): Add call to set_gdbarch_register_reggroup_p.
-       * Makefile.in (sh-tdep.o): Add dependency on reggroups.h.
-
-2006-01-23  Andrew Stubbs  <andrew.stubbs@st.com>
-
-       * cli/cli-cmds.c: Include fcntl.h.
-       (source_command): Use the GDB search path to find script files.
-
-2006-01-22  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       PR tdep/2029
-       Suggested by Till Straumann <strauman@slac.stanford.edu>:
-       * rs6000-tdep.c (skip_prologue): Update check for later mtlr
-       instructions.  Handle PIC bcl.
-
-2006-01-22  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * config/djgpp/README: Typo fix.
-       * config/djgpp/fnchange.lst: Update.
+       * linux-nat.c: Include async-nat-inferior.h.
+       (linux_nat_wait): Add extra argument.  If target_can_async_p
+       do something completely different.
 
-2006-01-22  Mark Kettenis  <kettenis@gnu.org>
+       * interps.h (interp_set, interp_set_quiet): New externs.
 
-       * sparc-tdep.h (struct gdbarch_tdep): Add step_trap member.
-       (sparc_address_from_register): New prototype.
-       (sparcnbsd_step_trap): New prototype.
-       * sparc-tdep.c (sparc_address_from_register): Make globally
-       visible.
-       (sparc_analyze_control_transfer): Change prototype to accept
-       `struct gdbarch *' as first argument.  Allow for optional hnadling
-       for trap instructions.
-       (sparc_step_trap): New function.
-       (sparc_software_single_step): Adjust call to
-       sparc_analyze_control_trabsfer.
-       (sparc32_gdbarch_init): Initialize TDEP->step_trap.
-       * sparcnbsd-tdep.c (sparcnbsd_step_trap): New function.
-       (sparc32nbsd_init_abi): Set TDEP->step_trap.
-       * sparc64obsd-tdep.c (sparc64obsd_init_abi): Set TDEP->step_trap.
-       * sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Set TDEP->step_trap.
+       * interps.c (interp_set): Make asynchronous.
+       (interp_set_quiet): Don't make static.
+       (current_interp_command_loop): Call functions with new arguments.
 
-       * sparc-tdep.c (sparc32_return_value): Convert to use
-       RETURN_VALUE_ABI_PRESERVES_ADDRESS instead of
-       RETURN_VALUE_STRUCT_CONVENTION.
-       (sparc32_extract_struct_value_address): Remove.
+       * target.h (target_wait): Add extra argument.
+       (gdb_override_async, gdb_set_async_override) New externs.
+       (target_can_async_p): Make conditional on gdb_override_async.
 
-2006-01-21  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * avr-tdep.c (avr_address_to_pointer, avr_pointer_to_address)
-       (avr_extract_return_value, avr_frame_prev_register): Use gdb_byte.
-
-2006-01-21  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * solib.c (info_sharedlibrary_command): Avoid internal_error.
-
-2006-01-21  Mark Kettenis  <kettenis@gnu.org>
-
-       * i386-tdep.c (i386_mxcsr_type): New variable.
-       (i386_init_types): Initialize i386_mxcsr_type.
-       (i386_register_type): Return i386_mxcsr_type for %mxcsr.
-       * i386-tdep.c (i386_mxcsr_type): New extern.
-       * amd64-tdep.c (amd64_register_info): Return i386_mxcsr_type for
-       %mxcsr.
-
-2006-01-20  Mark Mitchell  <mark@codesourcery.com>
-
-       * Makefile.in (remote-rdi.o): Remove.
-       (rdi-share/libangsd.a): Likewise.
-       * README: Don't mention remote-rdi.c.
-       * NEWS: Mention removal of rdi-share.
-       * configure.ac: Don't configure rdi-share subdirectory.
-       * remote-rdi.c: Remove.
-       * config/arm/embed.mt (TDEPFILES): Remove remote-rdi.o.
-       (TDEPLIBS): Remove rdi-share/libangsd.a.
-       * rdi-share/Makefile.am: Remove.
-       * rdi-share/Makefile.in: Likewise.
-       * rdi-share/README.CYGNUS: Likewise.
-       * rdi-share/aclocal.m4: Likewise.
-       * rdi-share/adp.h: Likewise.
-       * rdi-share/adperr.h: Likewise.
-       * rdi-share/angel.h: Likewise.
-       * rdi-share/angel_bytesex.c: Likewise.
-       * rdi-share/angel_bytesex.h: Likewise.
-       * rdi-share/angel_endian.h: Likewise.
-       * rdi-share/ardi.c: Likewise.
-       * rdi-share/ardi.h: Likewise.
-       * rdi-share/armdbg.h: Likewise.
-       * rdi-share/buffers.h: Likewise.
-       * rdi-share/chandefs.h: Likewise.
-       * rdi-share/channels.h: Likewise.
-       * rdi-share/chanpriv.h: Likewise.
-       * rdi-share/configure: Likewise.
-       * rdi-share/configure.in: Likewise.
-       * rdi-share/crc.c: Likewise.
-       * rdi-share/crc.h: Likewise.
-       * rdi-share/dbg_conf.h: Likewise.
-       * rdi-share/dbg_cp.h: Likewise.
-       * rdi-share/dbg_hif.h: Likewise.
-       * rdi-share/dbg_rdi.h: Likewise.
-       * rdi-share/devclnt.h: Likewise.
-       * rdi-share/devices.h: Likewise.
-       * rdi-share/devsw.c: Likewise.
-       * rdi-share/devsw.h: Likewise.
-       * rdi-share/drivers.c: Likewise.
-       * rdi-share/drivers.h: Likewise.
-       * rdi-share/etherdrv.c: Likewise.
-       * rdi-share/ethernet.h: Likewise.
-       * rdi-share/host.h: Likewise.
-       * rdi-share/hostchan.c: Likewise.
-       * rdi-share/hostchan.h: Likewise.
-       * rdi-share/hsys.c: Likewise.
-       * rdi-share/hsys.h: Likewise.
-       * rdi-share/logging.c: Likewise.
-       * rdi-share/logging.h: Likewise.
-       * rdi-share/msgbuild.c: Likewise.
-       * rdi-share/msgbuild.h: Likewise.
-       * rdi-share/params.c: Likewise.
-       * rdi-share/params.h: Likewise.
-       * rdi-share/rx.c: Likewise.
-       * rdi-share/rxtx.h: Likewise.
-       * rdi-share/serdrv.c: Likewise.
-       * rdi-share/serpardr.c: Likewise.
-       * rdi-share/sys.h: Likewise.
-       * rdi-share/tx.c: Likewise.
-       * rdi-share/unixcomm.c: Likewise.
-       * rdi-share/unixcomm.h: Likewise.
-
-2006-01-21  Mark Kettenis  <kettenis@gnu.org>
-
-       * hppa-linux-tdep.c (hppa_linux_sigtramp_frame_prev_register):
-       Change type of last argument to `gdb_byte *'.
-
-2006-01-20  Mark Kettenis  <kettenis@gnu.org>
-
-       * hppa-tdep.h (hppa_in_solib_call_trampoline)
-       (hppa_skip_trampoline_code): New prototypes.
-       * hppa-tdep.c (struct insn_pattern): New.
-       (hppa_long_branch_stub, hppa_long_branch_pic_stub)
-       (hppa_import_stub, hppa_import_pic_stub, hppa_plt_stub): Moved
-       here from hppa-linux-tdep.c
-       (HPPA_MAX_INSN_PATTERN_LEN): New define.
-       (hppa_match_insns, hppa_match_insns_relaxed, hppa_in_dyncall)
-       (hppa_in_solib_call_trampoline, hppa_skip_trampoline_code): New
-       functions based on functions removed from hppa-linux-tdep.c.
-       * hppa-linux-tdep.c (hppa_long_branch_stub)
-       (hppa_long_branch_pic_stub, hppa_import_stub)
-       (hppa_import_pic_stub, hppa_plt_stub): Moved to hppa-tdep.c.
-       (insns_match_pattern_relaxed, hppa_linux_in_dyncall)
-       (hppa_linux_in_solib_call_trampoline)
-       (hppa_linux_skip_trampoline_code): Removed.
-       (hppa_linux_init_abi): Set TDEP->in_solib_call_tranpoline to
-       hppa_in_solib_call_trampoline and skip_trampoline_code to
-       hppa_skip_trampoline_code.
-       * hppabsd-tdep.c (hppabsd_init_abi): Set
-       TDEP->in_solib_call_trampoline and skip_trampoline_code.
-
-2006-01-20  Jim Blandy  <jimb@redhat.com>
-
-       * MAINTAINERS: Change my E-mail address.
-
-       * configure.ac: Add -Wno-pointer-sign to list of build warnings.
-       * configure: Regenerated.
-
-2006-01-20  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * MAINTAINERS: Overhaul.
-
-2006-01-18  Mark Kettenis  <kettenis@gnu.org>
-
-       Based on a previous patch form Michal Ludvig:
-       * amd64-tdep.c (amd64_sse_type): Remove.
-       (amd64_register_info): Use i386_eflags_type and i386_sse_type
-       where appropriate.
-       (AMD64_NUM_REGS): Use ARRAY_SIZE.
-       (amd64_register_type): Remove code to build amd_sse_type.
-       * i386-tdep.c (i386_eflag_type): New variable.
-       (i386_mmx_type, i386_sse_type): Make global.
-       (i386_init_types): New function.
-       (i386_build_mmx_type, i386_build_sse_type): Remove functions.
-       (i386_register_type): Return i386_eflag_type, i386_sse_type and
-       i386_mmx_type when appropriate.
-       (_initialize_i386_tdep): Call i386_init_types.
-       * i386-tdep.h (i386_eflags_type, i386_mmx_type, i386_sse_type):
-       Declare extern.
-
-       Based on a previous patch form Michal Ludvig:
-       * gdbtypes.c (append_flags_type_flag, init_flags_type): New
-       functions.
-       (is_integral_type, rank_one_type, recursive_dump_type): Add
-       support for TYPE_CODE_FLAGS.
-       * gdbtypes.h (enum type_code): Add TYPE_CODE_FLAGS.
-       (append_flags_type_field, init_flags_type): New prototypes.
-       * ada-valprint.c (ada_val_print_1): Add support for
-       TYPE_CODE_FLAGS.
-       * c-valprint.c (c_val_print): Likewise.
-       * f-valprint.c (f_val_print): Likewise.
-       * p-valprint.c (pascal_val_print): Likewise.
-       * valprint.c (val_print_type_code_flags): New function.
-       * valprint.h (val_print_type_code_flags): New prototype.
-       * value.c (unpack_long, value_from_longest): Add support for
-       TYPE_CODE_FLAGS.
-
-2006-01-17  Christopher Faylor  <cgf@timesys.com>
-
-       * MAINTAINERS: Very belatedly remove myself from from the list of
-       people caught up in the paper trail.
-
-2006-01-17  Jim Blandy  <jimb@redhat.com>
-
-       * symtab.h (struct general_symbol_info): Use gdb_byte for
-       value.bytes.
-       * stabsread.c (define_symbol): Use gdb_byte for the buffer holding
-       a floating-point constant's value.
-       * dwarf2read.c (dwarf2_const_value): Remove casts of value buffer
-       to char *.
-       * findvar.c (read_var_value): Eliminate needless temporary.
-
-       * dwarf2-frame.c (dwarf2_read_section): Update forward declaration
-       to match prior change to dwarf2_read_section's type.
-
-2006-01-16  Paul Gilliam  <pgilliam@us.ibm.com>
-
-       * ppc-tdep.h (PPC_MAX_EPILOGUE_INSTRUCTIONS): New define.
-       * rs6000-tdep.c (insn_changes_sp_or_jumps)
-       (rs6000_in_function_epilogue_p): New functions.
-       (rs6000_gdbarch_init): Set in_function_epilogue_p.
-
-2006-01-17  Jim Blandy  <jimb@redhat.com>
-
-       * dwarf2read.c (struct dwarf2_per_objfile, struct comp_unit_head)
-       (struct line_header, struct partial_die_info, struct dwarf_block):
-       Use gdb_byte for members that refer to Dwarf section contents.
-       (dwarf2_read_abbrevs, dwarf2_read_section, dwarf_decode_lines,
-       dwarf_decode_macros, load_comp_unit, load_partial_dies,
-       locate_pdi_sibling, partial_read_comp_unit_head, peek_die_abbrev,
-       read_1_byte, read_1_signed_byte, read_2_bytes, read_4_bytes,
-       read_8_bytes, read_address, read_attribute, read_attribute_value,
-       read_comp_unit, read_comp_unit_head, read_die_and_children,
-       read_die_and_siblings, read_full_die, read_indirect_string,
-       read_initial_length, read_n_bytes, read_offset, read_partial_die,
-       read_signed_leb128, read_string, read_unsigned_leb128,
-       skip_children, skip_leb128, skip_one_die): Same.
-
-2006-01-17  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * complaints.c (stop_whining): Make signed.
-       * linux-thread-db.c (thread_db_store_registers): Use gdb_byte.
-
-2006-01-17  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * dwarf2read.c, remote-fileio.c, remote.h: Update copyright
-       notices.
-
-2006-01-17  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * dwarf2read.c (peek_die_abbrev, read_address, read_initial_length)
-       (read_offset): Change BYTES_READ argument to unsigned int.
-       (dwarf2_build_psymtabs_easy, read_comp_unit_head)
-       (create_all_comp_units, dwarf2_get_pc_bounds)
-       (dwarf_decode_line_header, var_decode_location)
-       (dwarf_decode_macros): Change local BYTES_READ variables to
-       unsigned int.
-       (read_indirect_string): Remove obsolete cast.
-
-2006-01-17  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * remote-fileio.c (remote_fileio_return_success): Take a gdb_byte
-       argument.
-       (remote_fileio_func_open, remote_fileio_func_rename)
-       (remote_fileio_func_unlink, remote_fileio_func_stat)
-       (remote_fileio_func_fstat, remote_fileio_func_gettimeofday)
-       (remote_fileio_func_system): Cast the arguments to
-       remote_read_bytes and remote_write_bytes.
-       (remote_fileio_func_read, remote_fileio_func_write): Use a
-       gdb_byte buffer.
-       * remote.h (remote_read_bytes, remote_write_bytes): Update
-       prototypes.
-       * remote.c (hex2bin, bin2hex): Use gdb_byte for the BIN argument.
-       (threadref_to_int): Replace bogus char * cast.
-       (remote_unpack_thread_info_response): Use int for tag.
-       (remote_threads_extra_info, remote_check_symbols): Cast string
-       arguments to hex2bin.
-       (remote_wait): Use a char buffer for packets and a gdb_byte
-       buffer for registers.
-       (remote_async_wait): Likewise.
-       (remote_prepare_to_store, store_register_using_P)
-       (remote_store_registers): Use gdb_byte buffers.
-       (remote_write_bytes, remote_read_bytes): Use a gdb_byte pointer
-       for MYADDR and char buffers for strings.
-       (remote_xfer_partial): Add casts for string operations on READBUF.
-       (remote_rcmd): Cast strings passed to bin2hex.
-
-2006-01-16  Mark Mitchell  <mark@codesourcery.com>
-
-       * aclocal.m4: Regenerate.
-
-2006-01-16  Nathan Sidwell  <nathan@codesourcery.com>
-
-       * mt-tdep.c (enum mt_gdb_regnums): Add MT_COPRO_PSEUDOREG_ARRAY,
-       MT_COPRO_PSEUDOREG_DIM_1, MT_COPRO_PSEUDOREG_DIM_2,
-       MT_COPRO_PSEUDOREG_REGS members.  Adjust MT_NUM_PSEUDO_REGS.
-       (mt_register_name): Lazily synthesize name for coprocessor pseudo
-       array registers.
-       (mt_copro_register_type): New. Broken out of ...
-       (mt_register_type): ... here.  Use it.  Deal with coprocessor
-       pseudo array.
-       (mt_select_coprocessor): New.
-       (mt_pseudo_register_read, mt_pseudo_register_write): Deal with
-       coprocessor pseudo array.
-
-2006-01-16  Andrew Stubbs  <andrew.stubbs@st.com>
-
-       * breakpoint.c (insert_breakpoints): Check that a thread exists
-       before inserting thread specific breakpoints.
-
-2006-01-15  Mark Kettenis  <kettenis@gnu.org>
-
-       * osabi.c (generic_elf_osabi_sniffer): Fix typo in previous
-       commit.
-
-       * alpha-tdep.c (alpha_gdbarch_init): Set cannot_step_breakpoint.
-       * config/alpha/nm-osf.h (CANNOT_STEP_BREAKPOINT): Remove.
-       * config/alpha/nm-linux.h (CANNOT_STEP_BREAKPOINT): Remove.
-       * config/alpha/nm-nbsd.h: Remove file.
-       * config/alpha/nm-fbsd.h: Remove file
-       * config/alpha/nbsd.mh (NAT_FILE): Remove.
-       * config/alpha/fbsd.mh (NAT_FILE): Remove.
-
-2006-01-15  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * macroexp.c (expand): Initialize argc.
-       * stabsread.c (read_type): Handle errors from read_args.
-       (read_args): Return NULL for errors.
-
-2006-01-15  Mark Kettenis  <kettenis@gnu.org>
-
-       * osabi.c (generic_elf_osabi_sniffer): Use memcmp instead of
-       strcmp to compare string to a byte buffer.
-
-2006-01-15  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * printcmd.c (output_command): Always initialize fmt.size.
-       (printf_command): Use gdb_byte.
-       * symfile.c (separate_debug_file_exists): Use gdb_byte.
-       (load_section_callback, read_target_long_array): Likewise.
-       (simple_read_overlay_table, simple_read_overlay_region_table)
-       (simple_overlay_update_1): Correct calls to read_target_long_array.
-       * valprint.c (partial_memory_read): Change MYADDR to a gdb_byte *.
-       Also change local pointers.
-       (val_print_string): Use gdb_byte.
-
-2006-01-15  Mark Kettenis  <kettenis@gnu.org>
-
-       * alphafbsd-tdep.c: Include "solib-svr4.h".
-       (alphafbsd_init_abi): Set solib_svr4_fetch_link_map_offsets to
-       svr4_lp64_fetch_link_map_offsets.
-       * Makefile.in (alphafbsd-tdep.o): Update dependencies.
-       * config/alpha/fbsd.mt (TDEPFILES): Add corelow.o, solib.o and
-       solib-svr4.o.
-       * config/alpha/fbsd.mh (NATDEPFILES): Remove solib.o, solib-svr4.o
-       and solib-legacy.o.
-       * config/alpha/nm-fbsd.h: Don't include "solib.h".
-
-2006-01-15  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * source.c (_initialize_source): Use add_setshow_integer_cmd.
-
-2006-01-15  Daniel Jacobowitz  <dan@codesourcery.com>
-
-       * linux-fork.c (delete_fork_command, detach_fork_command): Use
-       PIDGET.
-
-2006-01-15  Mark Kettenis  <kettenis@gnu.org>
-
-       * arm-linux-tdep.c (arm_linux_svr4_fetch_link_map_offsets):
-       Remove.
-       (arm_linux_init_abi): Set solib_svr4_fetch_link_map_offsets to
-       svr4_ilp32_fetch_link_map_offsets.
-       * cris-tdep.c (cris_linux_svr4_fetch_link_map_offsets): Remove
-       function.
-       (cris_gdbarch_init): Set solib_svr4_fetch_link_map_offsets to
-       svr4_ilp32_fetch_link_map_offsets.
-       * mips-linux-tdep.c (mips_linux_svr4_fetch_link_map_offsets)
-       (mips64_linux_svr4_fetch_link_map_offsets): Remove functions.
-       (mips_linux_init_abi): Set solib_svr4_fetch_link_map_offsets to
-       svr4_ilp32_fetch_link_map_offsets or svr4_lp64_fetch_link_map_offsets
-       where appropriate.
-       * nbsd-tdep.c (nbsd_ilp32_solib_svr4_fetch_link_map_offsets):
-       Simply call svr4_ilp32_fetch_link_map_offsets.
-       (nbsd_lp64_solib_svr4_fetch_link_map_offsets): Simply call
-       svr4_lp64_fetch_link_map_offsets.
-       * ppc-linux-tdep.c (ppc_linux_svr4_fetch_link_map_offsets): Remove
-       function.
-       (ppc_linux_init_abi): Set solib_svr4_fetch_link_map_offsets to
-       svr4_ilp32_fetch_link_map_offsets.
-       * s390-tdep.c (s390_svr4_fetch_link_map_offsets)
-       (s390x_svr4_fetch_link_map_offsets): Remove functions.
-       (s390_gdbarch_init): Set solib_svr4_fetch_link_map_offsets to
-       svr4_ilp32_fetch_link_map_offsets or svr4_lp64_fetch_link_map_offsets
-       where appropriate.
-
-2006-01-15  Mark Kettenis  <kettenis@gnu.org>
-
-       * arm-tdep.c (arm_return_value): Change type of readbuf and
-       writebuf arguments to `gdb_byte *'.
-
-       * s390-tdep.c: Do not include "tm.h" and "../bfd/bfd.h".
-       * Makefile.in (s390-tdep.o): Update dependencies.
-
-2006-01-14  Mark Kettenis  <kettenis@gnu.org>
-
-       * sol2-tdep.h. sol2-tdep.c: New files.
-       * amd64-sol2-tdep.c: Include "sol2-tdep.h".
-       (amd64_sol2_init_abi): Set skip_solib_resolver.
-       * i386-sol2-tdep.c: Include "sol2-tdep.h".
-       (i386_sol2_init_abi): Set skip_solib_resolver.
-       * sparc-sol2-tdep.c: Include "sol2-tdep.h".
-       (sparc32_sol2_init_abi): Set skip_solib_resolver.
-       * sparc64-sol2-tdep.c: Include "sol2-tdep.h".
-       (sparc64_sol2_init_abi): Set skip_solib_resolver.
-       * Makefile.in (sol2_tdep_h): New variable.
-       (ALLDEPFILES): Add sol2-tdep.c.
-       (sol2-tdep.o): New target.
-       (amd64-sol2-tdep.o, i386-sol2-tdep.o, sparc-sol2-tdep.o)
-       (sparc64-sol2-tdep.o): Update dependencies
-       * config/i386/i386sol2.mt (TDEPFILES): Add sol2-tdep.o.
-       * config/i386/sol2-64.mt (TDEPFILES): Add sol2-tdep.o.
-       * config/sparc/sol2.mt (TDEPFILES): Add sol2-tdep.o.
-       * config/sparc/sol2-64.mt (TDEPFILES): Add sol2-tdep.o.
-
-       * hppa-linux-tdep.c: Fix copyright indentation.
-
-       * hppa-tdep.h (enum hppa_regnum): Add HPPA_FP31R_REGNUM.
-       * hppabsd-nat.c (hppabsd_fpregset_supplies_p)
-       (hppabsd_supply_fpregset, hppabsd_collect_fpregset): New
-       functions.
-       (hppabsd_fetch_registers, hppabsd_store_registers): Handle
-       floating-point registers.
-
-2006-01-13  Mark Mitchell  <mark@codesourcery.com>
-
-       * event-loop.c (gdb_select): Detect file descriptors that have
-       been closed.
-
-2006-01-13  Mark Kettenis  <kettenis@gnu.org>
-
-       * hppabsd-tdep.c (hppabsd_init_abi): Set long_double_bit to 64,
-       and long_double_format accordingly.
-
-2006-01-12  Paul N. Hilfinger <hilfinger@adacore.com>
-
-       * ada-exp.y (yyerror): Change message to ignore the argument, avoiding
-       translation problems.
-       * ada-lang.c (ada_value_struct_elt): Change interface and handling
-       of errors to avoid translation problem (and less than optimal error
-       messages).
-       (ada_value_tag, ada_tag_name_1, ada_tag_name_2, ada_evaluate_subexp):
-       Use new interface to ada_value_struct_elt.
-       * ada_lang.h (ada_value_struct_elt): Update declaration to new 
-       interface.
-       
-       * ChangeLog: remove reference to ada-tasks.c from entry of
-       2006-01-07.
-       
-2006-01-11  Mark Kettenis  <kettenis@gnu.org>
-
-       * remote.c (get_memory_packet_size, set_thread) 
-       (remote_unpack_thread_info_response, remote_get_threadinfo) 
-       (parse_threadlist_response, remote_get_threadlist) 
-       (remote_current_thread, remote_threads_info) 
-       (remote_threads_extra_info, extended_remote_restart, get_offsets) 
-       (remote_check_symbols, remote_open_1, remote_detach) 
-       (remote_async_wait, remote_fetch_registers) 
-       (remote_store_registers, check_binary_download, putpkt_binary) 
-       (remote_insert_breakpoint, remote_insert_watchpoint) 
-       (remote_remove_watchpoint, remote_insert_hw_breakpoint) 
-       (remote_remove_hw_breakpoint, remote_xfer_partial, remote_rcmd) 
-       (packet_command): Remove redundant parenthesis.
-
-2006-01-10  Mark Kettenis  <kettenis@gnu.org>
-
-       * corefile.c (read_memory_integer, read_memory_unsigned_integer)
-       (read_memory_typed_address, write_memory)
-       (write_memory_unsigned_integer, write_memory_signed_integer): Use
-       gdb_byte where appropriate.
-
-       * mi/mi-main.c (mi_cmd_data_read_memory): Change type of mbus into
-       'gdb_byte *'.
-
-       * target.h (target_read_memory_partial, target_write_memory_partial):
-       Change second argument to 'gdb_byte *'.
-       * target.c (target_xfer_memory_partial): Change third argument to
-       'gdb_byte *'.
-       (target_read_memory_partial, target_write_memory_partial): Change
-       second argument to 'gdb_byte *'.
-
-       * linespec.c (decode_objc): Make i1 and i2 unsigned.
-       (find_method): Set values.sals to NULL.
-
-2006-01-09  Mark Kettenis  <kettenis@gnu.org>
-
-       * amd64obsd-nat.c (amd64obsd_supply_pcb): Use 'gdb_byte *' instead
-       of 'char *' in cast.
-
-2006-01-07  Paul N. Hilfinger <hilfinger@adacore.com>
-
-       * ada-exp.y, ada-lex.l, ada-typeprint.c: I18n markup.
-       * ada-lang.c: I18n markup.  
-       Editorial: change "can not" => "cannot" throughout.
-
-2006-01-07  Mark Kettenis  <kettenis@gnu.org>
-
-       * Makefile.in: Sort dependencies.
-
-2006-01-07  Eli Zaretskii  <eliz@gnu.org>
-
-       * top.c (control_level): Remove unused variable.
-
-2006-01-06  Fred Fish  <fnf@specifix.com>
-
-       * objfiles.c (source.h): Include.
-       (free_objfile): Update comment about clear_symtab_users().
-       (free_objfile): Check all symtabs of objfile being freed and if
-       one of them is the current source symtab, call
-       clear_current_source_symtab_and_line().
-
-2006-01-04  Michael Snyder  <msnyder@redhat.com>
-
-       Checkpoint/Restart for Linux.
-       * linux-nat.c: Add support for debugging multiple forks.
-       Add #include for linux-fork.h (interface spec).
-       (super_mourn_inferior): New function pointer.
-       (child_mourn_inferior): New function / target method.
-       (linux_target): Claim to_mourn_inferior method pointer.
-       (child_follow_fork): Call interface to linux-fork, conditionally
-       add new fork processes to list of debugged processes.
-       (kill_inferior): Use interface to linux-fork to kill
-       multiple processes.
-
-       * linux-fork.h: New file.
-       * linux-fork.c: New file.  Support for debugging multiple forks
-       of the same program.  Support for checkpoint and restart commands.
-
-       * infrun.c (nullify_last_target_wait_ptid): New function.
-
-       * Makefile.in: Add linux-fork.
-       * config/*/linux.mh: Add linux-fork.
-       * NEWS: Mention new functionality.
-
-2006-01-02  Paul Hilfinger  <hilfingr@nile.gnat.com>
-
-       * ada-exp.y (syntax definitions,write_var_or_type,write_name_assoc): 
-       Change uses of "illegal" to "invalid".
-       
-2006-01-02  Paul N. Hilfinger  <hilfinger@adacore.com>
-
-       * ada-exp.y: Considerable reorganization to move functionality
-       from ada-lex.l to here, where it is logically more appropriate.
-       The original reason, however, was to prevent premature name
-       lookups for selector names in record aggregates.
-       (BLOCKNAME, TYPENAME, OBJECT_RENAMING): Remove; lexer now returns
-       NAME for all of these.
-       (VAR): New artificial token to clarify precedence rules.
-       (OTHERS): New lexeme.
-       (empty_stoken): New symbol.
-       (%union): Remove ssym, voidval.
-       (%type): Remove <voidval> type declarations.
-       (syntax definitions): Add aggregates.
-       Remove distinction between NAME, TYPENAME, BLOCKNAME, OBJECT_RENAMING.
-       Rename some non-terminals to be closer to reference manual usage.
-       Tighten up expression syntax to disallow certain non-Ada 
-       constructions such as X and then Y or else Z.
-       (ada_parse): Remove initialization of left_block_context.
-       (write_var_from_name): Remove.
-       (write_var_or_type): New function, containing previous code from
-       defunct write_var_from_name and name_lookup.
-       (block_lookup): New function, moved from ada-lex.l
-       (select_possible_type_sym): New function, factored out of
-       name_lookup, which used to be in ada-lex.l.
-       (find_primitive_type): Ditto.
-       (chop_selector): Ditto.
-       (write_ambiguous_var): New function, factored out of defunct
-       write_var_from_name.
-       (write_selectors): New function.
-       (write_name_assoc): New function.
-       (write_exp_op_with_string): New function.
-
-       * ada-lex.l (processId): Change interface to return stoken.
-       (tempbuf, resize_tempbuf, tempbuf_size, tempbuf_len): Remove.
-       (block_lookup, name_lookup): Remove.  Functionality moved to
-       ada-exp.y.
-       (state IN_STRING): Remove.
-       (rules): Handle string escapes in processString.
-       Add 'others' token.
-       Return all NAMEs, BLOCKNAMEs, OBJECT_RENAMINGs, TYPENAMEs in
-       yylval.sval (as simple strings).
-       All name look-ups now handled in ada-exp.y.
-       Introduce "::" (COLONCOLON) token and return as separate token.
-       (processId): Change return convention.  Comment.
-       Leave leading "'" in place.
-       (processString): New function.
-       (find_dot_all): Add note to comment.
-       Fix problem that allowed match only at the end.
-
-       * ada-lang.c: Introduce aggregates.
-       (find_struct_field): Add new parameter to count fields skipped, and
-       allow other output parameters to be NULL.
-       (value_tag_from_contents_and_address, ada_value_struct_elt): Use 
-       new find_struct_field.
-       (ada_index_struct_field, assign_aggregate, ada_is_array_type)
-       (num_visible_fields, ada_index_struct_field_1, ada_index_struct_field)
-       (num_component_specs, assign_component, assign_aggregate):
-       (aggregate_assign_from_choices,aggregate_assign_positional)
-       (aggregate_assign_others,add_component_interval):
+       * target.c (gdb_override_async): New variable.
+       (gdb_set_async_override, do_restore_target_async_mask): 
        New functions.
-       (ada_evaluate_subexp): Declare.
-       Add aggregate-related operators.
-       (ada_forward_operator_length): Declare.
-       (resolve_subexp): Add cases for new aggregate operators and OP_NAME.
-       Consolidate Ada operators, using ada_forward_operator_length.
-       (ada_search_struct_field): Search in forward order.
-       (ADA_OPERATORS): Add new aggregate operators.
-       (ada_operator_length, ada_op_name, ada_forward_operator_length)
-       (ada_dump_subexp_body, ada_print_subexp): Handle new aggregate 
-       operators and OP_NAME.
-       (ada_type_of_array): Use longest_to_int.
-       (value_assign_to_component): New function.
-       (ada_forward_operator_length, ada_op_name, ada_dump_subexp_body):
-       Add OP_NAME case.
-       (ada_forward_operator_length, ada_dump_subexp_body):
-       Add OP_STRING case.
+       (debug_to_wait): Add extra argument.
 
-       * ada-lang.h (enum ada_operator): Add OP_AGGREGATE, OP_OTHERS,
-       OP_CHOICES, OP_DISCRETE_RANGE, OP_POSITIONAL.
+       * linux-thread-db.c (thread_db_wait): Add extra argument.
 
-2006-01-02  Paul N. Hilfinger  <hilfinger@adacore.com>
+       * wrapper.h (safe_execute_command): Declare structure.
 
-       * ada-lang.c (process_raise_exception_name): Remove extraneous 
-        definition from unsubmitted code.
+       * top.c (*deprecated_target_wait_hook): Add extra argument.
+       (read_command_file): Make asynchronous.
 
-       (is_lower_alphanum): New function.
-       (ada_decode):  Add support for decoding protected object subprograms
-       and entries, and of entities declared inside protected object
-       subprograms. 
-       Also add missing handling for__{DIGITS}+ suffixes.
-       Allow '$<digits>' as valid overloading suffix.
-       (is_name_suffix): Add handling for protected type entriy suffixes.
-       Also add support for protected type subprogram suffixes, but keep
-       it commented out for now, as there is an ambiguity between these
-       entities and other internally generated entities.
-       Allow '$<digits>' as valid overloading suffix.
-       (is_valid_name_for_wild_match): New function.
-       (wild_match): Add an exra level of verification of the entity name
-       before declaring it a match for the given pattern.
+       * remote.c (remote_wait, remote_async_wait): Add extra argument.
 
-       (ada_type_of_array, ada_evaluate_subexp): Use more proper 
-       longest_to_int rather than cast.
+       * infrun.c: Include event-top.h
+       (wait_for_inferior, fetch_inferior_event): Add extra argument to
+       target_wait.
+       (proceed): Set target_executing = 0.
+       (handle_inferior_event): Call async_disable_stdin if async.
 
-       (ada_evaluate_subexp): Use "invalid" rather than "illegal" in comment.
+       * inf-ptrace.c: Include inf-loop.h, async-nat-inferior.h.
+       (inf_ptrace_him): Create a signal thread.
+       (inf_ptrace_wait): Add extra argument to target_wait.
 
-       (ada_coerce_to_simple_array): Call check_size to make sure
-       that the object size is reasonable.
+       * inf-loop.c (inferior_event_handler, complete_execution): 
+       Changes for asynchronous operation (copied verbatim).
 
-       (ada_value_primitive_packed_val):  Use correct location in target 
-       buffer for extracting packed record fields that are themselves records.
+       * inf-child.c: Include async-nat-inferior.h.
+       (inf_child_target): Use methods async_terminal_inferior
+       and async_terminal_ours.
 
-       (add_defn_to_vec): Do not try to replace a stub type by its full
-       type. Avoids a potential infinite loop.
-       
-       (ada_lookup_symbol): Move return incorrectly placed return statement, 
-       causing a loop that should be scanning all object files to only 
-       scan the first one.
+       * i386-linux-nat.c: Include inf-loop.h, async-nat-inferior.h.
+       (i386_linux_resume): Call gdb_process_events and then
+       async methods.
 
-       (ada_tag_name_2): New function.
-       (ada_tag_name_1): If no 'tsd' field found in the dispatching table,
-       use alternative representation.
+       * exec.c: Include event-loop.h, async-nat-inferior.h.
+       (async_file_handler, standard_async, standard_is_async_p)
+       (standard_can_async_p): New functions.
+       (init_exec_ops): Initialise above methods.
 
-       (ada_find_renaming_symbol): Strip the function name suffix when 
-       computing the XR type name.
+       * event-top.h (cli_command_loop): Make argument void*.
 
-       (ada_to_fixed_type): Try determining the tag only if we have the
-       object's address.
-       (to_fixed_array_type): Add comments.
+       * event-top.c (display_gdb_prompt, async_enable_stdin)
+       (async_disable_stdin, handle_sigint, async_request_quit)
+       (gdb_setup_readline, _initialize_event_loop): 
+       Changes for asynchronous operation (copied verbatim).
+       (cli_command_loop): Make argument void*.
 
-       (ada_check_typedef): Replace expression checking whether the given
-       type is a stub or not by a "call" to TYPE_STUB. Clearer and more
-       consistent.
+       * event-loop.h (gdb_client_data): Move typedef to defs.h.
+       (gdb_create_event): Declare.
+       (event_handler_func): Move typedef from event-loop.c.
        
-       * ada-lang.h (ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS): Allow
-       '$' in addition to '.' for runtime auxiliary function name suffixes.
-       See changes to ada_decode above.
-
-       (struct task_control_block): Add field called_task.  (This change is
-       to keep synchronized with our local sources; it does not affect the
-       public version yet.)
-
-       * ada-typeprint.c (ada_print_type): Use int_string for printing
-       modulus of modular type.
+       * event-loop.c (use_poll): Set to 0.
+       (gdb_queue_event, gdb_create_event): New functions.
+       (async_queue_event): Don't make static.
+       (create_file_event): Use gdb_create_event.
+       (gdb_event): Change component from int to void*.
+       (process_event, handle_file_event, handle_timer_event):
+       Change according to gdb_event.
+       (event_handler_func): Move typedef to event-loop.c.
+
+       * defs.h: (gdb_mi_run_status, event_loop_p): New externs.
+       (gdb_client_data): Move typedef from event-loop.h.
+       (*deprecated_command_loop_hook): Make argument void*.
+       (*deprecated_target_wait_hook): Add argument.
+
+       * cli-out.h (cli_quoted_out_new): Declare.
+
+       * cli-out.c (cli_quoted_out_new): New function.
+       Include mi/mi-console.h.
+
+       * cli/cli-interp.c: Include inferior.h, mi/mi-console.h.
+       (safe_execute_command): Make static.
+       (cli_interpreter_resume, cli_interpreter_exec):
+       Make asynchronous.
+       (cli_quoted_interpreter_resume): New function.
+       (_initialize_cli_interp): Add li_command_loop to procs.
+       Initialize the console-quoted interpreter.
+
+       * tui/tui-hooks.c (tui_target_wait_hook): Add extra argument.
+
+       * mi/mi-main.h (mi_dont_register_continuation)
+       (current_command_token,  mi_interp, mi_interpreter_exec_continuation)
+       (mi_continuation_arg): New externs.
+       (mi_setup_continuation_arg): Declare.
        
-       (print_range): Trivial editorial comment fix.
-
-       * ada-valprint.c (ada_emit_char): Use normal Ada syntax for 
-       double quote in string.
-
-2006-01-01  Joel Brobecker  <brobecker@adacore.com>
-
-       * top.c: Add 2006 to list of copyright years in file header.
+       * mi/mi-main.c: Include wrapper.h.
+       (struct mi_continuation_arg): New structure.
+       (mi_interpreter_exec_continuation): Move to mi-interp.c.
+       (mi_execute_async_cli_command)
+       (mi_exec_async_cli_cmd_continuation): Make asynchronous.
+       (mi_setup_continuation_arg): New function.
+
+       * mi/mi-interp.c (mi_interpreter_exec_continuation): 
+       Move from mi-main.c
+       (mi_cmd_interpreter_exec): Switch interpreters.  Make
+       asynchronous.
+       (mi1_command_loop, mi2_command_loop, mi3_command_loop): 
+       Make argument void*.
+
+       * Makefile.in (async_nat_inferior_h, async_nat_sigthread_h): 
+       New variables.
+       (gdb$(EXEEXT), $(TUI)$(EXEEXT)): Link with libpthread.
+       (async-nat-inferior.o, async-nat-sigthread.o): New rules.
+       (COMMON_OBS): Add above object files.
+       (exec.o, i386-linux-nat.o, inf-ptrace.o, linux-nat.o):
+       Update dependencies.
 
-2006-01-01  Joel Brobecker  <brobecker@adacore.com>
+2006-05-13  Nick Roberts  <nickrob@snap.net.nz>
 
-       * top.c (print_gdb_version): Update copyright year to 2006.
+       * main.c: (event_loop_p): Re-instate variable.
+       (captured_main): Re-instate async/noasync option.
+       (print_gdb_help): Describe option again.
 
-2006-01-01  Roger Sayle  <roger@eyesopen.com>
-            Elena Zannoni <ezannoni@redhat.com>
+       * exec.c(init_exec_ops): Only initialise async methods with async
+       option.
 
-       PR symtab/1651
-       * xcoffread.c (xcoff_next_symbol_text): Check this_symtab_psymtab
-       for NULL before assigning this_symtab_psymtab->objfile to objfile.
-       (scan_xcoff_symtab): Initialize next_symbol_text_func.
-        (Committed by Jim Blandy)
+       * inf-ptrace.c (inf_ptrace_him): Only reate a signal thread with
+       async option.
 
-For older changes see ChangeLog-2005.
-\f
-Local Variables:
-mode: change-log
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
+       * README.async, TODO.async, PROBLEMS.async: New files.
diff --git a/gdb/PROBLEMS.async b/gdb/PROBLEMS.async
new file mode 100644 (file)
index 0000000..1fb9468
--- /dev/null
@@ -0,0 +1,13 @@
+1) You can't exit at the end with CTRL-D, the process has to be killed. Typing
+"q" just makes it hang.
+
+2) The inferior can't accept input (on the same terminal):
+
+-exec-run
+^running
+(gdb)
+Enter value for n1 : 5
+Enter value for n2 :
+Suspended (tty input)
+
+This also happens with Apple's GDB but I don't understand it.
diff --git a/gdb/README.async b/gdb/README.async
new file mode 100644 (file)
index 0000000..39779b3
--- /dev/null
@@ -0,0 +1,54 @@
+This branch is an attempt to get GDB to work asynchronously (whatever that
+might mean).  I have started this by copying some changes from Apple's version
+(CVS as of Sept 5 2005 and covered by GPL) to get some of the funtionality
+that I'm looking for (and because I couldn't do it on my own!).  It uses
+pthreads which Daniel Jacobowitz dislikes and thinks that it should be done in
+one process.  Where I don't really understand the code changes, I have put
+"Make asynchronous." and somtimes "(copied verbatim)" in the ChangeLog.
+
+The initial changes are directed at the output of the asynchronous commands
+such as run, continue, next, finish etc.  These are implemented through
+mi_execute_async_cli_command and for asynchronus operation require
+mi_exec_async_cli_cmd_continuation to be called through fetch_inferior event.
+
+Currently -exec-next and next generate different output because the
+asynchronous output is faked:
+
+(gdb)
+-exec-next
+^running
+(gdb)
+*stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x0804857f",func="main",args=[],file="myprog.c",fullname="/home/nickrob/myprog.c",line="69"}
+(gdb)
+n
+&"n\n"
+~"70\t  int n1 = 7, n2 = 8, n3 = 9;\n"
+^done
+(gdb)
+
+With these changes the output is the same:
+
+-exec-next
+^running
+(gdb)
+*stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x0804857f",func="main",args=[],file="myprog.c",fullname="/home/nickrob/myprog.c",line="69"}
+(gdb)
+n
+&"n\n"
+^running
+^done
+(gdb)
+*stopped,reason="end-stepping-range",thread-id="0",frame={addr="0x080485bb",func="main",args=[],file="myprog.c",fullname="/home/nickrob/myprog.c",line="70"}
+(gdb)
+
+(actually it generates an extra &"n\n" and ^done but with 
+"-interpreter-exec console" its identical.
+
+To help integration with HEAD I've re-instated the --async option so that
+--noasync (the default) *should* run as on the trunk.
+
+Bugs/Problems are in PROBLEMS.async
+
+
+Nick Roberts
+nickrob@snap.net.nz
diff --git a/gdb/TODO.async b/gdb/TODO.async
new file mode 100644 (file)
index 0000000..109b0b6
--- /dev/null
@@ -0,0 +1,3 @@
+1) Replace pthreads implementation with a single process.
+
+2) Generalise for other targets (currently just i386-linux?).
diff --git a/gdb/async-nat-inferior.c b/gdb/async-nat-inferior.c
new file mode 100644 (file)
index 0000000..eac960c
--- /dev/null
@@ -0,0 +1,604 @@
+/* Async support for GDB, the GNU debugger.
+   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2004
+   Free Software Foundation, Inc.
+
+   Contributed by Apple Computer, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "top.h"
+#include "inferior.h"
+#include "target.h"
+#include "symfile.h"
+#include "symtab.h"
+#include "objfiles.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "gdbthread.h"
+#include "regcache.h"
+#include "environ.h"
+#include "event-top.h"
+#include "inf-loop.h"
+#include "gdb_stat.h"
+#include "exceptions.h"
+
+#include "bfd.h"
+
+#include <sys/ptrace.h>
+#include <sys/signal.h>
+#include <setjmp.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <signal.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+
+#include "async-nat-inferior.h"
+/* classic-inferior-support */
+//#include "macosx-nat.h"
+//#include "macosx-nat-inferior-util.h"
+
+#ifndef EXC_SOFT_SIGNAL
+#define EXC_SOFT_SIGNAL 0
+#endif
+
+extern int standard_is_async_p (void);
+extern int standard_can_async_p (void);
+
+extern bfd *exec_bfd;
+
+gdb_inferior_status *gdb_status = NULL;
+
+int inferior_ptrace_flag = 1;
+int inferior_ptrace_on_attach_flag = 1;
+int inferior_bind_exception_port_flag = 1;
+int inferior_handle_exceptions_flag = 1;
+int inferior_handle_all_events_flag = 1;
+
+enum gdb_source_type
+{
+  NEXT_SOURCE_NONE = 0x0,
+  NEXT_SOURCE_EXCEPTION = 0x1,
+  NEXT_SOURCE_SIGNAL = 0x2,
+  NEXT_SOURCE_CFM = 0x4,
+  NEXT_SOURCE_ALL = 0x7
+};
+
+struct gdb_pending_event
+{
+  enum gdb_source_type type;
+  unsigned char *buf;
+  struct gdb_pending_event *next;
+};
+
+struct gdb_pending_event *pending_event_chain, *pending_event_tail;
+
+static enum gdb_source_type gdb_fetch_event (struct
+                                                   gdb_inferior_status
+                                                   *inferior,
+                                                   unsigned char *buf,
+                                                   size_t len,
+                                                   unsigned int flags,
+                                                   int timeout);
+
+static int gdb_service_event (enum gdb_source_type source,
+                                 unsigned char *buf,
+                                 struct target_waitstatus *status);
+
+static void gdb_handle_signal (gdb_signal_thread_message *msg,
+                              struct target_waitstatus *status);
+
+static void gdb_add_to_pending_events (enum gdb_source_type,
+                                          unsigned char *buf);
+
+static void gdb_pending_event_handler (void *data);
+
+void gdb_clear_pending_events ();
+
+static void gdb_inferior_reset (gdb_inferior_status *s);
+
+static void gdb_inferior_destroy (gdb_inferior_status *s);
+
+static void gdb_handle_signal (gdb_signal_thread_message *msg,
+                              struct target_waitstatus *status)
+{
+  //CHECK_FATAL (gdb_status != NULL);
+
+  //CHECK_FATAL (gdb_status->attached_in_ptrace);
+  //CHECK_FATAL (!gdb_status->stopped_in_ptrace);
+  /* CHECK_FATAL (! gdb_status->stopped_in_softexc); */
+
+  /* if (inferior_debug_flag)
+    {
+      gdb_signal_thread_debug_status (stderr, msg->status);
+      } */
+
+  if (msg->pid != gdb_status->pid)
+    {
+      warning ("gdb_handle_signal: signal message was for pid %d, "
+               "not for inferior process (pid %d)\n",
+               msg->pid, gdb_status->pid);
+      return;
+    }
+
+  if (WIFEXITED (msg->status))
+    {
+      status->kind = TARGET_WAITKIND_EXITED;
+      status->value.integer = WEXITSTATUS (msg->status);
+      return;
+    }
+
+  if (!WIFSTOPPED (msg->status))
+    {
+      status->kind = TARGET_WAITKIND_SIGNALLED;
+      status->value.sig = target_signal_from_host (WTERMSIG (msg->status));
+      return;
+    }
+
+  gdb_status->stopped_in_ptrace = 1;
+
+  //prepare_threads_after_stop (gdb_status);
+
+  status->kind = TARGET_WAITKIND_STOPPED;
+  status->value.sig = target_signal_from_host (WSTOPSIG (msg->status));
+}
+
+static void
+gdb_add_to_port_set (struct gdb_inferior_status *inferior,
+                        fd_set * fds, int flags)
+{
+  FD_ZERO (fds);
+
+  if ((flags & NEXT_SOURCE_SIGNAL)
+      && inferior->signal_status.receive_fd > 0)
+    {
+      FD_SET (inferior->signal_status.receive_fd, fds);
+    }
+}
+
+/* TIMEOUT is either -1, 0, or greater than 0.
+   For 0, check if there is anything to read, but don't block.
+   For -1, block until there is something to read.
+   For >0, block at least the specified number of microseconds, or until there
+   is something to read.
+   The kernel doesn't give better than ~1HZ (0.01 sec) resolution, so
+   don't use this as a high accuracy timer. */
+
+static enum gdb_source_type
+gdb_fetch_event (struct gdb_inferior_status *inferior,
+                    unsigned char *buf, size_t len,
+                    unsigned int flags, int timeout)
+{
+  fd_set fds;
+  int fd, ret;
+  struct timeval tv;
+
+  //  CHECK_FATAL (len >= sizeof (gdb_signal_thread_message));
+
+  tv.tv_sec = 0;
+  tv.tv_usec = timeout;
+
+  gdb_add_to_port_set (inferior, &fds, flags);
+
+  for (;;)
+    {
+      if (timeout == -1)
+        {
+          ret = select (FD_SETSIZE, &fds, NULL, NULL, NULL);
+        }
+      else
+        {
+          ret = select (FD_SETSIZE, &fds, NULL, NULL, &tv);
+        }
+      if ((ret < 0) && (errno == EINTR))
+        {
+          continue;
+        }
+      if (ret < 0)
+        {
+          internal_error (__FILE__, __LINE__, "unable to select: %s",
+                          strerror (errno));
+        }
+      if (ret == 0)
+        {
+          return NEXT_SOURCE_NONE;
+        }
+      break;
+    }
+
+  fd = inferior->signal_status.receive_fd;
+  if (fd > 0 && FD_ISSET (fd, &fds))
+    {
+      read (fd, buf, sizeof (gdb_signal_thread_message));
+      return NEXT_SOURCE_SIGNAL;
+    }
+
+  return NEXT_SOURCE_NONE;
+}
+
+/* This takes the data from an event and puts it on the tail of the
+   "pending event" chain. */
+
+static void
+gdb_add_to_pending_events (enum gdb_source_type type,
+                              unsigned char *buf)
+{
+  struct gdb_pending_event *new_event;
+
+  new_event = (struct gdb_pending_event *)
+    xmalloc (sizeof (struct gdb_pending_event));
+
+  new_event->type = type;
+
+  if (type == NEXT_SOURCE_SIGNAL)
+    {
+      gdb_signal_thread_message *mssg;
+      mssg = (gdb_signal_thread_message *)
+        xmalloc (sizeof (gdb_signal_thread_message));
+      memcpy (mssg, buf, sizeof (gdb_signal_thread_message));
+      /*inferior_debug (1,
+       "gdb_add_to_pending_events: adding a signal event to the pending events.\n"); */
+      new_event->buf = (void *) mssg;
+    }
+
+  new_event->next = NULL;
+
+  if (pending_event_chain == NULL)
+    {
+      pending_event_chain = new_event;
+      pending_event_tail = new_event;
+    }
+  else
+    {
+      pending_event_tail->next = new_event;
+      pending_event_tail = new_event;
+    }
+}
+
+void
+gdb_clear_pending_events ()
+{
+  struct gdb_pending_event *event_ptr = pending_event_chain;
+
+  while (event_ptr != NULL)
+    {
+      pending_event_chain = event_ptr->next;
+      xfree (event_ptr->buf);
+      xfree (event_ptr);
+      event_ptr = pending_event_chain;
+    }
+}
+
+/* This extracts the top of the pending event chain and posts a gdb event
+   with its content to the gdb event queue.  Returns 0 if there were no
+   pending events to be posted, 1 otherwise. */
+
+int
+gdb_post_pending_event (void)
+{
+  struct gdb_pending_event *event;
+
+  if (pending_event_chain == NULL)
+    {
+      //inferior_debug (1, "gdb_post_pending_event: no events to post\n");
+      return 0;
+    }
+  else
+    {
+      event = pending_event_chain;
+      pending_event_chain = pending_event_chain->next;
+      if (pending_event_chain == NULL)
+        pending_event_tail = NULL;
+
+      /*inferior_debug (1,
+       "gdb_post_pending_event: consuming event off queue\n"); */
+      gdb_queue_event (gdb_pending_event_handler, (void *) event, HEAD);
+
+      return 1;
+    }
+}
+
+static void
+gdb_pending_event_handler (void *data)
+{
+  //inferior_debug (1, "Called in gdb_pending_event_handler\n");
+  async_client_callback (INF_REG_EVENT, data);
+}
+
+static int
+gdb_service_event (enum gdb_source_type source,
+                      unsigned char *buf, struct target_waitstatus *status)
+{
+ if (source == NEXT_SOURCE_SIGNAL)
+    {
+      // inferior_debug (1, "gdb_service_events: got signal message\n");
+      gdb_handle_signal ((gdb_signal_thread_message *) buf, status);
+      //      CHECK_FATAL (status->kind != TARGET_WAITKIND_SPURIOUS);
+      if (!inferior_handle_all_events_flag)
+        {
+          return 1;
+        }
+    }
+  else
+    {
+      error ("got message from unknown source: 0x%08x\n", source);
+      return 0;
+    }
+  return 1;
+}
+
+/* This drains the event sources.  The first event found is directly
+   handled.  The rest are placed on the pending events queue, to be
+   handled the next time that the inferior is "run".
+
+   Returns: The number of events found. */
+
+int
+gdb_process_events (struct gdb_inferior_status *inferior,
+                       struct target_waitstatus *status,
+                       int timeout, int service_first_event)
+{
+  enum gdb_source_type source;
+  unsigned char buf[1024];
+  int event_count;
+
+  //  CHECK_FATAL (status->kind == TARGET_WAITKIND_SPURIOUS);
+
+  source = gdb_fetch_event (inferior, buf, sizeof (buf),
+                               NEXT_SOURCE_ALL, timeout);
+  if (source == NEXT_SOURCE_NONE)
+    {
+      return 0;
+    }
+
+  event_count = 1;
+
+  if (service_first_event)
+    {
+      if (gdb_service_event (source, buf, status) == 0)
+        return 0;
+    }
+  else
+    {
+      gdb_add_to_pending_events (source, buf);
+    }
+
+  for (;;)
+    {
+      source = gdb_fetch_event (inferior, buf, sizeof (buf),
+                                   NEXT_SOURCE_ALL, 0);
+      if (source == NEXT_SOURCE_NONE)
+        {
+          break;
+        }
+      else
+        {
+          event_count++;
+
+          /* Stuff the remaining events onto the pending_events queue.
+             These will be dispatched when we run again. */
+          /* PENDING_EVENTS */
+          gdb_add_to_pending_events (source, buf);
+        }
+    }
+
+  /*inferior_debug (2,
+          "gdb_process_events: returning with (status->kind == %d)\n",
+         status->kind); */
+  return event_count;
+}
+
+ptid_t
+gdb_process_pending_event (struct gdb_inferior_status *ns,
+                              struct target_waitstatus *status,
+                              gdb_client_data client_data)
+{
+  struct gdb_pending_event *event
+    = (struct gdb_pending_event *) client_data;
+
+  //inferior_debug (1, "Processing pending event type: %d\n", event->type);
+  gdb_service_event (event->type, (unsigned char *) event->buf, status);
+
+  return ptid_build (gdb_status->pid, 0, gdb_status->last_thread);
+}
+
+void
+gdb_create_inferior (struct gdb_inferior_status *inferior,  int pid)
+{
+  //  CHECK_FATAL (inferior != NULL);
+
+  gdb_inferior_destroy (inferior);
+  gdb_inferior_reset (inferior);
+
+  inferior->pid = pid;
+
+  inferior->attached_in_ptrace = 0;
+  inferior->stopped_in_ptrace = 0;
+  inferior->stopped_in_softexc = 0;
+
+  inferior->suspend_count = 0;
+}
+
+static int remote_async_terminal_ours_p = 1;
+static void (*ofunc) (int);
+static PTR sigint_remote_twice_token;
+static PTR sigint_remote_token;
+
+static void remote_interrupt_twice (int signo);
+static void remote_interrupt (int signo);
+static void handle_remote_sigint_twice (int sig);
+static void handle_remote_sigint (int sig);
+static void async_remote_interrupt_twice (gdb_client_data arg);
+static void async_remote_interrupt (gdb_client_data arg);
+
+static void
+interrupt_query (void)
+{
+  target_terminal_ours ();
+
+  if (query ("Interrupted while waiting for the program.\n\
+Give up (and stop debugging it)? "))
+    {
+      target_mourn_inferior ();
+      deprecated_throw_reason (RETURN_QUIT);
+    }
+
+  target_terminal_inferior ();
+}
+
+static void
+remote_interrupt_twice (int signo)
+{
+  signal (signo, ofunc);
+  interrupt_query ();
+  signal (signo, remote_interrupt);
+}
+
+static void
+remote_interrupt (int signo)
+{
+  signal (signo, remote_interrupt_twice);
+  target_stop ();
+}
+
+static void
+handle_remote_sigint_twice (int sig)
+{
+  signal (sig, handle_sigint);
+  sigint_remote_twice_token =
+    create_async_signal_handler (inferior_event_handler_wrapper, NULL);
+  mark_async_signal_handler_wrapper (sigint_remote_twice_token);
+}
+
+static void
+handle_remote_sigint (int sig)
+{
+  signal (sig, handle_remote_sigint_twice);
+  sigint_remote_twice_token =
+    create_async_signal_handler (async_remote_interrupt_twice, NULL);
+  mark_async_signal_handler_wrapper (sigint_remote_token);
+}
+
+static void
+async_remote_interrupt_twice (gdb_client_data arg)
+{
+  if (target_executing)
+    {
+      interrupt_query ();
+      signal (SIGINT, handle_remote_sigint);
+    }
+}
+
+static void
+async_remote_interrupt (gdb_client_data arg)
+{
+  target_stop ();
+}
+
+static void
+cleanup_sigint_signal_handler (void *dummy)
+{
+  signal (SIGINT, handle_sigint);
+  if (sigint_remote_twice_token)
+    delete_async_signal_handler ((struct async_signal_handler **)
+                                 &sigint_remote_twice_token);
+  if (sigint_remote_token)
+    delete_async_signal_handler ((struct async_signal_handler **)
+                                 &sigint_remote_token);
+}
+
+static void
+initialize_sigint_signal_handler (void)
+{
+  sigint_remote_token =
+    create_async_signal_handler (async_remote_interrupt, NULL);
+  signal (SIGINT, handle_remote_sigint);
+}
+
+void
+async_terminal_inferior (void)
+{
+  terminal_inferior ();
+
+  if (!sync_execution)
+    return;
+  if (!remote_async_terminal_ours_p)
+    return;
+  //  CHECK_FATAL (sync_execution);
+  //  CHECK_FATAL (remote_async_terminal_ours_p);
+  delete_file_handler (input_fd);
+  remote_async_terminal_ours_p = 0;
+  initialize_sigint_signal_handler ();
+}
+
+void
+async_terminal_ours (void)
+{
+  terminal_ours ();
+
+  if (!sync_execution)
+    return;
+  if (remote_async_terminal_ours_p)
+    return;
+  //  CHECK_FATAL (sync_execution);
+  //  CHECK_FATAL (!remote_async_terminal_ours_p);
+  cleanup_sigint_signal_handler (NULL);
+
+  add_file_handler (input_fd, stdin_event_handler, 0);
+
+  remote_async_terminal_ours_p = 1;
+}
+
+static void
+gdb_inferior_reset (gdb_inferior_status *s)
+{
+  s->pid = 0;
+
+  s->attached_in_ptrace = 0;
+  s->stopped_in_ptrace = 0;
+  s->stopped_in_softexc = 0;
+
+  s->suspend_count = 0;
+
+  s->last_thread = 0;
+
+  gdb_signal_thread_init (&s->signal_status);
+
+}
+
+static void
+gdb_inferior_destroy (gdb_inferior_status *s)
+{
+  gdb_signal_thread_destroy (&s->signal_status);
+
+  s->pid = 0;
+
+  gdb_inferior_reset (s);
+}
+
+void
+_initialize_gdb_inferior ()
+{
+  gdb_status = (struct gdb_inferior_status *)
+    xmalloc (sizeof (struct gdb_inferior_status));
+
+  gdb_inferior_reset (gdb_status);
+}
diff --git a/gdb/async-nat-inferior.h b/gdb/async-nat-inferior.h
new file mode 100644 (file)
index 0000000..8051ae5
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef __ASYNC_NAT_INFERIOR_H__
+#define __ASYNC_NAT_INFERIOR_H__
+
+#include "async-nat-sigthread.h"
+
+#include "defs.h"
+#include "event-loop.h"
+#include "target.h"
+
+struct gdb_inferior_status
+{
+  int pid;
+
+  int attached_in_ptrace;
+  int stopped_in_ptrace;
+  int stopped_in_softexc;
+
+  unsigned int suspend_count;
+
+  int last_thread;
+
+  gdb_signal_thread_status signal_status;
+};
+typedef struct gdb_inferior_status gdb_inferior_status;
+
+extern gdb_inferior_status *gdb_status;
+
+struct private_thread_info
+{
+  int app_thread_port;
+};
+
+ptid_t gdb_wait (struct gdb_inferior_status *inferior,
+                struct target_waitstatus *status,
+                gdb_client_data client_data);
+
+void gdb_create_inferior (struct gdb_inferior_status *inferior, int pid);
+
+int gdb_process_events (struct gdb_inferior_status *ns,
+                       struct target_waitstatus *status,
+                       int timeout, int service_first_event);
+
+ptid_t gdb_process_pending_event (struct gdb_inferior_status *ns,
+                                 struct target_waitstatus *status,
+                                 gdb_client_data client_data);
+
+int gdb_post_pending_event (void);
+
+void (*async_client_callback) (enum inferior_event_type event_type,
+                                      void *context);
+
+void *async_client_context;
+
+void async_terminal_inferior (void);
+
+void async_terminal_ours (void);
+
+#endif /* __ASYNC_NAT_INFERIOR_H__ */
diff --git a/gdb/async-nat-sigthread.c b/gdb/async-nat-sigthread.c
new file mode 100644 (file)
index 0000000..93520d4
--- /dev/null
@@ -0,0 +1,267 @@
+/* Async support for GDB, the GNU debugger.
+   Copyright 1997, 1998, 1999, 2000, 2001, 2002
+   Free Software Foundation, Inc.
+
+   Contributed by Apple Computer, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "gdbcmd.h"
+#include "event-loop.h"
+#include "inferior.h"
+
+#include "async-nat-sigthread.h"
+//#include "macosx-nat-inferior.h"
+//#include "macosx-nat-mutils.h"
+
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include <sys/select.h>
+
+static FILE *sigthread_stderr_re = NULL;
+static int sigthread_debugflag = 0;
+static void* gdb_signal_thread (void *arg);
+
+/* A re-entrant version for use by the signal handling thread */
+
+void
+sigthread_debug_re (const char *fmt, ...)
+{
+  va_list ap;
+  if (sigthread_debugflag)
+    {
+      va_start (ap, fmt);
+      fprintf (sigthread_stderr_re, "[%d sigthread]: ", getpid ());
+      vfprintf (sigthread_stderr_re, fmt, ap);
+      va_end (ap);
+      fflush (sigthread_stderr_re);
+    }
+}
+
+void
+gdb_signal_thread_init (gdb_signal_thread_status *s)
+{
+  s->transmit_fd = -1;
+  s->receive_fd = -1;
+
+  s->inferior_pid = -1;
+  s->signal_thread = 0;
+}
+
+void
+gdb_signal_thread_create (gdb_signal_thread_status *s, int pid)
+{
+  int fd[2];
+  int ret;
+
+  ret = pipe (fd);
+  //  CHECK_FATAL (ret == 0);
+
+  s->transmit_fd = fd[1];
+  s->receive_fd = fd[0];
+
+  s->inferior_pid = pid;
+
+  s->signal_thread =
+    gdb_thread_fork (gdb_signal_thread, s);
+}
+
+void
+gdb_signal_thread_destroy (gdb_signal_thread_status *s)
+{
+  if (s->signal_thread != 0)
+    {
+      gdb_thread_kill (s->signal_thread);
+    }
+
+  if (s->receive_fd > 0)
+    {
+      delete_file_handler (s->receive_fd);
+      close (s->receive_fd);
+    }
+  if (s->transmit_fd > 0)
+    close (s->transmit_fd);
+
+  gdb_signal_thread_init (s);
+}
+
+void
+gdb_signal_thread_debug (FILE *f, gdb_signal_thread_status *s)
+{
+  fprintf (f, "                [SIGNAL THREAD]\n");
+}
+
+void
+gdb_signal_thread_debug_status (FILE *f, WAITSTATUS status)
+{
+  if (WIFEXITED (status))
+    {
+      fprintf (f, "process exited with status %d\n", WEXITSTATUS (status));
+    }
+  else if (WIFSIGNALED (status))
+    {
+      fprintf (f, "process terminated with signal %d (%s)\n",
+               WTERMSIG (status),
+               target_signal_to_string (WTERMSIG (status)));
+    }
+  else if (WIFSTOPPED (status))
+    {
+      fprintf (f, "process stopped with signal %d (%s)\n", WSTOPSIG (status),
+               target_signal_to_string (WSTOPSIG (status)));
+    }
+  else
+    {
+      fprintf (f, "unknown status value %d\n", status);
+    }
+}
+
+static void*
+gdb_signal_thread (void *arg)
+{
+  gdb_signal_thread_status *s = (gdb_signal_thread_status *) arg;
+  //  CHECK_FATAL (s != NULL);
+
+  for (;;)
+    {
+
+      gdb_signal_thread_message msg;
+      WAITSTATUS status = 0;
+      pid_t pid = 0;
+
+      pthread_testcancel ();
+
+      sigthread_debug_re
+        ("gdb_signal_thread: waiting for events for pid %d\n",
+         s->inferior_pid);
+
+      pid = waitpid (s->inferior_pid, &status, 0);
+
+      sigthread_debug_re
+        ("gdb_signal_thread: received event for pid %d\n",
+         s->inferior_pid);
+
+      if ((pid < 0) && (errno == ECHILD))
+        {
+          sigthread_debug_re
+            ("gdb_signal_thread: no children present; waiting for parent\n");
+          for (;;)
+            {
+              pthread_testcancel ();
+              sched_yield ();
+            }
+        }
+
+      if ((pid < 0) && (errno == EINTR))
+        {
+          sigthread_debug_re
+            ("gdb_signal_thread: wait interrupted; continuing\n");
+          continue;
+        }
+
+      if (pid < 0)
+        {
+          fprintf (sigthread_stderr_re,
+                   "gdb_signal_thread: unexpected error: %s\n",
+                   strerror (errno));
+          abort ();
+        }
+
+      if (sigthread_debugflag)
+        {
+          sigthread_debug_re ("gdb_signal_thread: received event for pid %d: ", pid);
+          gdb_signal_thread_debug_status (sigthread_stderr_re, status);
+        }
+
+      if (pid != s->inferior_pid)
+        {
+          fprintf (sigthread_stderr_re,
+                   "gdb_signal_thread: event was for unexpected pid (got %d, was expecting %d)\n",
+                   pid, s->inferior_pid);
+          abort ();
+        }
+
+      msg.pid = pid;
+      msg.status = status;
+      write (s->transmit_fd, &msg, sizeof (msg));
+    }
+}
+
+void
+gdb_pthread_kill (pthread_t pthread)
+{
+  int ret;
+
+  ret = pthread_cancel (pthread);
+  if (ret != 0)
+    {
+      warning ("Unable to cancel thread: %s (%d)", strerror (errno), errno);
+    }
+}
+
+pthread_t
+gdb_pthread_fork (pthread_fn_t function, void *arg)
+{
+  int result;
+  pthread_t pthread = 0;
+  pthread_attr_t attr;
+
+  result = pthread_attr_init (&attr);
+  if (result != 0)
+    {
+      error ("Unable to initialize thread attributes: %s (%d)",
+             strerror (errno), errno);
+    }
+
+  result = pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_JOINABLE);
+  if (result != 0)
+    {
+      error ("Unable to initialize thread attributes: %s (%d)",
+             strerror (errno), errno);
+    }
+
+  result = pthread_create (&pthread, &attr, function, arg);
+  if (result != 0)
+    {
+      error ("Unable to create thread: %s (%d)", strerror (errno), errno);
+    }
+
+  result = pthread_attr_destroy (&attr);
+  if (result != 0)
+    {
+      warning ("Unable to deallocate thread attributes: %s (%d)",
+               strerror (errno), errno);
+    }
+
+  return pthread;
+}
+
+void
+_initialize_gdb_nat_sigthread ()
+{
+  sigthread_stderr_re = fdopen (fileno (stderr), "w+");
+
+  add_setshow_boolean_cmd ("signals", no_class,
+                          &sigthread_debugflag, _("\
+Set if printing signal thread debugging statements."), _("\
+Show if printing signal thread debugging statements."), NULL,
+                          NULL, NULL,
+                          &setdebuglist, &showdebuglist);
+}
diff --git a/gdb/async-nat-sigthread.h b/gdb/async-nat-sigthread.h
new file mode 100644 (file)
index 0000000..f7ed8fd
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef __ASYNC_NAT_SIGTHREAD_H__
+#define __ASYNC_NAT_SIGTHREAD_H__
+
+#include "defs.h"
+//#include "macosx-nat-mutils.h"
+//#include "macosx-nat-threads.h"
+
+#include <pthread.h>
+
+typedef void *(*pthread_fn_t) (void *arg);
+
+void gdb_pthread_kill (pthread_t pthread);
+pthread_t gdb_pthread_fork (pthread_fn_t function, void *arg);
+
+#define gdb_thread_fork gdb_pthread_fork
+#define gdb_thread_kill gdb_pthread_kill
+
+typedef pthread_t gdb_thread_t;
+typedef pthread_fn_t gdb_thread_fn_t;
+
+#include <sys/wait.h>
+
+typedef int WAITSTATUS;
+
+struct gdb_signal_thread_message
+{
+  int pid;
+  WAITSTATUS status;
+};
+
+struct gdb_signal_thread_status
+{
+  gdb_thread_t signal_thread;
+
+  int transmit_fd;
+  int receive_fd;
+
+  int inferior_pid;
+};
+
+typedef struct gdb_signal_thread_message gdb_signal_thread_message;
+typedef struct gdb_signal_thread_status gdb_signal_thread_status;
+
+void gdb_signal_thread_debug (FILE *f,
+                                 struct gdb_signal_thread_status *s);
+void gdb_signal_thread_debug_status (FILE *f, WAITSTATUS status);
+
+void gdb_signal_thread_init (gdb_signal_thread_status *s);
+
+void gdb_signal_thread_create (gdb_signal_thread_status *s, int pid);
+void gdb_signal_thread_destroy (gdb_signal_thread_status *s);
+
+extern gdb_signal_thread_status *gdb_signal_status;
+
+#endif /* __ASYNC_NAT_SIGTHREAD_H__ */
index 12a4f5ef9de627cdae6f11fb37e07283215a4a32..281fa09f719f985bb5d3322e05415dca4d2b3884 100644 (file)
@@ -28,6 +28,7 @@
 #include "cli-out.h"
 #include "gdb_string.h"
 #include "gdb_assert.h"
+#include "mi/mi-console.h"
 
 struct ui_out_data
   {
@@ -390,6 +391,17 @@ cli_out_new (struct ui_file *stream)
   return ui_out_new (&cli_ui_out_impl, data, flags);
 }
 
+struct ui_out *
+cli_quoted_out_new (struct ui_file *raw)
+{
+  int flags = ui_source_list;
+
+  struct ui_out_data *data = XMALLOC (struct ui_out_data);
+  data->stream = mi_console_file_new (raw, "~", '"');
+  data->suppress_output = 0;
+  return ui_out_new (&cli_ui_out_impl, data, flags);
+}
+
 struct ui_file *
 cli_out_set_stream (struct ui_out *uiout, struct ui_file *stream)
 {
index d7eb85d95b902bed516e1fb4e88c16e0b44544c1..4f7ea4a93665833b287bc7069d57afe201618944 100644 (file)
@@ -25,6 +25,7 @@
 struct ui_file;
 
 extern struct ui_out *cli_out_new (struct ui_file *stream);
+extern struct ui_out *cli_quoted_out_new (struct ui_file *stream);
 
 extern struct ui_file *cli_out_set_stream (struct ui_out *uiout,
                                           struct ui_file *stream);
index 38ee12d29cb00ee1cf91c69f35b9c873179a9229..9da295af83f49191ef46027b7d1859903b7406c9 100644 (file)
@@ -26,6 +26,8 @@
 #include "ui-out.h"
 #include "cli-out.h"
 #include "top.h"               /* for "execute_command" */
+#include "inferior.h"           /* for "sync_execution" */
+#include "mi/mi-console.h"      /* for "mi_console_file_new" */
 #include "gdb_string.h"
 #include "exceptions.h"
 
@@ -34,8 +36,8 @@ struct ui_out *cli_uiout;
 /* These are the ui_out and the interpreter for the console interpreter.  */
 
 /* Longjmp-safe wrapper for "execute_command".  */
-static struct gdb_exception safe_execute_command (struct ui_out *uiout,
-                                                 char *command, int from_tty);
+struct gdb_exception safe_execute_command (struct ui_out *uiout,
+                                          char *command, int from_tty);
 struct captured_execute_command_args
 {
   char *command;
@@ -55,7 +57,7 @@ cli_interpreter_resume (void *data)
 {
   struct ui_file *stream;
 
-  /*sync_execution = 1; */
+  sync_execution = 1;
 
   /* gdb_setup_readline will change gdb_stdout.  If the CLI was previously
      writing to gdb_stdout, then set it to the new gdb_stdout afterwards.  */
@@ -95,22 +97,23 @@ cli_interpreter_display_prompt_p (void *data)
 static struct gdb_exception
 cli_interpreter_exec (void *data, const char *command_str)
 {
-  struct ui_file *old_stream;
   struct gdb_exception result;
 
   /* FIXME: cagney/2003-02-01: Need to const char *propogate
      safe_execute_command.  */
   char *str = strcpy (alloca (strlen (command_str) + 1), command_str);
 
-  /* gdb_stdout could change between the time cli_uiout was initialized
-     and now. Since we're probably using a different interpreter which has
-     a new ui_file for gdb_stdout, use that one instead of the default.
+  /* We don't need old_stream because we actually change the
+     interpreters when we do interpreter exec, then swap them back.
+     This code assumes that the interpreter is still the one that is
+     exec'ing in the cli interpreter, and we are just faking it up.  */
+  /* We want 
+     the person who set the interpreter to get the uiout right for that
+     according to their lights.  If you don't do that, then you can't share
+     the cli_interpreter_exec between the console & console-quoted 
+     interpreters.  */
+  result = safe_execute_command (uiout, str, 1);
 
-     It is important that it gets reset everytime, since the user could
-     set gdb to use a different interpreter.  */
-  old_stream = cli_out_set_stream (cli_uiout, gdb_stdout);
-  result = safe_execute_command (cli_uiout, str, 1);
-  cli_out_set_stream (cli_uiout, old_stream);
   return result;
 }
 
@@ -122,7 +125,7 @@ do_captured_execute_command (struct ui_out *uiout, void *data)
   execute_command (args->command, args->from_tty);
 }
 
-static struct gdb_exception
+struct gdb_exception
 safe_execute_command (struct ui_out *uiout, char *command, int from_tty)
 {
   struct gdb_exception e;
@@ -137,6 +140,34 @@ safe_execute_command (struct ui_out *uiout, char *command, int from_tty)
   return e;
 }
 
+/* This is the only new function needed for the 
+   console-quoted interpreter.  This outputs console text in 
+   an mi-quoted form, so an mi-parser won't be fooled by spurious
+   * at beginning of line goofs...  */
+
+int
+cli_quoted_interpreter_resume (void *data)
+{
+  static struct ui_file *quoted_stdout = NULL;
+  static struct ui_file *quoted_stderr = NULL;
+
+  sync_execution = 1;
+  // print_frame_more_info_hook = 0;
+  gdb_setup_readline ();
+  if (quoted_stdout == NULL)
+    {
+      struct ui_file *raw_stdout;
+      raw_stdout = stdio_fileopen (stdout);
+      quoted_stdout = mi_console_file_new (raw_stdout, "~", '"');
+
+      quoted_stderr = mi_console_file_new (raw_stdout, "&", '"');
+    }
+  gdb_stdout = quoted_stdout;
+  gdb_stderr = quoted_stderr;
+  gdb_stdlog = gdb_stderr;
+
+  return 1;
+}
 
 /* Standard gdb initialization hook.  */
 extern initialize_file_ftype _initialize_cli_interp; /* -Wmissing-prototypes */
@@ -149,13 +180,35 @@ _initialize_cli_interp (void)
     cli_interpreter_resume,    /* resume_proc */
     cli_interpreter_suspend,   /* suspend_proc */
     cli_interpreter_exec,      /* exec_proc */
-    cli_interpreter_display_prompt_p   /* prompt_proc_p */
+    cli_interpreter_display_prompt_p,  /* prompt_proc_p */
+    cli_command_loop,
+    // cli_interpreter_complete
   };
   struct interp *cli_interp;
 
+  /* And here we initialize the console-quoted
+     interpreter.  */
+  static const struct interp_procs quoted_procs = {
+    cli_interpreter_init,      /* init_proc */
+    cli_quoted_interpreter_resume,     /* resume_proc */
+    cli_interpreter_suspend,   /* suspend_proc */
+    cli_interpreter_exec,      /* exec_proc */
+    cli_interpreter_display_prompt_p,  /* prompt_proc_p */
+    cli_command_loop,
+    // cli_interpreter_complete
+  };
+  struct ui_out *tmp_ui_out;
+  struct ui_file *raw_stdout;
+  
   /* Create a default uiout builder for the CLI.  */
   cli_uiout = cli_out_new (gdb_stdout);
   cli_interp = interp_new (INTERP_CONSOLE, NULL, cli_uiout, &procs);
 
   interp_add (cli_interp);
+
+  raw_stdout = stdio_fileopen (stdout);
+  tmp_ui_out = cli_quoted_out_new (raw_stdout);
+  cli_interp = interp_new ("console-quoted", NULL, tmp_ui_out,
+                          &quoted_procs);
+  interp_add (cli_interp); /* second call */
 }
index 1512a6a7bf3c57251dfdd710d78ba02843f2e48d..aa18f1c6db42880b980a394d97dbe4eec22b91c3 100644 (file)
@@ -725,6 +725,8 @@ extern struct continuation *cmd_continuation;
 /* Used only by the step_1 function. */
 extern struct continuation *intermediate_continuation;
 
+extern int gdb_mi_run_status;
+
 /* From utils.c */
 extern void add_continuation (void (*)(struct continuation_arg *),
                              struct continuation_arg *);
@@ -1100,12 +1102,16 @@ extern char *interpreter_p;
 struct target_waitstatus;
 struct cmd_list_element;
 
+extern int event_loop_p;
+
+typedef void *gdb_client_data;
+
 extern void (*deprecated_pre_add_symbol_hook) (const char *);
 extern void (*deprecated_post_add_symbol_hook) (void);
 extern void (*selected_frame_level_changed_hook) (int);
 extern int (*deprecated_ui_loop_hook) (int signo);
 extern void (*deprecated_init_ui_hook) (char *argv0);
-extern void (*deprecated_command_loop_hook) (void);
+extern void (*deprecated_command_loop_hook) (void* data);
 extern void (*deprecated_show_load_progress) (const char *section,
                                              unsigned long section_sent, 
                                              unsigned long section_size, 
@@ -1132,7 +1138,8 @@ extern void (*deprecated_register_changed_hook) (int regno);
 extern void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len);
 extern void (*deprecated_context_hook) (int);
 extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
-                                         struct target_waitstatus * status);
+                                             struct target_waitstatus * status,
+                                             gdb_client_data client_data);
 
 extern void (*deprecated_attach_hook) (void);
 extern void (*deprecated_detach_hook) (void);
index 671528f25b4ea8edd0254c0d730ee49e47cd31a8..2065ab6770cdd35a705d7304f177024e47531c36 100644 (file)
@@ -41,7 +41,8 @@
 #include "gdb_select.h"
 
 typedef struct gdb_event gdb_event;
-typedef void (event_handler_func) (int);
+
+/* async make globally visible */
 
 /* Event for the GDB event system.  Events are queued by calling
    async_queue_event and serviced later on by gdb_do_one_event. An
@@ -49,15 +50,21 @@ typedef void (event_handler_func) (int);
    read. Servicing an event simply means that the procedure PROC will
    be called.  We have 2 queues, one for file handlers that we listen
    to in the event loop, and one for the file handlers+events that are
-   ready. The procedure PROC associated with each event is always the
-   same (handle_file_event).  Its duty is to invoke the handler
-   associated with the file descriptor whose state change generated
-   the event, plus doing other cleanups and such. */
+   APPLE LOCAL begin async
+   ready. 
+
+   File events are all handled through the procedure
+   handle_file_event.  Its duty is to invoke the handler associated
+   with the file descriptor whose state change generated the event,
+   plus doing other cleanups and such. 
+
+   Other event types can be created, and added to the event queue by
+   using gdb_queue_event.  */
 
 struct gdb_event
   {
     event_handler_func *proc;  /* Procedure to call to service this event. */
-    int fd;                    /* File descriptor that is ready. */
+    void *data;                        /* The data for this event */
     struct gdb_event *next_event;      /* Next in list of events or NULL. */
   };
 
@@ -134,7 +141,8 @@ event_queue;
 #define USE_POLL 0
 #endif /* HAVE_POLL */
 
-static unsigned char use_poll = USE_POLL;
+//static unsigned char use_poll = USE_POLL;
+static unsigned char use_poll = 0;
 
 #ifdef USE_WIN32API
 #include <windows.h>
@@ -217,15 +225,26 @@ static int async_handler_ready = 0;
 
 static void create_file_handler (int fd, int mask, handler_func * proc, gdb_client_data client_data);
 static void invoke_async_signal_handler (void);
-static void handle_file_event (int event_file_desc);
+static void handle_file_event (void *data);
 static int gdb_wait_for_event (void);
 static int check_async_ready (void);
-static void async_queue_event (gdb_event * event_ptr, queue_position position);
+void async_queue_event (gdb_event * event_ptr, queue_position position);
+int sigint_taken_p(void);
+static gdb_event *gdb_create_event (event_handler_func proc, void *data);
 static gdb_event *create_file_event (int fd);
 static int process_event (void);
-static void handle_timer_event (int dummy);
+static void handle_timer_event (void *dummy);
 static void poll_timers (void);
 \f
+void
+gdb_queue_event (event_handler_func proc, void *data, queue_position position)
+{
+  gdb_event *new_event;
+
+  new_event = gdb_create_event (proc, data);
+  async_queue_event (new_event, position);
+
+}
 
 /* Insert an event object into the gdb event queue at 
    the specified position.
@@ -237,7 +256,7 @@ static void poll_timers (void);
    events inserted at the head of the queue will be processed
    as last in first out. Event appended at the tail of the queue
    will be processed first in first out. */
-static void
+void
 async_queue_event (gdb_event * event_ptr, queue_position position)
 {
   if (position == TAIL)
@@ -261,6 +280,17 @@ async_queue_event (gdb_event * event_ptr, queue_position position)
       event_queue.first_event = event_ptr;
     }
 }
+static gdb_event *
+gdb_create_event (event_handler_func proc, void *data)
+{
+  gdb_event *new_event;
+  
+  new_event = (gdb_event *) xmalloc (sizeof (gdb_event));
+  new_event->proc = proc;
+  new_event->data = data;
+
+  return new_event;
+}
 
 /* Create a file event, to be enqueued in the event queue for
    processing. The procedure associated to this event is always
@@ -269,12 +299,7 @@ async_queue_event (gdb_event * event_ptr, queue_position position)
 static gdb_event *
 create_file_event (int fd)
 {
-  gdb_event *file_event_ptr;
-
-  file_event_ptr = (gdb_event *) xmalloc (sizeof (gdb_event));
-  file_event_ptr->proc = handle_file_event;
-  file_event_ptr->fd = fd;
-  return (file_event_ptr);
+  return gdb_create_event (handle_file_event, (void *) fd);
 }
 
 /* Process one event.
@@ -291,7 +316,7 @@ process_event (void)
 {
   gdb_event *event_ptr, *prev_ptr;
   event_handler_func *proc;
-  int fd;
+  void *data;
 
   /* First let's see if there are any asynchronous event handlers that
      are ready. These would be the result of invoking any of the
@@ -312,7 +337,7 @@ process_event (void)
       /* Call the handler for the event. */
 
       proc = event_ptr->proc;
-      fd = event_ptr->fd;
+      data = event_ptr->data;
 
       /* Let's get rid of the event from the event queue.  We need to
          do this now because while processing the event, the proc
@@ -340,7 +365,7 @@ process_event (void)
       xfree (event_ptr);
 
       /* Now call the procedure associated with the event. */
-      (*proc) (fd);
+      (*proc) (data);
       return 1;
     }
 
@@ -657,8 +682,9 @@ delete_file_handler (int fd)
    through event_ptr->proc.  EVENT_FILE_DESC is file descriptor of the
    event in the front of the event queue. */
 static void
-handle_file_event (int event_file_desc)
+handle_file_event (void *data)
 {
+  int event_file_desc = (int) data;
   file_handler *file_ptr;
   int mask;
 #ifdef HAVE_POLL
@@ -1074,7 +1100,7 @@ delete_timer (int id)
    timer event from the event queue. Repeat this for each timer that
    has expired. */
 static void
-handle_timer_event (int dummy)
+handle_timer_event (void *dummy)
 {
   struct timeval time_now;
   struct gdb_timer *timer_ptr, *saved_timer;
@@ -1140,7 +1166,7 @@ poll_timers (void)
        {
          event_ptr = (gdb_event *) xmalloc (sizeof (gdb_event));
          event_ptr->proc = handle_timer_event;
-         event_ptr->fd = timer_list.first_timer->timer_id;
+         event_ptr->data = (void *) timer_list.first_timer->timer_id;
          async_queue_event (event_ptr, TAIL);
        }
 
index 95b9f846f4aea3eb1b85f82aa985f5c6a8532852..dd1bb94c521ee6f73bab4a0141b7f4ce6089b2c4 100644 (file)
@@ -57,7 +57,9 @@
 
    Corollary tasks are the creation and deletion of event sources. */
 
-typedef void *gdb_client_data;
+#ifndef EVENT_LOOP__H
+#define EVENT_LOOP__H
+
 struct async_signal_handler;
 typedef void (handler_func) (int, gdb_client_data);
 typedef void (sig_handler_func) (gdb_client_data);
@@ -94,3 +96,8 @@ extern struct async_signal_handler *
 extern void delete_async_signal_handler (struct async_signal_handler **async_handler_ptr);
 extern int create_timer (int milliseconds, timer_handler_func * proc, gdb_client_data client_data);
 extern void delete_timer (int id);
+
+typedef void (event_handler_func) (void *);
+extern void gdb_queue_event (event_handler_func proc, void *data, queue_position position);
+
+#endif /* #ifndef EVENT_LOOP__H */
index 635ce0fdc5de3fdd2f7d435211e7681d375f30e4..06deefb1354d9dece74adf52e88a21e94a8e450c 100644 (file)
@@ -183,7 +183,7 @@ rl_callback_read_char_wrapper (gdb_client_data client_data)
 /* Initialize all the necessary variables, start the event loop,
    register readline, and stdin, start the loop. */
 void
-cli_command_loop (void)
+cli_command_loop (void *data /* unused */)
 {
   int length;
   char *a_prompt;
@@ -259,6 +259,7 @@ display_gdb_prompt (char *new_prompt)
 {
   int prompt_length = 0;
   char *gdb_prompt = get_prompt ();
+  static int stdin_handler_removed = 0;
 
   /* Each interpreter has its own rules on displaying the command
      prompt.  */
@@ -282,6 +283,8 @@ display_gdb_prompt (char *new_prompt)
          between the calls to the above two functions.
          Calling rl_callback_handler_remove(), does the job. */
 
+      delete_file_handler (input_fd);
+      stdin_handler_removed = 1;
       rl_callback_handler_remove ();
       return;
     }
@@ -305,6 +308,20 @@ display_gdb_prompt (char *new_prompt)
 
   if (async_command_editing_p)
     {
+      /* Claim the terminal before we reset it.  It is quick if the
+        terminal is already ours, and if not, we are going to lose
+        when we try to install the callback handler otherwise.  We
+        can get here with the terminal still belonging to the
+        inferior if it dies an unexpected death, and somebody forgets
+        to clean up properly.  Better safe than sorry... */
+
+      target_terminal_ours ();
+      if (stdin_handler_removed)
+       {
+         add_file_handler (input_fd, stdin_event_handler, 0);
+         stdin_handler_removed = 0;
+       }
+
       rl_callback_handler_remove ();
       rl_callback_handler_install (new_prompt, input_handler);
     }
@@ -430,18 +447,37 @@ stdin_event_handler (int error, gdb_client_data client_data)
 
 /* Re-enable stdin after the end of an execution command in
    synchronous mode, or after an error from the target, and we aborted
-   the exec operation. */
+   the exec operation. 
+   One tricky point here.  We want to be careful not to stack up
+   enables & disables.  This is because we can run the inferior many
+   times in one execution command (for instance if a breakpoint command
+   restarts the inferior).  And it is not possible a-priori to know when
+   we find that the inferior has been restarted whether 
+   async_disable_stdin has been called (and thus whether we should re-enable
+   it).  If we just make sure that we only do things one level deep here,
+   it removes the bookkeeping from callers, which is much better.
+*/
+
+int stdin_enabled = 1;
 
 void
 async_enable_stdin (void *dummy)
 {
+  if (stdin_enabled)
+    return;
+
+  stdin_enabled = 1; 
+
   /* See NOTE in async_disable_stdin() */
   /* FIXME: cagney/1999-09-27: Call this before clearing
      sync_execution.  Current target_terminal_ours() implementations
      check for sync_execution before switching the terminal. */
   target_terminal_ours ();
   pop_prompt ();
-  sync_execution = 0;
+  /* This is bogus...  We shouldn't have to lie about the type of
+     execution in order to implement the terminal_ours...
+     sync_execution = 0;
+  */
 }
 
 /* Disable reads from stdin (the console) marking the command as
@@ -450,7 +486,15 @@ async_enable_stdin (void *dummy)
 void
 async_disable_stdin (void)
 {
-  sync_execution = 1;
+
+  if (!stdin_enabled)
+    return;
+
+  stdin_enabled = 0;
+
+  /* Just don't do this...
+     sync_execution = 1; */
+
   push_prompt ("", "", "");
   /* FIXME: cagney/1999-09-27: At present this call is technically
      redundant since infcmd.c and infrun.c both already call
@@ -954,6 +998,16 @@ handle_sigint (int sig)
 {
   signal (sig, handle_sigint);
 
+  /* We used to set the quit flag in async_request_quit, which is either
+     called when immediate_quit is 1, or when we get back to the event
+     loop.  This is wrong, because you could be running in a loop reading
+     in symfiles or something, and it could be quite a while before you 
+     get to the event loop.  Instead, set quit_flag to 1 here, then mark
+     the sigint handler as ready.  Then if somebody calls QUIT before you
+     get to the event loop, they will unwind as expected.  */
+
+  quit_flag = 1;
+
   /* If immediate_quit is set, we go ahead and process the SIGINT right
      away, even if we usually would defer this to the event loop. The
      assumption here is that it is safe to process ^C immediately if
@@ -982,7 +1036,14 @@ handle_sigterm (int sig)
 void
 async_request_quit (gdb_client_data arg)
 {
-  quit_flag = 1;
+  /* If the quit_flag has gotten reset back to 0 by the time we get
+     back here, that means that an exception was thrown to unwind
+     the current command before we got back to the event loop.  So
+     there is no reason to call quit again here. */
+
+  if (quit_flag == 0)
+    return;
+
   quit ();
 }
 
@@ -1127,8 +1188,17 @@ gdb_setup_readline (void)
      that the sync setup is ALL done in gdb_init, and we would only
      mess it up here.  The sync stuff should really go away over
      time.  */
+
+  /* Note also that if instream == NULL, then we don't want to setup
+     readline even IF event_loop_p is true, because we don't have an
+     input source for events yet.  This usually only happens if a
+     command is run in the .gdbinit file. */
+
   extern int batch_silent;
 
+  if (instream == NULL)
+    return;
+
   if (!batch_silent)
     gdb_stdout = stdio_fileopen (stdout);
   gdb_stderr = stdio_fileopen (stderr);
@@ -1197,3 +1267,16 @@ gdb_disable_readline (void)
   rl_callback_handler_remove ();
   delete_file_handler (input_fd);
 }
+
+/* Don't set up readline now, this is better done in the interpreter's
+   resume method, since we will have to do this coming back & forth
+   among interpreters anyway... */
+
+void
+_initialize_event_loop (void)
+{
+  /* Tell gdb to use the cli_command_loop as the main loop. */
+
+  if (deprecated_command_loop_hook == NULL)
+    deprecated_command_loop_hook = cli_command_loop;
+}
index f62b177f6b8ff459674699e4f049ee6cc2fa221e..c21b69d4c7264a7de6bfee3be8d79362926bcb87 100644 (file)
@@ -120,6 +120,6 @@ extern void (*input_handler) (char *);
 extern int input_fd;
 extern void (*after_char_processing_hook) (void);
 
-extern void cli_command_loop (void);
+extern void cli_command_loop (void *data);
 
 #endif
index 7bd2ccd5734083e3db919de8e92f2411a7063687..2aa1016be65a16d8dbe8df9a3762813b9db00087 100644 (file)
@@ -33,6 +33,8 @@
 #include "value.h"
 #include "exec.h"
 #include "observer.h"
+#include "event-loop.h"
+#include "async-nat-inferior.h"
 
 #include <fcntl.h>
 #include "readline/readline.h"
 
 #include "xcoffsolib.h"
 
+static void
+async_file_handler (int error, gdb_client_data client_data)
+{
+  async_client_callback (INF_REG_EVENT, async_client_context);
+}
+
+static void
+standard_async (void (*callback) (enum inferior_event_type event_type, 
+                                 void *context), void *context)
+{
+  if (current_target.to_async_mask_value == 0)
+    internal_error (__FILE__, __LINE__,
+                    "Calling remote_async when async is masked");
+
+  if (callback != NULL)
+    {
+      async_client_callback = callback;
+      async_client_context = context;
+      if (gdb_status->signal_status.receive_fd > 0)
+        add_file_handler (gdb_status->signal_status.receive_fd,
+                          async_file_handler, NULL);
+    }
+  else
+    {
+      if (gdb_status->signal_status.receive_fd > 0)
+        delete_file_handler (gdb_status->signal_status.receive_fd);
+    }
+  return;
+}
+
+int standard_is_async_p (void)
+{
+  return (current_target.to_async_mask_value);
+}
+
+int standard_can_async_p (void)
+{
+  return (current_target.to_async_mask_value);
+}
+
 struct vmap *map_vmap (bfd *, bfd *);
 
 void (*deprecated_file_changed_hook) (char *);
@@ -730,6 +772,16 @@ Specify the filename of the executable file.";
   exec_ops.to_has_memory = 1;
   exec_ops.to_make_corefile_notes = exec_make_note_section;
   exec_ops.to_magic = OPS_MAGIC;
+
+  if (event_loop_p)
+    {
+      exec_ops.to_can_async_p = standard_can_async_p;
+      exec_ops.to_is_async_p = standard_is_async_p;
+      exec_ops.to_async = standard_async;
+      exec_ops.to_async_mask_value = 1;
+      exec_ops.to_terminal_inferior = async_terminal_inferior;
+      exec_ops.to_terminal_ours = async_terminal_ours;
+    }
 }
 
 void
index 05501e214e32fb9c92c433053fd405c71ceb69c8..09f63bcea7e727a706996f5166cc507c1b3f8f61 100644 (file)
@@ -26,6 +26,8 @@
 #include "regcache.h"
 #include "target.h"
 #include "linux-nat.h"
+#include "inf-loop.h"
+#include "async-nat-inferior.h"
 
 #include "gdb_assert.h"
 #include "gdb_string.h"
@@ -763,6 +765,8 @@ i386_linux_resume (ptid_t ptid, int step, enum target_signal signal)
 
   int request = PTRACE_CONT;
 
+  struct target_waitstatus status;
+
   if (pid == -1)
     /* Resume all threads.  */
     /* I think this only gets used in the non-threaded case, where "resume
@@ -813,6 +817,23 @@ i386_linux_resume (ptid_t ptid, int step, enum target_signal signal)
 
   if (ptrace (request, pid, 0, target_signal_to_host (signal)) == -1)
     perror_with_name (("ptrace"));
+
+  status.kind = TARGET_WAITKIND_SPURIOUS;
+  gdb_process_events (gdb_status, &status, 0, 0);
+
+  if (gdb_post_pending_event ())
+    {
+      /* QUESTION: Do I need to lie about target_executing here? */
+      if (target_is_async_p ())
+        target_executing = 1;
+      return;
+    }
+
+  if (target_can_async_p ())
+    target_async (inferior_event_handler, 0);
+
+  if (target_is_async_p ())
+    target_executing = 1;
 }
 
 static void (*super_post_startup_inferior) (ptid_t ptid);
index a98998f2e07400148f7df5e3e7dfcb73c0ec7e3a..29d59e92025d5f6000d13a9d67a1db95cec99982 100644 (file)
@@ -28,6 +28,7 @@
 #include "target.h"
 #include "inferior.h"
 #include "gdb_string.h"
+#include "async-nat-inferior.h"
 
 /* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
    for all registers.  */
@@ -193,10 +194,10 @@ inf_child_target (void)
   t->to_insert_breakpoint = memory_insert_breakpoint;
   t->to_remove_breakpoint = memory_remove_breakpoint;
   t->to_terminal_init = terminal_init_inferior;
-  t->to_terminal_inferior = terminal_inferior;
+  t->to_terminal_inferior = async_terminal_inferior;
   t->to_terminal_ours_for_output = terminal_ours_for_output;
   t->to_terminal_save_ours = terminal_save_ours;
-  t->to_terminal_ours = terminal_ours;
+  t->to_terminal_ours = async_terminal_ours;
   t->to_terminal_info = child_terminal_info;
   t->to_post_startup_inferior = inf_child_post_startup_inferior;
   t->to_acknowledge_created_inferior = inf_child_acknowledge_created_inferior;
index 04989a2478eafe7bf5f8cbe5c09e2362d19c45ca..9011a363693a0000797544208af7debd1aefbb2e 100644 (file)
@@ -52,7 +52,7 @@ inferior_event_handler (enum inferior_event_type event_type,
       target_async (NULL, 0);
       pop_target ();
       discard_all_continuations ();
-      do_exec_error_cleanups (ALL_CLEANUPS);
+
       break;
 
     case INF_REG_EVENT:
@@ -64,19 +64,48 @@ inferior_event_handler (enum inferior_event_type event_type,
                         client_data, "", RETURN_MASK_ALL))
        {
          target_async (NULL, 0);
-         pop_target ();
+         /* pop_target (); */
          discard_all_continuations ();
          do_exec_error_cleanups (ALL_CLEANUPS);
+          /* FIXME: We don't really have enough information to know
+             what happened to the inferior here.  However, we are
+             treating it like the target is not running, so we better
+             set target_executing to 0 or we will get into lots of
+             trouble later on...  Most of the time, this is in fact
+             the case.  For instance, we messed up in insert_breakpoints
+             and errored out to here.  */
+
+          target_executing = 0;          
          display_gdb_prompt (0);
        }
       break;
 
     case INF_EXEC_COMPLETE:
       /* Is there anything left to do for the command issued to
-         complete? */
-      do_all_continuations ();
-      /* Reset things after target has stopped for the async commands. */
+         complete? 
+        One tricky point.  The continuations may start the inferior
+        going again.  So we do complete_execution before running
+        them, and then print the prompt afterwards if we haven't
+        gotten started again.
+      */
+      target_executing = 0;
       complete_execution ();
+      
+      do_all_continuations ();
+      /* Reset things after target has stopped for the async commands. 
+       */
+      if (!target_executing)
+       {
+         if (sync_execution) 
+           {
+             display_gdb_prompt (0);
+           }
+         else
+           {
+             if (exec_done_display_p)
+               printf_unfiltered ("completed.\n");
+           }
+       }
       break;
 
     case INF_EXEC_CONTINUE:
@@ -123,11 +152,6 @@ complete_execution (void)
   if (sync_execution)
     {
       do_exec_error_cleanups (ALL_CLEANUPS);
-      display_gdb_prompt (0);
-    }
-  else
-    {
-      if (exec_done_display_p)
-       printf_unfiltered (_("completed.\n"));
+      /* Remove chatty code.  */
     }
 }
index bccca0d7dc901a8cc2e99999087b59d391c423c5..5cb0b4d056758c73125741eea825d48cb69ddefe 100644 (file)
@@ -41,6 +41,7 @@
 #include "top.h"
 #include <signal.h>
 #include "inf-loop.h"
+#include "event-top.h"
 #include "regcache.h"
 #include "value.h"
 #include "observer.h"
@@ -100,7 +101,7 @@ show_step_stop_if_no_debug (struct ui_file *file, int from_tty,
 
 /* In asynchronous mode, but simulating synchronous execution. */
 
-int sync_execution = 0;
+int sync_execution = 1;
 
 /* wait_for_inferior and normal_stop use this to notify the user
    when the inferior stopped in a different thread than it had been
@@ -825,6 +826,8 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
     {
       wait_for_inferior ();
       normal_stop ();
+      /* Why doesn't normal_stop set target_executing to 0?  */
+      target_executing = 0;
     }
 }
 \f
@@ -993,9 +996,10 @@ wait_for_inferior (void)
   while (1)
     {
       if (deprecated_target_wait_hook)
-       ecs->ptid = deprecated_target_wait_hook (ecs->waiton_ptid, ecs->wp);
+       ecs->ptid =
+         deprecated_target_wait_hook (ecs->waiton_ptid, ecs->wp, NULL);
       else
-       ecs->ptid = target_wait (ecs->waiton_ptid, ecs->wp);
+       ecs->ptid = target_wait (ecs->waiton_ptid, ecs->wp, NULL);
 
       /* Now figure out what to do with the result of the result.  */
       handle_inferior_event (ecs);
@@ -1049,9 +1053,10 @@ fetch_inferior_event (void *client_data)
 
   if (deprecated_target_wait_hook)
     async_ecs->ptid =
-      deprecated_target_wait_hook (async_ecs->waiton_ptid, async_ecs->wp);
+      deprecated_target_wait_hook (async_ecs->waiton_ptid, async_ecs->wp, client_data);
   else
-    async_ecs->ptid = target_wait (async_ecs->waiton_ptid, async_ecs->wp);
+    async_ecs->ptid =
+      target_wait (async_ecs->waiton_ptid, async_ecs->wp, client_data);
 
   /* Now figure out what to do with the result of the result.  */
   handle_inferior_event (async_ecs);
@@ -2143,7 +2148,10 @@ process_event_stop_test:
       case BPSTAT_WHAT_CHECK_SHLIBS:
       case BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK:
        {
-          if (debug_infrun)
+         int was_sync_execution = 0;
+         int solib_changed = 0;
+
+         if (debug_infrun)
            fprintf_unfiltered (gdb_stdlog, "infrun: BPSTATE_WHAT_CHECK_SHLIBS\n");
          /* Remove breakpoints, we eventually want to step over the
             shlib event breakpoint, and SOLIB_ADD might adjust
@@ -2156,6 +2164,10 @@ process_event_stop_test:
             supposed to be adding them automatically.  Switch
             terminal for any messages produced by
             breakpoint_re_set.  */
+         /*  Also, the error handlers for breakpoint_re_set may have
+             run async_enable_stdin, which is not appropriate in this
+             case.  Run it again just in case...  */
+         was_sync_execution = sync_execution;
          target_terminal_ours_for_output ();
          /* NOTE: cagney/2003-11-25: Make certain that the target
             stack's section table is kept up-to-date.  Architectures,
@@ -2177,6 +2189,8 @@ process_event_stop_test:
 #else
          solib_add (NULL, 0, &current_target, auto_solib_add);
 #endif
+         if (was_sync_execution && !sync_execution)
+           async_disable_stdin();
          target_terminal_inferior ();
 
          /* Try to reenable shared library breakpoints, additional
index a1b04926c01e5159f1902b44177b4606adb8e277..d1075594b1e6e385c9e8ea305e7595f7c555afba 100644 (file)
@@ -123,11 +123,11 @@ interp_add (struct interp *interp)
 
 /* This sets the current interpreter to be INTERP.  If INTERP has not
    been initialized, then this will also run the init proc.  If the
-   init proc is successful, return 1, if it fails, set the old
-   interpreter back in place and return 0.  If we can't restore the
-   old interpreter, then raise an internal error, since we are in
-   pretty bad shape at this point. */
-int
+   init proc is successful, return a pointer to the old interp.  If we
+   can't restore the old interpreter, then raise an internal error,
+   since we are in pretty bad shape at this point. */
+
+struct interp *
 interp_set (struct interp *interp)
 {
   struct interp *old_interp = current_interpreter;
@@ -138,7 +138,12 @@ interp_set (struct interp *interp)
 
   if (current_interpreter != NULL)
     {
+      /* APPLE LOCAL: Don't do this, you can't be sure there are no
+        continuations from the enclosing interpreter which should
+        really be run when that interpreter is in force. */
+#if 0
       do_all_continuations ();
+#endif
       ui_out_flush (uiout);
       if (current_interpreter->procs->suspend_proc
          && !current_interpreter->procs->suspend_proc (current_interpreter->
@@ -169,6 +174,9 @@ interp_set (struct interp *interp)
 
   /* Run the init proc.  If it fails, try to restore the old interp. */
 
+  /* APPLE LOCAL: FIXME: Keith cut restoring the old interp, but didn't
+     change the comment to reflect this.  */
+
   if (!interp->inited)
     {
       if (interp->procs->init_proc != NULL)
@@ -178,8 +186,14 @@ interp_set (struct interp *interp)
       interp->inited = 1;
     }
 
+  /* APPLE LOCAL: I don't think we want to clear the parent interpreter's
+     The parent interpreter may want to be able to snoop on the child
+     interpreter through them.  */
+
+#if 0
   /* Clear out any installed interpreter hooks/event handlers.  */
   clear_interpreter_hooks ();
+#endif
 
   if (interp->procs->resume_proc != NULL
       && (!interp->procs->resume_proc (interp->data)))
@@ -188,7 +202,7 @@ interp_set (struct interp *interp)
        internal_error (__FILE__, __LINE__,
                        _("Failed to initialize new interp \"%s\" %s"),
                        interp->name, "and could not restore old interp!\n");
-      return 0;
+      return NULL;
     }
 
   /* Finally, put up the new prompt to show that we are indeed here. 
@@ -206,7 +220,13 @@ interp_set (struct interp *interp)
       display_gdb_prompt (NULL);
     }
 
-  return 1;
+  /* If there wasn't any interp before, return the current interp.  
+     That way if somebody is grabbing the return value and using
+     it, it will actually work first time through.  */
+  if (old_interp == NULL)
+    return current_interpreter;
+  else
+    return old_interp;
 }
 
 /* interp_lookup - Looks up the interpreter for NAME.  If no such
@@ -272,12 +292,12 @@ current_interp_command_loop (void)
      selecting the command loop.  `deprecated_command_loop_hook'
      should be deprecated.  */
   if (deprecated_command_loop_hook != NULL)
-    deprecated_command_loop_hook ();
+    deprecated_command_loop_hook (NULL);
   else if (current_interpreter != NULL
           && current_interpreter->procs->command_loop_proc != NULL)
     current_interpreter->procs->command_loop_proc (current_interpreter->data);
   else
-    cli_command_loop ();
+    cli_command_loop (NULL);
 }
 
 int
@@ -289,7 +309,7 @@ interp_quiet_p (struct interp *interp)
     return current_interpreter->quiet_p;
 }
 
-static int
+int
 interp_set_quiet (struct interp *interp, int quiet)
 {
   int old_val = interp->quiet_p;
index 36590c215d42bcd2b95f093adffec6b88d19879f..4b599906198fd37389e1f98184c0e9ac8e3e4cf0 100644 (file)
@@ -59,7 +59,8 @@ extern struct interp *interp_new (const char *name, void *data,
                                  struct ui_out *uiout,
                                  const struct interp_procs *procs);
 extern void interp_add (struct interp *interp);
-extern int interp_set (struct interp *interp);
+extern struct interp * interp_set (struct interp *interp);
+extern int interp_set_quiet (struct interp *interp, int quiet);
 extern struct interp *interp_lookup (const char *name);
 extern struct ui_out *interp_ui_out (struct interp *interp);
 
index 8c081df268434e2d06c59b19a6e578159bc8210b..db4971305ca193e6cd37a96e81d591a4f23d3856 100644 (file)
@@ -927,14 +927,14 @@ check_event (ptid_t ptid)
 }
 
 static ptid_t
-thread_db_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
+thread_db_wait (ptid_t ptid, struct target_waitstatus *ourstatus, gdb_client_data client_data)
 {
   extern ptid_t trap_ptid;
 
   if (GET_PID (ptid) != -1 && is_thread (ptid))
     ptid = lwp_from_thread (ptid);
 
-  ptid = target_beneath->to_wait (ptid, ourstatus);
+  ptid = target_beneath->to_wait (ptid, ourstatus, NULL);
 
   if (proc_handle.pid == 0)
     /* The current child process isn't the actual multi-threaded
index 8a11f176b7564b84b4dcd40ffead661d93bbc9b0..6830d232d0e3ea63311d2c87ceb8d05f8b79aef2 100644 (file)
@@ -50,6 +50,12 @@ int display_time;
 
 int display_space;
 
+/* Whether this is the async version or not.  The async version is
+   invoked on the command line with the -nw --async options.  In this
+   version, the usual command_loop is substituted by and event loop which
+   processes UI events asynchronously. */
+int event_loop_p = 0;
+
 /* The selected interpreter.  This will be used as a set command
    variable, so it should always be malloc'ed - since
    do_setshow_command will free it. */
@@ -257,6 +263,8 @@ captured_main (void *data)
     };
     static struct option long_options[] =
     {
+      {"async", no_argument, &event_loop_p, 1},
+      {"noasync", no_argument, &event_loop_p, 0},
 #if defined(TUI)
       {"tui", no_argument, 0, OPT_TUI},
 #endif
@@ -862,6 +870,9 @@ Options:\n\n\
 "), stream);
   fputs_unfiltered (_("\
   --args             Arguments after executable-file are passed to inferior\n\
+"), stream);
+  fputs_unfiltered (_("\
+  --[no]async        Enable (disable) asynchronous version of CLI\n\
 "), stream);
   fputs_unfiltered (_("\
   -b BAUDRATE        Set serial port baud rate used for remote debugging.\n\
index a83316b0cbb2636f48760a12c3305968bdfeba24..d9a937ff8f7d623caf286a7ef161997e078be02a 100644 (file)
@@ -58,9 +58,9 @@ static void mi_command_loop (int mi_version);
 static int mi_interp_query_hook (const char *ctlstr, va_list ap)
      ATTR_FORMAT (printf, 1, 0);
 
-static void mi3_command_loop (void);
-static void mi2_command_loop (void);
-static void mi1_command_loop (void);
+static void mi3_command_loop (void* data);
+static void mi2_command_loop (void* data);
+static void mi1_command_loop (void* data);
 
 static void mi_insert_notify_hooks (void);
 static void mi_remove_notify_hooks (void);
@@ -165,32 +165,14 @@ mi_interpreter_prompt_p (void *data)
   return 0;
 }
 
-static void
-mi_interpreter_exec_continuation (struct continuation_arg *arg)
-{
-  bpstat_do_actions (&stop_bpstat);
-  if (!target_executing)
-    {
-      fputs_unfiltered ("*stopped", raw_stdout);
-      mi_out_put (uiout, raw_stdout);
-      fputs_unfiltered ("\n", raw_stdout);
-      fputs_unfiltered ("(gdb) \n", raw_stdout);
-      gdb_flush (raw_stdout);
-      do_exec_cleanups (ALL_CLEANUPS);
-    }
-  else if (target_can_async_p ())
-    {
-      add_continuation (mi_interpreter_exec_continuation, NULL);
-    }
-}
-
 enum mi_cmd_result
 mi_cmd_interpreter_exec (char *command, char **argv, int argc)
 {
   struct interp *interp_to_use;
+  struct interp *old_interp;
   enum mi_cmd_result result = MI_CMD_DONE;
   int i;
-  struct interp_procs *procs;
+  int old_quiet;
 
   if (argc < 2)
     {
@@ -211,11 +193,34 @@ mi_cmd_interpreter_exec (char *command, char **argv, int argc)
                                     argv[0]);
       return MI_CMD_ERROR;
     }
+  
+  old_quiet = interp_set_quiet (interp_to_use, 1);
+
+  old_interp = interp_set (interp_to_use); 
+  if (old_interp == NULL)
+    {
+      asprintf (&mi_error_message,
+                "Could not switch to interpreter \"%s\".", argv[0]);
+      return MI_CMD_ERROR;
+    }  
+  
+  /* Set the global mi_interp.  We need this so that the hook functions
+     can leave their results in the mi interpreter, rather than dumping
+     them to the console.  */
+  mi_interp = old_interp;
 
   /* Insert the MI out hooks, making sure to also call the interpreter's hooks
      if it has any. */
   /* KRS: We shouldn't need this... Events should be installed and they should
      just ALWAYS fire something out down the MI channel... */
+
+  /* APPLE LOCAL: I disagree, how do we know the mi is going to always
+     be the parent interpreter for whatever child interpreter we are
+     running?  The only reason this works in the FSF version is that
+     they don't actually switch interpreters, they just hack the
+     cli_exec command so it knows how to set just enough of itself not
+     to get in the mi's way, which seems a little hacky to me.  */
+
   mi_insert_notify_hooks ();
 
   /* Now run the code... */
@@ -254,18 +259,35 @@ mi_cmd_interpreter_exec (char *command, char **argv, int argc)
       sync_execution = 0;
     }
 
+  /* Now do the switch */
+  interp_set (old_interp);
+  mi_interp = NULL;
+
   mi_remove_notify_hooks ();
+  interp_set_quiet (interp_to_use, old_quiet);
 
   /* Okay, now let's see if the command set the inferior going...
      Tricky point - have to do this AFTER resetting the interpreter, since
      changing the interpreter will clear out all the continuations for
      that interpreter... */
-
-  if (target_can_async_p () && target_executing)
+  
+  /* APPLE LOCAL: The FSF version leaves out the 
+     mi_dont_register_continuation.  Maybe this hadn't been added yet when
+     they adopted the code.  */
+  
+  if (target_can_async_p () && target_executing
+      && !mi_dont_register_continuation)
     {
+      struct mi_continuation_arg *cont_args =
+        mi_setup_continuation_arg (NULL);
+      
+      if (current_command_token)
+        fputs_unfiltered (current_command_token, raw_stdout);
+      
       fputs_unfiltered ("^running\n", raw_stdout);
-      add_continuation (mi_interpreter_exec_continuation, NULL);
-    }
+      add_continuation (mi_interpreter_exec_continuation,
+                        (void *) cont_args);
+    }  
 
   return result;
 }
@@ -303,19 +325,19 @@ mi_execute_command_wrapper (char *cmd)
 }
 
 static void
-mi1_command_loop (void)
+mi1_command_loop (void* data)
 {
   mi_command_loop (1);
 }
 
 static void
-mi2_command_loop (void)
+mi2_command_loop (void* data)
 {
   mi_command_loop (2);
 }
 
 static void
-mi3_command_loop (void)
+mi3_command_loop (void* data)
 {
   mi_command_loop (3);
 }
index c798c90b8fb544bda534e51070065b4f2651e96f..7437ecca83ddc516d6e4d05ace85ef2db50161c4 100644 (file)
@@ -45,6 +45,7 @@
 #include "regcache.h"
 #include "gdb.h"
 #include "frame.h"
+#include "wrapper.h"
 #include "mi-main.h"
 
 #include <ctype.h>
@@ -78,9 +79,33 @@ struct captured_mi_execute_command_args
   struct mi_parse *command;
 };
 
+struct mi_continuation_arg
+{
+  char *token;
+  struct mi_timestamp *timestamp;
+  struct cleanup *cleanups;
+};
+
+static void free_continuation_arg (struct mi_continuation_arg *arg);
+
 int mi_debug_p;
 struct ui_file *raw_stdout;
 
+/* A pointer to the current mi_parse's command token.  This is needed
+ because we can't pass the token down to the mi command levels.  This
+ will get cleaned up once captured_mi_execute_command finishes, so 
+ if you need it for a continuation, dup it.  */
+char *current_command_token;
+
+/* This is used to pass the current command timestamp
+   down to continuation routines. */
+//struct mi_timestamp *current_command_ts;
+
+//static int do_timings = 0;
+
+/* Points to the current interpreter, used by the mi context callbacks.  */
+struct interp *mi_interp;
+
 /* The token of the last asynchronous command */
 static char *last_async_command;
 static char *previous_async_command;
@@ -103,6 +128,13 @@ static int get_register (int regnum, int format);
    layer that calls libgdb.  Any operation used in the below should be
    formalized. */
 
+/*
+static void timestamp (struct mi_timestamp *tv);
+static void print_diff_now (struct mi_timestamp *start);
+static void copy_timestamp (struct mi_timestamp *dst, struct mi_timestamp *src);
+static void print_diff (struct mi_timestamp *start, struct mi_timestamp *end);
+*/
+
 enum mi_cmd_result
 mi_cmd_gdb_exit (char *command, char **argv, int argc)
 {
@@ -1147,6 +1179,77 @@ captured_mi_execute_command (struct ui_out *uiout, void *data)
   return;
 }
 
+void
+mi_interpreter_exec_continuation (struct continuation_arg *in_arg)
+{
+  struct mi_continuation_arg *arg 
+    = (struct mi_continuation_arg *) in_arg;
+
+  if (!target_executing) 
+    {
+      /* This is a little tricky because bpstat_do_actions can restart
+        the inferior.  So first say we have stopped, and flush the
+        output so we get the reason aligned correctly, then run the
+        breakpoint actions, and if they have restarted the inferior,
+        suppress the prompt. */
+
+      if (arg->cleanups != NULL)
+       do_exec_cleanups (arg->cleanups);
+
+      if (arg && arg->token)
+       fputs_unfiltered (arg->token, raw_stdout);
+
+      fputs_unfiltered ("*stopped", raw_stdout);
+      //      if (do_timings && arg && arg->timestamp)
+      //       print_diff_now (arg->timestamp);
+      mi_out_put (uiout, raw_stdout);
+      fputs_unfiltered ("\n", raw_stdout);
+      
+      /* Tricky point - we need to add this continuation 
+        before we run the actions, since one of the breakpoint commands
+        could have added a continuation, and ours would be in
+        front of theirs, and then the cleanups would be out of order. */
+
+      if (target_can_async_p()) 
+       {
+         //if (arg && arg->timestamp)
+         //  timestamp (arg->timestamp);
+         
+         add_continuation (mi_interpreter_exec_continuation, 
+                         (struct continuation_arg *) arg);
+       }
+
+      bpstat_do_actions (&stop_bpstat);
+      
+      if (!target_executing)
+       {
+         if (target_can_async_p ())
+           {
+             discard_all_continuations ();
+             free_continuation_arg (arg);
+           }
+         fputs_unfiltered ("(gdb) \n", raw_stdout);
+       }
+      else
+       {
+         ui_out_field_string (uiout, "reason", "breakpoint-command");
+         if (arg && arg->token)
+           fputs_unfiltered (arg->token, raw_stdout);
+         fputs_unfiltered ("*started", raw_stdout);
+         //if (do_timings && arg && arg->timestamp)
+         //  print_diff_now (arg->timestamp);
+         mi_out_put (uiout, raw_stdout);
+         fputs_unfiltered ("\n", raw_stdout);
+       }
+      
+      gdb_flush (raw_stdout);
+      
+    }
+  else if (target_can_async_p()) 
+    {
+      add_continuation (mi_interpreter_exec_continuation, in_arg);
+    }
+}
 
 void
 mi_execute_command (char *cmd, int from_tty)
@@ -1289,83 +1392,179 @@ mi_execute_cli_command (const char *cmd, int args_p, const char *args)
     }
 }
 
+
 enum mi_cmd_result
 mi_execute_async_cli_command (char *mi, char *args, int from_tty)
 {
-  struct cleanup *old_cleanups;
   char *run;
   char *async_args;
 
-  if (target_can_async_p ())
-    {
-      async_args = (char *) xmalloc (strlen (args) + 2);
-      make_exec_cleanup (free, async_args);
-      strcpy (async_args, args);
-      strcat (async_args, "&");
-      run = xstrprintf ("%s %s", mi, async_args);
-      make_exec_cleanup (free, run);
-      add_continuation (mi_exec_async_cli_cmd_continuation, NULL);
-      old_cleanups = NULL;
-    }
-  else
+  if (!target_can_async_p ())
     {
-      run = xstrprintf ("%s %s", mi, args);
+      struct cleanup *old_cleanups;
+      xasprintf (&run, "%s %s", mi, args);
       old_cleanups = make_cleanup (xfree, run);
-    }
 
-  if (!target_can_async_p ())
-    {
       /* NOTE: For synchronous targets asynchronous behavour is faked by
          printing out the GDB prompt before we even try to execute the
          command. */
-      if (last_async_command)
-       fputs_unfiltered (last_async_command, raw_stdout);
+      if (current_command_token)
+       fputs_unfiltered (current_command_token, raw_stdout);
       fputs_unfiltered ("^running\n", raw_stdout);
       fputs_unfiltered ("(gdb) \n", raw_stdout);
       gdb_flush (raw_stdout);
-    }
-  else
-    {
-      /* FIXME: cagney/1999-11-29: Printing this message before
-         calling execute_command is wrong.  It should only be printed
-         once gdb has confirmed that it really has managed to send a
-         run command to the target. */
-      if (last_async_command)
-       fputs_unfiltered (last_async_command, raw_stdout);
-      fputs_unfiltered ("^running\n", raw_stdout);
-    }
-
-  execute_command ( /*ui */ run, 0 /*from_tty */ );
+      
+      execute_command ( /*ui */ run, 0 /*from_tty */ );
 
-  if (!target_can_async_p ())
-    {
       /* Do this before doing any printing.  It would appear that some
          print code leaves garbage around in the buffer. */
       do_cleanups (old_cleanups);
       /* If the target was doing the operation synchronously we fake
          the stopped message. */
-      if (last_async_command)
-       fputs_unfiltered (last_async_command, raw_stdout);
+      if (current_command_token)
+        {
+         fputs_unfiltered (current_command_token, raw_stdout);
+        }
       fputs_unfiltered ("*stopped", raw_stdout);
       mi_out_put (uiout, raw_stdout);
       mi_out_rewind (uiout);
       fputs_unfiltered ("\n", raw_stdout);
+      //      if (current_command_ts)
+      //       print_diff_now (current_command_ts);
       return MI_CMD_QUIET;
     }
+  else
+    {
+      struct mi_continuation_arg *arg = NULL;
+      struct cleanup *old_cleanups = NULL;
+      volatile struct gdb_exception except;
+
+      async_args = (char *) xmalloc (strlen (args) + 2);
+      old_cleanups = make_cleanup (free, async_args);
+      strcpy (async_args, args);
+      strcat (async_args, "&");
+      xasprintf (&run, "%s %s", mi, async_args);
+      make_cleanup (free, run);
+
+      /* Transfer the command token to the continuation.  That
+        will now print the results associated with this command. 
+         Tricky point: have to add the continuation BEFORE running
+         execute_command, or it will get run before any continuations
+         that might get added by execute_command, in which case the
+         cleanups will be out of order. */
+      
+      arg = mi_setup_continuation_arg (NULL);
+      add_continuation (mi_exec_async_cli_cmd_continuation, 
+                       (struct continuation_arg *) arg);
+
+      except = safe_execute_command (uiout, /*ui */ run, 0 /*from_tty */ );
+      do_cleanups (old_cleanups);
+
+      if (target_executing)
+       {
+         if (current_command_token)
+           fputs_unfiltered (current_command_token, raw_stdout);
+         fputs_unfiltered ("^running\n", raw_stdout);
+         
+       }
+      else
+       {
+         /* If we didn't manage to set the inferior going, that's
+            most likely an error... */
+         discard_all_continuations ();
+         free_continuation_arg (arg);
+         mi_error_message = "ahem" /*error_last_message () APPLE MERGE */;
+         return MI_CMD_ERROR;
+       }
+
+    }
+
   return MI_CMD_DONE;
 }
 
 void
-mi_exec_async_cli_cmd_continuation (struct continuation_arg *arg)
+mi_exec_async_cli_cmd_continuation (struct continuation_arg *in_arg)
 {
-  if (last_async_command)
-    fputs_unfiltered (last_async_command, raw_stdout);
-  fputs_unfiltered ("*stopped", raw_stdout);
-  mi_out_put (uiout, raw_stdout);
-  fputs_unfiltered ("\n", raw_stdout);
-  fputs_unfiltered ("(gdb) \n", raw_stdout);
-  gdb_flush (raw_stdout);
-  do_exec_cleanups (ALL_CLEANUPS);
+  struct mi_continuation_arg *arg =
+    (struct mi_continuation_arg *) in_arg;
+
+  if (!target_executing)
+    {
+      if (arg && arg->token)
+       {
+         fputs_unfiltered (arg->token, raw_stdout);
+       }
+
+      /* Do the cleanups.  Remember to set this to NULL, 
+        since we are passing the arg to the next continuation
+        if the target restarts, and we don't want to do these
+        cleanups again. */
+      if (arg->cleanups)
+       {
+         do_exec_cleanups (arg->cleanups);
+         arg->cleanups = NULL;
+       }
+      
+      fputs_unfiltered ("*stopped", raw_stdout);
+      //      if (do_timings && arg && arg->timestamp)
+      //       print_diff_now (arg->timestamp);
+      mi_out_put (uiout, raw_stdout);
+      fputs_unfiltered ("\n", raw_stdout);
+      
+      /* Now run the actions for this breakpoint.  This may start
+        the target going again, but we shouldn't have to do
+        anything special about that, since the continuation
+        hooks for the commands will take care of that. */
+
+      /* Tricky bit: we have to register the continuation before
+        calling bpstat_do_actions, or the continuations will
+        be out of order.  If we don't start, then we have to 
+         discard the continuations.  N.B. We are assuming here
+         that nothing that CALLED us has registered a continuation,
+         if that becomes a problem, we will need to add the ability
+         to discard continuations up to (and including) a given 
+         continuation. */
+
+      if (target_can_async_p ())
+       {
+         /* Reset the timer, we will just accumulate times for this
+            command. */
+         //      if (do_timings && arg && arg->timestamp)
+         //        timestamp (arg->timestamp);
+         add_continuation (mi_exec_async_cli_cmd_continuation, 
+                           (struct continuation_arg *) arg);
+       }
+
+      bpstat_do_actions (&stop_bpstat);
+      
+      if (!target_executing)
+       {
+         /* Okay, we didn't need to use the continuation,
+            so discard it now. */
+         if (target_can_async_p ())
+           {
+             discard_all_continuations ();
+             free_continuation_arg (arg);
+           }
+         fputs_unfiltered ("(gdb) \n", raw_stdout);
+         gdb_flush (raw_stdout);
+       }
+      else
+       {
+         if (arg && arg->token)
+           fputs_unfiltered (arg->token, raw_stdout);
+         
+         ui_out_field_string (uiout, "reason", "breakpoint-command");
+         fputs_unfiltered ("*started", raw_stdout);
+         mi_out_put (uiout, raw_stdout);
+         fputs_unfiltered ("\n", raw_stdout);
+         gdb_flush (raw_stdout);
+       }         
+    }
+  else if (target_can_async_p ())
+    {
+      add_continuation (mi_exec_async_cli_cmd_continuation, in_arg);
+    }
 }
 
 void
@@ -1465,3 +1664,85 @@ _initialize_mi_main (void)
   DEPRECATED_REGISTER_GDBARCH_SWAP (old_regs);
   deprecated_register_gdbarch_swap (NULL, 0, mi_setup_architecture_data);
 }
+
+int mi_dont_register_continuation = 0;
+
+/* mi_setup_continuation_arg - sets up a continuation structure
+   with the timer info and the command token, for use with
+   an asyncronous mi command.  Will only cleanup the exec_cleanup
+   chain back to CLEANUPS, or not at all if CLEANUPS is NULL. */
+
+struct mi_continuation_arg *
+mi_setup_continuation_arg (struct cleanup *cleanups)
+{
+  struct mi_continuation_arg *arg
+    = (struct mi_continuation_arg *) 
+    xmalloc (sizeof (struct mi_continuation_arg));
+
+  if (current_command_token)
+    {
+      arg->token = xstrdup (current_command_token);
+    }
+  else
+    arg->token = NULL;
+
+  /* if (do_timings && current_command_ts)
+    {
+      arg->timestamp = (struct mi_timestamp *) 
+       xmalloc (sizeof (struct mi_timestamp));
+      copy_timestamp (arg->timestamp, current_command_ts);
+      current_command_ts = NULL;
+    }
+    else */
+    arg->timestamp = NULL;
+
+  arg->cleanups = cleanups;
+
+  return arg;
+}
+
+static void
+free_continuation_arg (struct mi_continuation_arg *arg)
+{
+  if (arg)
+    {
+      if (arg->token)
+       xfree (arg->token);
+      if (arg->timestamp)
+       xfree (arg->timestamp);
+      xfree (arg);
+    }
+}
+
+/* The only three called from other parts of mi-main.c will probably be
+   timestamp(), print_diff_now() and copy_timestamp() */
+
+/* 
+
+static void 
+timestamp (struct mi_timestamp *tv)
+  {
+    gettimeofday (&tv->wallclock, NULL);
+    getrusage (RUSAGE_SELF, &tv->rusage);
+  }
+
+static void 
+print_diff_now (struct mi_timestamp *start)
+  {
+    struct mi_timestamp now;
+    timestamp (&now);
+    print_diff (start, &now);
+  }
+
+static void 
+print_diff (struct mi_timestamp *start, struct mi_timestamp *end)
+  {
+    fprintf_unfiltered (raw_stdout,
+       ",time={wallclock=\"%0.5f\",user=\"%0.5f\",system=\"%0.5f\",start=\"%d.%06d\",end=\"%d.%06d\"}", 
+       wallclock_diff (start, end) / 1000000.0, 
+       user_diff (start, end) / 1000000.0, 
+       system_diff (start, end) / 1000000.0,
+       start->wallclock.tv_sec, start->wallclock.tv_usec,
+       end->wallclock.tv_sec, end->wallclock.tv_usec);
+
+*/
index 471ee4b87b75031476b448b77e1037317f0124f3..21fda24a43d81051878139cd194848c2c5286595 100644 (file)
 #ifndef MI_MAIN_H
 #define MI_MAIN_H
 
+extern int mi_dont_register_continuation;
+extern char *current_command_token;
+extern struct interp *mi_interp;
+struct mi_continuation_arg;
+
+extern void
+mi_interpreter_exec_continuation (struct continuation_arg *in_arg);
+
+extern struct mi_continuation_arg *
+  mi_setup_continuation_arg (struct cleanup *cleanups);
+
 extern void mi_setup_architecture_data (void);
 
 extern void mi_load_progress (const char *section_name,
index c6ed900f893e9ce4fa1a3793ed79d09d8fe77f54..fd93c1781e7caefdb5f4b85c3d24588678943b0a 100644 (file)
@@ -108,10 +108,10 @@ static void remote_send (char **buf, long *sizeof_buf_p);
 
 static int readchar (int timeout);
 
-static ptid_t remote_wait (ptid_t ptid,
                                struct target_waitstatus *status);
-static ptid_t remote_async_wait (ptid_t ptid,
                                      struct target_waitstatus *status);
+static ptid_t remote_wait
(ptid_t ptid, struct target_waitstatus *status, gdb_client_data client_data);
+static ptid_t remote_async_wait
(ptid_t ptid, struct target_waitstatus *status, gdb_client_data client_data);
 
 static void remote_kill (void);
 static void remote_async_kill (void);
@@ -2665,7 +2665,7 @@ remote_console_output (char *msg)
    remote OS, is the thread-id.  */
 
 static ptid_t
-remote_wait (ptid_t ptid, struct target_waitstatus *status)
+remote_wait (ptid_t ptid, struct target_waitstatus *status, gdb_client_data client_data)
 {
   struct remote_state *rs = get_remote_state ();
   char *buf = rs->buf;
@@ -2854,7 +2854,7 @@ got_status:
 
 /* Async version of remote_wait.  */
 static ptid_t
-remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
+remote_async_wait (ptid_t ptid, struct target_waitstatus *status, gdb_client_data client_data)
 {
   struct remote_state *rs = get_remote_state ();
   char *buf = rs->buf;
index bcb47deec381c54a82656b399f5809dbd9497a4e..c246e5a17c4ae49406107c3a09131b7658c82731 100644 (file)
@@ -99,7 +99,8 @@ static void debug_to_detach (char *, int);
 
 static void debug_to_resume (ptid_t, int, enum target_signal);
 
-static ptid_t debug_to_wait (ptid_t, struct target_waitstatus *);
+static ptid_t debug_to_wait (ptid_t, struct target_waitstatus *,
+                            gdb_client_data client_data);
 
 static void debug_to_fetch_registers (int);
 
@@ -207,6 +208,10 @@ show_targetdebug (struct ui_file *file, int from_tty,
 
 static void setup_target_debug (void);
 
+/* Non-zero if we are overriding the target's async behavior as far as
+   user commands go... */
+int gdb_override_async = 0;
+
 DCACHE *target_dcache;
 
 /* The user just typed 'target' without the name of a target.  */
@@ -484,8 +489,8 @@ update_current_target (void)
   de_fault (to_resume, 
            (void (*) (ptid_t, int, enum target_signal)) 
            noprocess);
-  de_fault (to_wait, 
-           (ptid_t (*) (ptid_t, struct target_waitstatus *)) 
+  de_fault (to_wait,  
+           (ptid_t (*) (ptid_t, struct target_waitstatus *, gdb_client_data client_data)) 
            noprocess);
   de_fault (to_fetch_registers, 
            (void (*) (int)) 
@@ -1508,6 +1513,21 @@ target_async_mask (int mask)
   return saved_async_masked_status;
 }
 
+void
+gdb_set_async_override (void* on)
+{
+  if (on) gdb_override_async = 1;
+}
+
+/* do_restore_target_async_mask is a convenience function to use
+   in make_cleanup to restore the state of the async mask. */
+void
+do_restore_target_async_mask (int mask)
+{
+  target_async_mask (mask);
+}
+
 /* Look through the list of possible targets for a target that can
    follow forks.  */
 
@@ -1924,11 +1944,12 @@ debug_to_resume (ptid_t ptid, int step, enum target_signal siggnal)
 }
 
 static ptid_t
-debug_to_wait (ptid_t ptid, struct target_waitstatus *status)
+debug_to_wait (ptid_t ptid, struct target_waitstatus *status,
+              gdb_client_data client_data)
 {
   ptid_t retval;
 
-  retval = debug_target.to_wait (ptid, status);
+  retval = debug_target.to_wait (ptid, status, client_data);
 
   fprintf_unfiltered (gdb_stdlog,
                      "target_wait (%d, status) = %d,   ", PIDGET (ptid),
index bf4917fed6d32e3658dcd5aae456cb3efc9f909d..2e857cc44cea3bcf83c6503645777a08231c9d5a 100644 (file)
@@ -305,7 +305,7 @@ struct target_ops
     void (*to_detach) (char *, int);
     void (*to_disconnect) (struct target_ops *, char *, int);
     void (*to_resume) (ptid_t, int, enum target_signal);
-    ptid_t (*to_wait) (ptid_t, struct target_waitstatus *);
+    ptid_t (*to_wait) (ptid_t, struct target_waitstatus *, gdb_client_data client_data);
     void (*to_fetch_registers) (int);
     void (*to_store_registers) (int);
     void (*to_prepare_to_store) (void);
@@ -508,8 +508,8 @@ extern void target_disconnect (char *, int);
    to the prompt with a debugging target but without the frame cache,
    stop_pc, etc., set up.  */
 
-#define        target_wait(ptid, status)               \
-     (*current_target.to_wait) (ptid, status)
+#define        target_wait(ptid, status, client_data)          \
+     (*current_target.to_wait) (ptid, status, client_data)
 
 /* Fetch at least register REGNO, or all regs if regno == -1.  No result.  */
 
@@ -878,8 +878,16 @@ int target_follow_fork (int follow_child);
 #define target_can_switch_threads \
      (current_target.to_has_thread_control & tc_switch)
 
+/* Defined in target.c, this variable gives us a way, independent of
+   the target's can_async method, to shut off async behavior. */
+extern int gdb_override_async;
+
+/* Use this to set the override of async behavior.
+   Set ON to 1 to turn on the override, 0 to turn it off. */
+extern void gdb_set_async_override (void* on);
+
 /* Can the target support asynchronous execution? */
-#define target_can_async_p() (current_target.to_can_async_p ())
+#define target_can_async_p() (gdb_override_async ? 0 : current_target.to_can_async_p ())
 
 /* Is the target in asynchronous execution mode? */
 #define target_is_async_p() (current_target.to_is_async_p())
index e129722ea7c852caf36da6f3107d8d9ccaa28da4..ef5ca66c0e1c20a9ae4417e73294c8f7baa55406 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -221,7 +221,7 @@ int (*deprecated_ui_loop_hook) (int);
 /* Called instead of command_loop at top level.  Can be invoked via
    throw_exception().  */
 
-void (*deprecated_command_loop_hook) (void);
+void (*deprecated_command_loop_hook) (void *data);
 
 
 /* Called from print_frame_info to list the line we stopped in.  */
@@ -287,7 +287,8 @@ void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len);
    while waiting for target events.  */
 
 ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
-                                      struct target_waitstatus * status);
+                                      struct target_waitstatus * status,
+                                      gdb_client_data client_data);
 
 /* Used by UI as a wrapper around command execution.  May do various things
    like enabling/disabling buttons, etc...  */
@@ -355,6 +356,26 @@ read_command_file (FILE *stream)
 
   cleanups = make_cleanup (do_restore_instream_cleanup, instream);
   instream = stream;
+
+  /* You can't run command files for gdb asynchronously.  If there
+     were a "wait till done" gdb command that you could put in a
+     command file, then this would make sense.  But otherwise things
+     like:
+
+     step
+     print somevar
+
+     won't work correctly.  So for command files, we temporarily force
+     the target to run synchronously.  */
+
+  if (target_can_async_p ()) 
+    { 
+      void *on;
+      on = (void *)1;
+      gdb_set_async_override (on); 
+      make_cleanup (gdb_set_async_override, &on); 
+    }
+
   command_loop ();
   do_cleanups (cleanups);
 }
index 7099dd77a94b06f4ee115d2836148ee340de460e..a4891e8a7dadd7786a25e4e7c05e9f17a8b8a81d 100644 (file)
@@ -200,7 +200,7 @@ static struct gdb_events tui_event_hooks =
 /* Called when going to wait for the target.
    Leave curses mode and setup program mode.  */
 static ptid_t
-tui_target_wait_hook (ptid_t pid, struct target_waitstatus *status)
+tui_target_wait_hook (ptid_t pid, struct target_waitstatus *status, gdb_client_data client_data)
 {
   ptid_t res;
 
@@ -214,7 +214,7 @@ tui_target_wait_hook (ptid_t pid, struct target_waitstatus *status)
     }
 #endif
   tui_target_has_run = 1;
-  res = target_wait (pid, status);
+  res = target_wait (pid, status, NULL);
 
   if (tui_active)
     {
index 144b14dc1b57288874e21cfa86ac0b329df2447d..a520012b6d98a439e76c31a119eb1bf20e89563f 100644 (file)
@@ -1 +1 @@
-6.4.50.20060512-cvs
+6.4.50.20060512-nickrob-async"
index 07e15accad0978280c71242a340634e9925f001c..6de8ebec098f77de02c505bb2c40d42dd9837caf 100644 (file)
@@ -50,4 +50,6 @@ extern int gdb_value_ind (struct value *val, struct value ** rval);
 
 extern int gdb_parse_and_eval_type (char *, int, struct type **);
 
+struct gdb_exception safe_execute_command (struct ui_out *uiout, char *command,
+                                          int from_tty);
 #endif /* wrapper.h */