Silence a few -Wmissing-prototypes warnings.
PR build/9877:
* amd64-nat.c: Include "amd64-nat.h".
* fork-child.c (_initialize_fork_child): Ditto.
* gcore.c (_initialize_gcore): Ditto.
* inf-ptrace.c: Include "inf-ptrace.h".
(inf_ptrace_store_registers): Make it static.
* linux-nat.c (linux_nat_terminal_ours): Make it static.
(_initialize_linux_nat): Declare before definition.
* linux-tdep.c: Include "linux-tdep.h".
* linux-thread-db.c (_initialize_thread_db): Declare before
definition.
* proc-service.c (_initialize_proc_service): Ditto.
* remote.c (remote_send_printf): Make it static.
* solib.c: Include "solib.h".
* symfile-mem.c (_initialize_symfile_mem): Declare before
definition.
* ada-lang.c (ada_la_decode, ada_match_name)
(ada_suppress_symbol_printing, ada_is_array_type)
(ada_value_ptr_subscript, ada_array_length)
(ada_to_static_fixed_value): Make them static.
(_initialize_ada_language): Declare before definition.
* ada-tasks.c (ada_get_task_number, ada_get_environment_task)
(ada_task_list_changed, ada_new_objfile_observer): Make them
static.
(_initialize_tasks): Declare before definition.
* addrmap.c (_initialize_addrmap): Declare before definition.
* auxv.c (default_auxv_parse): Make it static.
* bfd-target.c (target_bfd_xfer_partial, target_bfd_xclose): Make
them static.
* breakpoint.c (remove_sal): Add line break.
(expand_line_sal_maybe): Make it static.
* cp-name-parser.y: Include "cp-support.h".
* cp-valprint.c (cp_find_class_member): Make it static.
* eval.c (value_f90_subarray): Ditto.
* exceptions.c (print_any_exception): Ditto.
* findcmd.c (_initialize_mem_search): Declare before definition.
* frame.c (frame_observer_target_changed): Make it static.
* gnu-v3-abi.c (gnuv3_find_method_in): Make it static.
* inf-child.c: Include "inf-child.h".
* inferior.h (valid_inferior_id): Rename to ...
(valid_gdb_inferior_id): ... this.
* infrun.c (infrun_thread_stop_requested, siginfo_make_value):
Make them static.
* jv-lang.c (java_language_arch_info): Make it static.
* m2-typeprint.c (m2_get_discrete_bounds): Ditto.
* osdata.c (info_osdata_command): Make it static.
* regcache.c (regcache_observer_target_changed): Make it static.
* reverse.c (_initialize_reverse): Declare before definition.
* stabsread.c (cleanup_undefined_types_noname)
(cleanup_undefined_types_1): Make them static.
* symfile.c (place_section): Make it static.
* symtab.c (find_pc_sect_psymtab_closer): Make it static.
* target-descriptions.c (_initialize_target_descriptions): Declare
before definition.
* target.c (default_get_ada_task_ptid, find_default_can_async_p)
(find_default_is_async_p, find_default_supports_non_stop): Make
them static.
(target_supports_non_stop): Add prototype.
(dummy_pid_to_str): Make it static.
* utils.c (_initialize_utils): Declare before definition.
* ada-exp.y (_initialize_ada_exp): Declare before definition.
* solib-svr4.c (HAS_LM_DYNAMIC_FROM_LINK_MAP): Add a prototype.
* target.h (struct target_ops): Add a prototype to the
to_can_execute_reverse callback.
* macroscope.c (_initialize_macroscope): Declare before definition.
* cp-namespace.c (_initialize_cp_namespace): Declare before definition.
* python/python.c (_initialize_python): Declare before definition.
* tui/tui-command.c: Include "tui/tui-command.h".
* tui/tui-data.c (init_content_element, init_win_info): Make them
static.
* tui/tui-disasm.c: Include "tui/tui-disasm.h".
* tui/tui-interp.c (_initialize_tui_interp): Declare before
definition.
* tui/tui-layout.c: Include "tui/tui-layout.h".
(_initialize_tui_layout): Declare before definition.
* tui/tui-regs.c: Include "tui/tui-regs.h".
(tui_display_reg_element_at_line): Make it static.
(_initialize_tui_regs): Declare before definition.
* tui/tui-stack.c (_initialize_tui_stack): Declare before
definition.
* tui/tui-win.c: Include "tui/tui-win.h".
(_initialize_tui_win): Declare before definition.
(tui_sigwinch_handler): Make it static. Wrap in ifdef SIGWINCH.
* tui/tui-win.h (tui_sigwinch_handler): Delete declaration.
(tui_get_cmd_list): Add a prototype.
* tui/tui-windata.c: Include tui-windata.h.
* tui/tui-wingeneral.c (box_win): Make it static.
* cli/cli-logging.c (show_logging_command): Make it static.
(_initialize_cli_logging): Declare before definition.
* mi/mi-common.c (_initialize_gdb_mi_common): Declare before
definition.
* target.c (target_waitstatus_to_string): New function. Copied from
debug_to_wait. Add missing entries for TARGET_WAITKIND_SYSCALL_ENTRY,
TARGET_WAITKIND_SYSCALL_RETURN, TARGET_WAITKIND_IGNORE,
TARGET_WAITKIND_NO_HISTORY.
(debug_to_wait): Call it.
* infrun.c (wait_for_inferior): If debug_infrun, print result of
target_wait.
(fetch_inferior_event): Ditto.
field.
(target_supports_multi_process): New define.
* target.c (update_current_target): Inherit and de_fault
to_supports_multi_process.
* infcmd.c (attach_command): Allow attaching to multiple processes
if the target supports it.
(detach_command): If the target claims there is still execution,
don't clear the thread list.
* remote.c (remote_supports_multi_process): New.
(init_remote_ops): Register remote_supports_multi_process.
Target interface for reverse debugging.
* target.h (enum target_waitkind):
Add new wait event, TARGET_WAITKIND_NO_HISTORY.
(struct target_ops): New method to_can_execute_reverse.
(target_can_execute_reverse): New macro.
* target.c (update_current_target): Inherit to_can_execute_reverse.
Remote interface for reverse debugging.
* remote.c (remote_can_execute_reverse): New target method.
(remote_resume): Check for reverse exec direction, and send
appropriate command to target.
(remote_wait_as): Check target response for NO_HISTORY status.
Also check for empty reply (target doesn't understand "bs" or "bc).
(remote_vcont_resume): Jump out if attempting reverse execution.
Event handling interface for reverse debugging.
* infrun.c (execution_direction): New state variable.
(enum inferior_stop_reason): Add NO_HISTORY reason.
(handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY.
Handle stepping over a function call in reverse.
Handle stepping thru a line range in reverse.
Handle setting a step-resume breakpoint in reverse.
Handle stepping into a function in reverse.
Handle stepping between line ranges in reverse.
(print_stop_reason): Print reason for NO_HISTORY.
(step_into_function): Rename to handle_step_into_function.
(handle_step_into_function_backward): New function.
(set_exec_direction_func, show_exec_direction_func): New funcs.
(proceed): No need to singlestep over a breakpoint
when resuming in reverse.
* inferior.h (enum exec_direction_kind): New enum.
(execution_direction): Export new execution state variable.
* breakpoint.c (make_breakpoint_silent): New function.
* breakpoint.h (make_breakpoint_silent): Export.
* infcmd.c (finish_command): Check for reverse exec direction.
(finish_backward): New function, handle finish cmd in reverse.
User interface for reverse execution.
* Makefile.in (reverse.c): New file.
* reverse.c: New file. User interface for reverse execution.
behind from a previous inferior.
* target.c (pop_all_targets): Rename to ...
(pop_all_targets_above): ... this. Add a target stratum
parameter. Use it instead of hardcoding the dummy_stratum.
(pop_all_targets): New, defer to pop_all_targets_above.
(target_preopen): Use pop_all_targets_above.
* target.h (pop_all_targets_above): Declare.
* infrun.c (resume): In non-stop mode, always resume just one
thread.
(proceed): Don't call prepare_to_proceed in non-stop mode.
(fetch_inferior_event): In non-stop mode, switch context before
handling the event.
(error_is_running, ensure_not_running): New.
(handle_inferior_event): In non-stop mode: Mark only the event
thread as stopped. Require that the target module manages adding
threads to the thread list. Assert that there isn't a
deferred_step_ptid set. Don't switch to infwait_thread_hop_state.
(normal_stop): Only mark not-running if inferior hasn't exited.
In non-stop mode, only mark the event thread.
* thread.c:Include "cli/cli-decode.h".
(print_thread_info): Don't read from a running thread.
Output "(running)" if thread is running.
(switch_to_thread): Don't read stop_pc if thread is executing.
(do_restore_current_thread_cleanup): Don't write to a running
thread.
(thread_apply_all_command): Don't read from a running thread. In
non-stop mode, do a full context-switch instead of just switching
threads.
(thread_apply_command): In non-stop mode, do a full context-switch
instead of just switching threads.
(do_captured_thread_select): Likewise. Inform user if selected
thread is running.
(_initialize_thread): Mark "info threads" and "thread" and
async_ok.
* inf-loop.c (inferior_event_handler): In non-stop mode, don't
unregister the target from the event loop.
* infcmd.c (continue_command, step_1, jump_command)
(signal_command): Ensure the selected thread isn't running.
(interrupt_target_command): In non-stop mode, interrupt only the
selected thread.
* inferior.h (error_is_running, ensure_not_running): Declare.
* target.h (struct target_ops): Add ptid argument to the to_stop
member.
(target_stop): Add ptid_t argument.
* target.c (update_current_target): Add ptid argument to to_stop's
type.
(debug_to_stop): Add ptid_t argument.
(debug_to_rcmd): Set to_stop_ptid.
* remote.c (remote_stop): Add ptid_t argument.
(async_remote_interrupt): Add inferior_ptid to target_stop.
* inf-ptrace.c (inf_ptrace_stop): Add ptid argument.
* Makefile.in (thread.o): Depend on $(cli_decode_h).
* target.h (struct target_waitstatus): Store related_pid as a ptid.
(inferior_has_forked, inferior_has_vforked, inferior_has_execd):
Take a ptid_t.
* breakpoint.h (struct breakpoint): Change forked_inferior_pid
type to ptid.
* breakpoint.c (print_it_typical, bpstat_check_location)
(print_one_breakpoint_location, set_raw_breakpoint_without_location)
(create_fork_vfork_event_catchpoint): Adjust.
* infrun.c (fork_event): Change parent_pid and child_pid types to
ptid.
(follow_exec, inferior_has_forked, inferior_has_vforked)
(inferior_has_execd): Take a ptid_t and don't trim it.
* linux-thread-db.c (thread_db_wait): Don't trim the returned ptid.
* linux-nat.c (linux_child_follow_fork): Adjust.
* inf-ptrace.c (inf_ptrace_wait): Adjust.
* inf-ttrace.c (inf_ttrace_wait): Adjust.
* win32-nat.c (get_win32_debug_event): Don't set related_pid.
* target.h (struct target_ops): New field to_auxv_parse.
* auxv.c (default_auxv_parse): New, renamed from previous
target_auxv_parse.
(target_auxv_parse): Try to call target method. Fallback to
default_auxv_parse if not found.
* procfs.c (procfs_auxv_parse): New.
(init_procfs_ops): On Solaris, in 64-bit mode, install
procfs_auxv_parse.
to_watchpoint_addr_within_range.
(target_watchpoint_addr_within_range): New function.
* target.c (update_current_target): Inherit
to_watchpoint_addr_within_range, defaulting to
default_watchpoint_addr_within_range.
(default_watchpoint_addr_within_range): New function.
(debug_to_watchpoint_addr_within_range): New function.
(setup_target_debug): Set to_watchpoint_addr_within_range.
* ppc-linux-nat.c (ppc_linux_watchpoint_addr_within_range):
New function.
(_initialize_ppc_linux_nat): Set to_watchpoint_addr_within_range.
* breakpoint.c (watchpoints_triggered): Use
target_watchpoint_addr_within_range.
* gdbint.texinfo (Algorithms): Describe
target_watchpoint_addr_within_range.
* corelow.c (core_open): Use gdbarch_target_signal_from_host to
translate signal numeric value from the target to GDB's enum
target_signal.
* gdbarch.c, gdbarch.h: Regenerated.
* gdbarch.sh: Added two new functions target_signal_from_host and
target_signal_to_host.
* target.h (default_target_signal_from_host,
default_target_signal_to_host): New functions - declarations.
* signals/signals.c (struct gdbarch): New declaration.
(default_target_signal_to_host, default_target_signal_from_host): New
functions.
* target.h (struct target_ops): Delete to_async_mask_value and add
to_async_mask.
(target_is_async_p, target_async): Formatting.
(target_async_mask_value): Delete.
(target_async_mask): Delete function declaration, and add new
target macro with the same name.
* target.c (update_current_target): Replace to_async_mask_value by
to_async_mask. Default to_async_mask to return_one.
(target_async_mask): Delete.
(find_default_can_async_p, find_default_is_async_p): New.
(init_dummy_target): register find_default_can_async_p and
find_default_is_async_p on the dummy target.
* linux-nat.c: Include inf-loop.h, event-loop.h and event-top.h.
(debug_linux_nat_async): New global.
(show_debug_linux_nat_async): New function.
(linux_nat_async_enabled, linux_nat_async_mask_value)
(linux_nat_event_pipe, linux_nat_num_queued_events)
(linux_nat_async_events_enabled): New globals.
(struct waitpid_result): New struct.
(waitpid_queue): New global.
(queued_waitpid, push_waitpid, drain_queued_events): New.
(my_waitpid): Call queued_waitpid.
(linux_child_follow_fork): Disable async events during the call.
(blocked_mask): Delete.
(sync_sigchld_action, async_sigchld_action): New globals.
(lin_lwp_attach_lwp): In sync mode, don't reblock SIGCHLD. In
async mode, block events during the call.
(linux_nat_create_inferior): New.
(linux_nat_attach): In sync mode, restore the mask states. In
async mode, wake the event loop immediatelly.
(detach_callback): Drain all queued events of the lwp we're
detaching from.
(linux_nat_detach): Block async mode, and drain events of the main
process.
(linux_nat_resume): If in async mode, mask async events during the
call. If short circuiting, force event loop to wake up. If
resuming, set target_executing, and register target events in the
event loop.
(pipe_to_local_event_queue, local_event_queue_to_pipe): New.
(linux_nat_wait): In async mode, block events during the call.
Only enable/disable passing SIGINT to the inferior in sync mode.
Get events from local waitpid queue. If no interesting events was
found, return to events loop. Reregister target events in the
event loop on exit. In sync mode, no need to reblock SIGCHLD.
(linux_nat_kill): Disable events on entry.
(linux_nat_mourn_inferior): In sync mode, don't restore the masks
here. Detach async mode from the event loop if there are no more
forks available, otherwise leave it on.
(sigchld_handler): Assure this is called only in sync mode.
(linux_async_permitted, linux_async_permitted_1): New globals.
(set_maintenance_linux_async_permitted)
(show_maintenance_linux_async_permitted): New functions.
(linux_nat_is_async_p, linux_nat_can_async_p)
(linux_nat_async_mask): New.
(linux_nat_event_pipe_pop, linux_nat_event_pipe_push): New.
(get_pending_events, async_sigchld_handler): New.
(linux_nat_async_events): New.
(async_terminal_is_ours): New global.
(linux_nat_terminal_inferior, linux_nat_terminal_ours): New.
(async_client_callback, async_client_context): New.
(linux_nat_async_file_handler, linux_nat_async)
(linux_nat_disable_async, linux_nat_enable_async): New.
(linux_nat_add_target): Register linux_nat_create_inferior,
linux_nat_can_async_p, linux_nat_is_async_p, linux_nat_async,
linux_nat_async_mask, linux_nat_terminal_inferior and
linux_nat_terminal_ours.
(_initialize_linux_nat): Remove local action variable, and update
code that used it to use sync_sigchld_action. Add new
"lin-lwp-async" debug set/show command. Put the "lin-lwp" debug
set/show command in the maintenance class. Add new "linux-async"
maintenance set/show command. Block SIGCHLD by default. Setup
async_sichld_action, and sync_sigchld_action. Install the default
async mode.
(lin_thread_get_thread_signals): Use a local sigset_t for blocking
the cancel signals.
* linux-thread-db.c (re_check_for_thread_db): New.
(clear_lwpid_callback): Handle TARGET_WAITKIND_IGNORE.
(thread_db_can_async_p, thread_db_is_async_p, thread_db_async)
(thread_db_async_mask): New.
(init_thread_db_ops): Register thread_db_can_async_p,
thread_db_is_async_p, thread_db_async and thread_db_async_mask.
* remote.c (remote_async_mask_value): New.
(remote_return_zero): New.
(init_remote_ops): Register remote_return_zero as callbacks of
to_can_async_p and to_is_async_p.
(remote_can_async_p, remote_is_async_p, remote_async): Update to
use remote_async_mask_value.
(remote_async_mask): New.
(init_remote_async_ops): Remove to_async_mask_value setting and
register remote_async_mask as to_async_mask callback in
remote_async_ops.
* Makefile.in (linux-nat.o): Update.
gdb/doc/
* gdb.texinfo (Debugging Output): Document
"set/show debug lin-lwp-async".
(Maintenance Commands): Document "maint set/show linux-async".
* fork-child.c (startup_inferior): Do not set
inferior_ignoring_leading_exec_events.
* inf-child.c (inf_child_reported_exec_events_per_exec_call): Remove.
(inf_child_target): Do not set to_reported_exec_events_per_exec_call.
* infrun.c (inferior_ignoring_leading_exec_events): Remove.
(handle_inferior_event): Remove code for ignoring leading exec
events.
* target.c (update_current_target): Do not inherit, or default,
to_reported_exec_events_per_exec_call.
(debug_to_reported_exec_events_per_exec_call): Remove.
(setup_target_debug): Do not set to_reported_exec_events_per_exec_call.
* target.h (target_reported_exec_events_per_exec_call): Remove.
(struct target): Remove the to_reported_exec_events_per_exec_call
field.