Pedro Alves <pedro@codesourcery.com>
* infrun.c (can_use_displaced_stepping): Change type to
const char pointer.
(can_use_displaced_stepping_auto): New string.
(can_use_displaced_stepping_on): New string.
(can_use_displaced_stepping_off): New string.
(can_use_displaced_stepping_enum): New array.
(show_can_use_displaced_stepping): In auto mode, also show
the current effect of the option.
(use_displaced_stepping): Return non-zero if displaced
stepping is auto, and can be used with GDBARCH, and in
non-stop mode. Return non-zero if displaced stepping is on,
and can be used with GDBARCH. Return zero otherwise.
(_initialize_infrun): Make the "set displaced-stepping"
command an enum command. Change its class to class_run.
Place it in the top level set list. Extend help to describe
the auto mode.
2008-10-24 Hui Zhu <teawater@gmail.com>
Pedro Alves <pedro@codesourcery.com>
* gdb.texinfo (displaced-stepping): Describe the auto mode
setting, and say it's the default. This is now a mainstream
setting instead of a maintenance setting.
2008-10-23 Pedro Alves <pedro@codesourcery.com>
* defs.h: Mention ptid_is_pid.
* inferior.h (ptid_is_pid): Declare.
* gdbthread.h (struct thread_info) <stop_requested>: New field.
(set_stop_requested): Declare.
* infcmd.c (interrupt_target_1): Call set_stop_requested.
* infrun.c (clear_proceed_status): Clear stop_requested.
(infrun_thread_stop_requested_callback,
infrun_thread_stop_requested): New.
(handle_inferior_event): If a TARGET_SIGNAL_TRAP is reported on a
thread that had an explicit stop request, pretend we got a
TARGET_SIGNAL_0. Always stop if the thread had an explicit stop
request.
(print_stop_reason): In the SIGNAL_RECEIVED case, if we're not
outputting to MI, and we got a TARGET_SIGNAL_0, print "# Stopped",
instead of mentioning signal 0.
(ptid_is_pid): New.
* thread.c (set_stop_requested): New.
* linux-nat.c (queued_waitpid): Rename to ...
(queued_waitpid_1): ... this. Add `peek' argument. Handle it.
(queued_waitpid): New, as wrapper to queued_waitpid_1.
(push_waitpid): Push the SIGTRAP to the local event queue, to the
kernel's.
(send_sigint_callback): Delete.
(linux_nat_stop_lwp): New.
(linux_nat_stop): Use it.
gdb/doc/
2008-10-23 Pedro Alves <pedro@codesourcery.com>
* observer.texi (thread_stop_requested): New.
gdb/testsuite/
2008-10-23 Pedro Alves <pedro@codesourcery.com>
* lib/mi-support.exp (mi_expect_interrupt): Expect signal 0
instead of SIGINT.
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.
* breakpoint.c (breakpoint_init_inferior): Clean up the moribund
locations list.
(moribund_breakpoint_here_p): Record the moribund
location in the moribund_locations vector.
* breakpoint.h (moribund_breakpoint_here_p): Declare.
(displaced_step_fixup): Check if the breakpoint the thread was
trying to step over has been removed since having been placed in
the displaced stepping queue.
(adjust_pc_after_break): In non-stop mode, check for a moribund
breakpoint at the stop pc.
(handle_inferior_event): Don't retire moribund breakpoints on
TARGET_WAITKIND_IGNORE.
gdb/testsuite/
* gdb.mi/mi-nsmoribund.exp, gdb.mi/nsmoribund.c: New test.
comments.
(mips_linux_skip_resolver): Also use glibc_skip_solib_resolver.
(mips_linux_init_abi): Do not override skip_trampoline_code.
* configure.tgt (mips*-*-linux*): Add glibc-tdep.o.
* mips-tdep.c (mips32_scan_prologue): Stop scanning at branches.
(mips_stub_frame_sniffer): Use the stub frame sniffer for PIC stubs.
(mips_skip_mips16_trampoline_code): Rename from
mips_skip_trampoline_code.
(mips_skip_pic_trampoline_code, mips_skip_trampoline_code): New.
* infrun.c (handle_inferior_event): Do not pass zero to
in_solib_dynsym_resolve_code.
* infrun.c (wait_for_inferior): Move this ECS->EVENT_THREAD
initialization ...
(fetch_inferior_event): ... and this ECS->EVENT_THREAD initialization
...
(handle_inferior_event): ... here after the add_thread call together
with the local adjust_pc_after_break and reinit_frame_cache calls.
* infrun.c (context_switch): Don't save and load infrun state.
(context_switch_to): Delete.
* infcmd.c (proceed_thread_callback): Replace context_switch_to
calls by switch_to_thread calls.
* gdbthread.h (save_infrun_state, load_infrun_state): Delete.
* thread.c (main_thread_state, main_thread_executing): Delete.
(inferior_thread): Delete references to them.
(add_thread_silent): Fix case where we're adding a thread with the
same ptid as an exited thread. Remove references to
context-switching.
(load_infrun_state, save_infrun_state): Delete.
(thread_alive, is_thread_state, any_running, is_executing)
(set_executing): Remove the special handling for targets that
don't register any thread.
(restore_current_thread, thread_apply_all_command)
(do_captured_thread_select): Unconditionally call
switch_to_thread.
* mi/mi-main.c (mi_cmd_execute): Check for exited threads.
Call switch_to_thread instead of context_switch_to.
* breakpoint.h (bpstat_do_actions): Remove bpstat* argument.
* breakpoint.c (bpstat_do_actions): Rename to ...
(bpstat_do_actions_1): ... this. Make static. Change return type
to int. Return true if a breakpoint proceeded.
(bpstat_do_actions): New, as wrapper around bpstat_do_actions_1.
(delete_breakpoint): Don't reference the global stop_bpstat; it's
gone.
* gdbthread.h (struct thread_info): Add stop_bpstat.
(save_infrun_state, load_infrun_state): Remove stop_bpstat
argument.
* thread.c (load_infrun_state, save_infrun_state): Remove
stop_bpstat argument, and the code referencing it.
* infcall.c: Include "gdbthread.h".
(call_function_by_hand): Adjust.
* exceptions.c: Include "gdbthread.h".
(throw_exception): Adjust.
* infcmd.c (stop_bpstat): Delete.
(continue_command): In all-stop, set the ignore count on the
thread that reported the stop. In non-stop, set it on the current
thread.
(finish_command_continuation): Adjust.
(program_info): Adjust.
* infrun.c (clear_proceed_status): Adjust.
(context_switch): Don't context-switch stop_bpstat.
(handle_inferior_event): Adjust.
(normal_stop): Adjust.
(save_inferior_status, restore_inferior_status): Adjust.
* inf-loop.c (inferior_event_handler): Remove parameter to
bpstat_do_actions call.
* top.c (command_loop): Remove parameter to bpstat_do_actions
call. Call it unconditionally.
* event-top.c (command_handler): Ditto.
* python/python.c (execute_gdb_command): Ditto.
* dummy-frame.c: Include "observer.h".
(dummy_frame_push): Do not check for stale frames.
(dummy_frame_pop): New function.
(cleanup_dummy_frames): New function.
(_initialize_dummy_frame): Install it as inferior_created observer.
* frame.h (struct frame_id): Update comments.
(frame_id_inner): Remove prototype.
* frame.c (frame_id_inner): Make static. Add comments.
(frame_find_by_id): Update frame_id_inner safety net check to avoid
false positives for targets using non-contiguous stack ranges.
(get_prev_frame_1): Update frame_id_inner safety net check.
(frame_pop): Call dummy_frame_pop when popping a dummy frame.
* stack.c (return_command): Directly pop the selected frame.
* infrun.c (handle_inferior_event): Remove dead code.
* i386-tdep.c (i386_push_dummy_call): Update comment.
* infrun.c (struct thread_stepping_state): Delete sal member.
(init_thread_stepping_state): Add local sal. Use it instead of
tss->sal.
(handle_inferior_event): New local stop_pc_sal. Use it instead of
tss->sal.
(step_into_function): Add local stop_func_sal. Use it instead of
tss->sal.
* thread.c (enum thread_state): New.
(thread_state main_thread_running): Delete, in favor of...
(thread_state main_thread_state): ... this. Update throughout.
(clear_thread_inferior_resources): New, split from free_thread.
(free_thread): Call clear_thread_inferior_resources.
(init_thread_list): Set main thread to stopped state.
(add_thread_silent): Take care of PTID reuses.
(delete_thread): If deleting inferior_ptid or a thread with
refcount > 0, mark it as exited, but still keep it in the list.
Only notify of thread exits, if we haven't done so yet.
(iterate_over_threads): Make it safe to delete threads while
iterating over them.
(do_captured_list_thread_ids): Don't account for exited threads.
(thread_alive): Check for the THREAD_EXITED state, and don't set
ptid to -1 on exited threads.
(set_running): Update to account for extra possible states.
(is_thread_state): New.
(is_stopped, is_exited): New.
(is_running): Implement in terms of is_thread_state.
(any_running): Update.
(print_thread_info): Update. Account for exited threads. Don't
warn about missed frame restoring here, its done in the cleanup.
(switch_to_thread): Don't read from a thread that has gone.
(restore_current_thread): In non-stop mode, do a full context
switch.
(restore_selected_frame): Add a frame_level argument. Rewrite.
(struct current_thread_cleanup): Add selected_frame_level and
was_stopped members.
(do_restore_current_thread_cleanup): Check if thread was stopped
and still is, and if the target has registers, stack and memory
before restoring the selected frame. Don't delete the cleanup
argument here.
(restore_current_thread_cleanup_dtor): New.
(make_cleanup_restore_current_thread): Remove all arguments.
Rewrite.
(thread_apply_all_command): Update. Prune threads.
(thread_apply_command): Update.
(thread_command): Account for currently selected exited thread.
(do_captured_thread_select): Check for a running thread. Prune
threads.
(_initialize_thread): Make "info threads", "thread", "thread
apply", and "thread apply all" appliable without a selected thread.
* gdbthread.h (struct thread_info): Replace running_ by state_.
Add refcount.
(is_exited, is_stopped): Declare.
(make_cleanup_restore_current_thread): Remove all arguments.
* infrun.c: Include "event-top.h".
(fetch_inferior_event): In non-stop mode, restore selected thread
and frame after handling the event and running breakpoint
commands. Display GDB prompt if needed.
(normal_stop): In non-stop mode, don't print thread switching
notice.
* cli/cli-decode.c (set_cmd_no_selected_thread_ok)
(get_cmd_no_selected_thread_ok): New.
* cli/cli-decode.h (CMD_NO_SELECTED_THREAD_OK): New.
(set_cmd_no_selected_thread_ok, get_cmd_no_selected_thread_ok):
Declare.
* cli/cli-cmds.c: Set "pwd", "help", "info", "show" as
no-selected-thread ok.
* top.c (execute_command): Check for non no-selected-thread-ok
commands.
* linux-nat.c (struct saved_ptids, threads_to_delete)
(record_dead_thread, prune_lwps): Delete.
(exit_lwp): Unconditionally delete thread.
(linux_nat_resume): Remove prune_lwps call.
* infcmd.c (proceed_thread_callback): Check if !is_stopped instead
of is_running. Adjust to make_cleanup_restore_current_thread
interface change.
* mi/mi-main.c (mi_cmd_execute): Only allow a few commands if the
selected thread has exited.
* inf-loop.c (inferior_event_handler): Don't display the prompt
here.
* varobj.c (c_value_of_root): Update.
* defs.h (make_cleanup_dtor): Declare.
* utils.c (make_cleanup_dtor): New.
* Makefile.in (infrun.o): Depend on $(event_top_h).
* 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).
* infrun.c (proceed): Clear the stepping state, set
previous_inferior_ptid and clear infwait state.
(wait_for_inferior): Don't clear the stepping state, set
previous_inferior_ptid, or clear the infwait state here.
(fetch_inferior_event): Don't clear the stepping state, set
previous_inferior_ptid, or clear the infwait state here. Don't
condition on wait_for_more.
* infrun.c (currently_stepping): Take a struct
thread_stepping_state instead of an execution_control_state.
(struct thread_stepping_state): New, split from
execution_control_state.
(gtss, tss): New globals.
(proceed): Clear the stepping state, set previous_inferior_ptid
and clear infwait state.
(init_wait_for_inferior): Clear the stepping state,
previous_inferior_ptid and infwait state.
(waiton_ptid, infwait_state): New, split from
execution_control_state.
(struct execution_control_state): Members that persist through
events moved out to either struct thred_stepping_state or made
global. Deleted unneeded wp, saved_inferior_ptid, tmpstatus.
(wait_for_inferior, fetch_inferior_event): Use local
execution_control_state. Update to execution_control_state split.
(init_execution_control_state): Adjust.
(init_thread_stepping_state): New, extracted from
init_execution_control_state.
(context_switch): Take a ptid instead of an
execution_control_state.
(context_switch_to): Adjust.
(adjust_pc_after_break): Adjust.
(init_infwait_state): New.
(handle_inferior_event): Adjust.
* gdbthread.h: Remove unneeded forward declarations.
Include "inferior.h".
(struct thread_info): Add continuations,
intermediate_continuations, proceed_to_finish, step_over_calls,
stop_step, step_multi and stop_signal members.
(save_infrun_state): Add continuations,
intermediate_continuations, proceed_to_finish, step_over_calls,
stop_step, step_multi, stop_signal and stop_bpstat parameters.
(load_infrun_state): Add continuations,
intermediate_continuations, proceed_to_finish, step_over_calls,
stop_step, step_multi, stop_signal and stop_bpstat parameters.
* thread.c (load_infrun_state): In non-stop mode, load
continuations, intermediate_continuations, proceed_to_finish,
step_over_calls, stop_step, step_multi and stop_signal.
(save_infrun_state): Store continuations,
intermediate_continuations, proceed_to_finish, step_over_calls,
stop_step, step_multi, stop_signal and stop_bpstat.
(save_infrun_state): Store continuations,
intermediate_continuations, proceed_to_finish, step_over_calls,
stop_step, step_multi, stop_signal and stop_bpstat.
(free_thread): Clear The thread's stop_bpstat.
* inferior.h (context_switch_to): Declare.
* infrun.c (ecss): New global.
(context_switch): Context switch continuations,
intermediate_continuations, proceed_to_finish, step_over_calls,
stop_step, step_multi, stop_signal and stop_bpstat.
(wait_for_inferior): Use global ecss.
(async_ecss, async_ecs): Delete.
(fetch_inferior_event): Use global ecss.
(context_switch_to): New.
* top.c (execute_command): In non-stop, only check if the current
thread is running, in all-stop, check if there's any thread
running.
* breakpoint.c (bpstat_remove_breakpoint): New.
(bpstat_remove_breakpoint_callback): New.
(delete_breakpoint): Clear the stop_bpstats of all threads.
* mi/mi-main.c (mi_cmd_execute): In non-stop, only check if the
current thread is running, in all-stop, check if there's any
thread running.
* Makefile.in (gdbthread_h): Depend on $(inferior_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.
* inferior.h (target_executing): Delete.
* gdbthread.h (struct thread_info): Add executing_ field.
(set_executing, is_executing): New.
* thread.c (main_thread_executing): New.
(init_thread_list): Clear it and also main_thread_running.
(is_running): Return false if target has no execution.
(any_running, is_executing, set_executing): New.
* top.c: Include "gdbthread.h".
(target_executing): Delete.
(execute_command): Replace target_executing check by any_running.
* event-top.c: Include "gdbthread.h".
(display_gdb_prompt, command_handler): Replace target_executing by
is_running.
* inf-loop.c: Include "gdbthread.h". Don't mark as not executing
here. Replace target_executing by is_running.
* infrun.c (handle_inferior_event): Mark all threads as
not-executing.
* linux-nat.c (linux_nat_resume): Don't mark thread as executing
here.
* stack.c (get_selected_block): Return null if inferior is
executing.
* target.c (target_resume): Mark resumed ptid as executing.
* breakpoint.c (until_break_command): Replace target_executing
check by is_executing.
* remote.c (remote_async_resume): Don't mark inferior as executing
here.
* mi/mi-interp.c (mi_cmd_interpreter_exec): Replace target_executing
by any_running.
* mi/mi-main.c (mi_cmd_exec_interrupt, mi_cmd_execute)
(mi_execute_async_cli_command): Replace target_executing by
is_running.
* frame.c (get_current_frame): Error out if the current thread is
executing.
(has_stack_frames): New.
(get_selected_frame, deprecated_safe_get_selected_frame): Check
has_stack_frames.
* Makefile.in (event-top.o, frame.o, inf-loop.o, top.o): Depend on
$(gdbthread_h).
* monitor.c (monitor_open): Include "gdbthread.h". Clear thread
list here.
* remote.c (record_currthread): Upgrade the main thread and its
entry in the thread list if this is the first time we hear about
threads.
(remote_thread_alive): Consider magic_null_ptid or a ptid without
a tid member always alive.
(remote_find_new_threads): Don't update the main thread here.
(remote_start_remote): Clear thread list here. Always add the
main thread.
(extended_remote_attach_1): Add the main thread here.
(extended_remote_mourn_1): Re-add the main thread here.
(extended_remote_create_inferior_1): Add a main thread.
* Makefile.in (monitor.o): Depend on $(gdbthread_h).
Pedro Alves <pedro@codesourcery.com>
Based on work by Jan Kratochvil <jan.kratochvil@redhat.com> and Jeff
Johnston <jjohnstn@redhat.com>.
* NEWS: Mention attach to stopped process fix.
* infcmd.c (detach_command, disconnect_command): Discard the thread
list.
* infrun.c (handle_inferior_event): Do not ignore non-SIGSTOP while
attaching. Use signal_stop_state.
(signal_stop_state): Check stop_soon.
* linux-nat.c (kill_lwp): Declare earlier.
(pid_is_stopped, linux_nat_post_attach_wait): New.
(lin_lwp_attach_lwp): Use linux_nat_post_attach_wait. Update
comments.
(linux_nat_attach): Use linux_nat_post_attach_wait.
(detach_callback, linux_nat_detach): Improve handling for signalled
processes.
(linux_nat_pid_to_str): Always print out the LWP ID if it differs
from the process ID.
* Makefile.in (infcmd.o): Update.
2008-05-01 Jan Kratochvil <jan.kratochvil@redhat.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdb.threads/attach-into-signal.c, gdb.threads/attach-into-signal.exp,
gdb.threads/attach-stopped.c, gdb.threads/attach-stopped.exp,
gdb.threads/attachstop-mt.c, gdb.threads/attachstop-mt.exp: New.
* breakpoint.c (until_break_command_continuation): Add
the 'error' parameter. Directly delete the breakoint as
opposed to running cleanups.
(until_break_command): Install continuation only
after starting the target. Don't use exec cleanups,
use ordinary cleanups. Discard cleanups is successfully
started the target in async mode.
(make_cleanup_delete_breakpoint): Remove.
* breakpoint.h (make_cleanup_delete_breakpoint): Remove
declaration.
* defs.h (do_exec_cleanups, make_exec_cleanup): Remove
declarations.
(struct continations): Add the 'error' parameter to the
continuation_hook field.
(add_continuation, do_all_continuations)
(add_intermediate_continuation)
(do_all_intermediate_continuations): Add the 'error' parameter.
* exceptions.c (throw_exception): Don't call do_exec_cleanups.
* inf-loop.c (inferior_event_handler): Instead of calling
discard_all_continuations, use do_all_continuations with 1 as
'error' parameter. Pass 0 as 'error' parameter in existing uses
of discard_all_continuations.
* infcmd.c (step_1): Do not use exec cleanup. For async case, discard
cleanups.
(step_once): Install continuation only after resuming the target.
(step_1_continuation): Disable longjmp breakpoint on error.
(finish_command_continuation): Add the error parameter. Delete
the finish breakpoint directly, do not use cleanups.
(finish_command): Do not use exec_cleanups. Always setup
continuation. For sync case, immediately run them.
(attach_command_continuation): Add the error parameter.
* infrun.c (fetch_inferior_event): Do not use exec cleanups to
remove step_resume_breakpoint -- adjust delete it directly.
* interps.c (interp_set): Adjust call to do_all_continations.
* mi/mi-interp.c (mi_interpreter_exec_continuation): Do not
do exec cleanups.
* mi/mi-main.c (mi_cmd_target_select): Do not do exec
cleanups.
(mi_cmd_execute): Do not use exec_cleanup.
(mi_execute_async_cli_command): Simplify the string concatenation
logic. Do no use exec cleanup.
(mi_exec_async_cli_cmd_continuation): New parameter error.
Free last_async_command.
* top.c (command_line_handler_continuation): New parameter error.
* utils.c (exec_cleanup_chain, make_exec_cleanup)
(do_exec_cleanups): Remove.
(add_continuation, do_all_continations)
(add_intermediate_continuation)
(do_all_intermediate_continuations): New parameter error.
* infrun.c (normal_stop) Move breakpoint_auto_delete further down
to allow printing to 'see' real reason of stop. This fixes PR 2424.
* breakpoint.c (bpdisp_texst): New function. The function takes over
the role of bpstats static array in print_one_breakpoint_location.
(print_it_typical): Print "Temporary breakpoint" instead
of just "Breakpoint" when breakpoint is, well, temporary. For mi-like
protocols, print disp field.
(print_one_breakpoint_location): Removed bpdisps static definition.
Call new bpstat_text function to get value for 'disp' field.
(mention): Print "Temporary breakpoint" instead of just "Breakpoint".
* 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.
* NEWS: Mention exec tracing support.
* inf-ttrace.c (inf_ttrace_wait): Return TARGET_WAITKIND_EXECD for
exec events.
* infcmd.c (kill_if_already_running, detach_command)
(disconnect_command): Replace SOLIB_RESTART with no_shared_libraries.
* infrun.c (MAY_FOLLOW_EXEC, may_follow_exec): Delete.
(follow_exec): Do not check may_follow_exec. Do not mourn and push
targets. Apply the sysroot path to the loaded executable. Use
no_shared_libraries.
* linux-nat.c (linux_child_follow_fork): Print fork following
messages if verbose.
(kill_wait_callback): Kill again before waiting a second time.
* symfile.c (symbol_file_clear): Replace SOLIB_RESTART with
no_shared_libraries.
* gdb.base/foll-exec.exp: Update header. Skip on remote targets.
Run on GNU/Linux.
(do_exec_tests): Check for systems which do not support catchpoints.
Do not match START.
* gdb.base/foll-fork.exp: Update header. Skip on remote targets.
Run on GNU/Linux. Enable verbose output.
(check_fork_catchpoints): New.
(explicit_fork_child_follow, catch_fork_child_follow)
(tcatch_fork_parent_follow): Update expected messages.
(do_fork_tests): Use check_fork_catchpoints.
* gdb.base/foll-vfork.exp: Update header. Skip on remote targets.
Run on GNU/Linux. Enable verbose output.
(check_vfork_catchpoints): New.
(vfork_parent_follow_to_bp, tcatch_vfork_then_child_follow): Update
expected messages.
(do_vfork_and_exec_tests): Use check_fork_catchpoints.
* thread.c (add_thread_silent): Renamed
from add_thread.
(print_thread_events): New variable definition.
(show_print_thread_events): New function.
(_initialize_thread): Add "set print thread-events" and
"show print thread-events" commands.
(add_thread): Announce new thread.
* gdbthread.h (add_thread_silent): Declare.
(print_thread_events): New variable declaration.
* inf-ttrace.c (inf_ttrace_wait): Don't
inform about new thread, as add_thread is always
called too, and will take care of that.
* infrun.c (handle_inferior_event): Likewise.
* procfs.c (procfs_wait): Likewise.
* remote.c (remote_currthread): Likewise.
* sol-thread.c (sol_thread_wait): Likewise.
* win32-nat.c (get_win32_debug_event): Likewise.
* linux-thread-db.c (attach_thread): Likewise.
Remove the verbose parameter.
(check_event): Make detach_thread be verbose
only if print_thread_events is set.
* linux-nat.c (lin_lwp_attach_lwp): Don't inform
about new thread. This is called only from
linux-thread-db.c:attach_thread, which will take care.
Remove the verbose parameter.
* linux-nat.h (lin_lwp_attach_lwp): Adjust prototype.
* infrun.c (handle_inferior_event): Remove
calls to remove_breakpoints, except where needed to
communicate change of breakpoint locations to inferior.
(keep_going): If steppping over breakpoint, remove
breakpoints.
* infrun.c (trap_expected): Rename
to stepping_over_breakpoint. Document.
(stepping_past_breakpoint): Remove.
(stepping_past_breakpoint_ptdi): Renamed
to deferred_step_ptid.
(struct execution_control_state): Rename
the another_trap field to stepping_over_breakpoint.
(struct inferior_status): Rename the trap_expected
field to stepping_over_breakpoint.
(clear_proceed_status, proceed)
(init_execution_control_state, context_switch)
(handle_inferior_event, currently_stepping)
(keep_going, save_inferior_status)
(restore_inferior_status, prepare_to_proceed): Adjust.
* gdbthread.h (struct thread_info): Rename the
trap_expected field to stepping_over_breakpoint.
* thread.c (load_infrun_state, save_infrun_state):
Adjust.
* breakpoint.h (insert_breakpoints): Change
return type to void.
* breakpoint.c (insert_breakpoints): Change
return type to void. Rename local return_val
variable to error.
* infrun.c (keep_going): Instead of checking
return value from insert_breakpoints, catch exception.
The checks of breakpoints_inserted before calling
remove_breakpoints are removed, as remove_breakpoint
won't touch uninserted breakpoints. In a number of places,
we're interested if a breakpoint is inserted at particular
PC, and we now use breakpoint_inserted_here_p. In a few
places, insert_breakpoints can be called unconditionally,
since it won't try to insert already inserted breakpoint.
* breakpoint.h (regular_breakpoint_inserted_here_p): New
declaration.
* breakpoint.c (regular_breakpoint_inserted_here_p): New.
(breakpoint_inserted_here_p): Use
regular_breakpoint_inserted_here_p.
* infrun.c (breakpoints_inserted): Remove.
(resume): Don't check for breakpoints_inserted before
remove_hw_watchpoints. Use breakpoint_inserted_here_p.
(proceed, init_wait_for_inferior): Don't set breakpoints_inserted.
(handle_inferior_event): Don't use breakpoints_inserted.
Use breakpoints_meant_to_be_inserted and
breakpoints_inserted_here_p.
(insert_step_resume_breakpoint_at_sal, keep_going): Use
breakpoints_meant_to_be_inserted. Don't set breakpoints_inserted.
(normal_stop): Don't check for breakpoints_inserted. Don't
set breakpoints_inserted.
(keep_going): Don't check for breakpoints_inserted.
(insert_step_resume_breakpoint_at_sal): Don't insert
breakpoints
* frame.c (frame_id_inner): Add gdbarch parameter. Replace
current_gdbarch by gdbarch.
(frame_find_by_id, get_prev_frame_1): Use get_frame_arch to get at the
current architecture by frame_info.
* frame.h (frame_id_inner): Add gdbarch parameter.
* stack.c (return_command): Use get_frame_arch to get at the current
architecture by frame_info. Update call of frame_id_inner.
* infrun.c (handle_inferior_event): Likewise.
* dummy-frame.c (dummy_frame_push): Use get_regcache_arch to get at the
current architecture by regcache. Update call of frame_id_inner.
Jeff Johnston <jjohnstn@redhat.com>
* breakpoint.c (watchpoints_triggered): New.
(bpstat_stop_status): Remove STOPPED_BY_WATCHPOINT argument.
Check watchpoint_triggered instead. Combine handling for software
and hardware watchpoints. Do not use target_stopped_data_address
here. Always check a watchpoint if its scope breakpoint triggers.
Do not stop for thread or overlay events. Improve check for
triggered watchpoints without a value change.
(watch_command_1): Insert the scope breakpoint first. Link the
scope breakpoint to the watchpoint.
* breakpoint.h (enum watchpoint_triggered): New.
(struct breakpoint): Add watchpoint_triggered.
(bpstat_stop_status): Update prototype.
(watchpoints_triggered): Declare.
* infrun.c (enum infwait_status): Add infwait_step_watch_state.
(stepped_after_stopped_by_watchpoint): Delete.
(handle_inferior_event): Make stepped_after_stopped_by_watchpoint
local. Handle infwait_step_watch_state. Update calls to
bpstat_stop_status. Use watchpoints_triggered to check
watchpoints.
* remote.c (stepped_after_stopped_by_watchpoint): Remove extern.
(remote_stopped_data_address): Do not check it.
* gdb.texinfo (Setting Watchpoints): Adjust warning text about
multi-threaded watchpoints.
* gdbint.texinfo (Watchpoints): Describe how watchpoints are
checked. Describe sticky notification. Expand description
of steppable and continuable watchpoints.
(Watchpoints and Threads): New subsection.
* gdb.threads/watchthreads.c (thread_function): Sleep between
iterations.
* gdb.threads/watchthreads.exp: Allow two watchpoints to trigger
at once for S/390. Generate matching fails and passes.
(resolve_pending_breakpoint): Remove.
(re_enable_breakpoints_in_shlibs): Remove.
(unlink_locations_from_global_list): New.
(update_breakpoint_locations): New.
(breakpoint_re_set_one): Don't bail out on pending breakpoints.
Use parse_condition and update_breakpoint_location to
reset breakpoint. Ignore 'symbol not found' error from
decode_line_1.
(breakpoint_re_set): Don't emit newline before the
reason why breakpoint is not reset.
(do_enable_breakpoint): Don't specially process pending
breakpoints.
(free_bp_location): New.
(break_command_1): For pending breakpoints, initialize
all fields of a sal with zeroes.
* breakpoint.h (re_enable_breakpoints_in_shlibs): Remove.
* infcmd.c (post_create_inferior): Don't call
re_enable_breakpoints_in_shlibs.
* infrun.c (handle_inferior_event): Likewise.
* solib-irix.c (irix_solib_create_inferior_hook): Likewise.
* solib-osf.c (osf_solib_create_inferior_hook): Likewise.
* win32-nat.c (get_win32_debug_event): Likewise.
(stepping_past_breakpoint_ptid): Likewise.
(prepare_to_proceed): Add STEP parameter. Do not check for Ctrl-C.
Only switch threads if we need to single-step over a breakpoint hit
in the previously selected thread. If stepping, remember previous
thread to switch back to in STEPPING_PAST_BREAKPOINT[_PTID]. Call
switch_to_thread instead of copying its contents.
(proceed): Pass STEP to prepare_to_proceed. Always set ONEPROC if
prepare_to_proceed returns true.
(init_wait_for_inferior): Reset STEPPING_PAST_BREAKPOINT.
(context_switch): Call switch_to_thread.
(handle_inferior_event): Switch back to previous thread if requested
in STEPPING_PAST_BREAKPOINT[_PTID] by prepare_to_proceed.
* gdbthread.h (switch_to_thread): Add prototype.
* thread.c (switch_to_thread): Make global.
(start_remote): Use STOP_QUIETLY_REMOTE.
(handle_inferior_event): Do not condition TARGET_WAITKIND_LOADED
support on a SOLIB_ADD definition. Update breakpoints_inserted.
Update to match shared library event breakpoint support. Only
resume if appropriate. Handle STOP_QUIETLY_REMOTE.
(normal_stop): Handle TARGET_WAITKIND_LOADED.
* fork-child.c (startup_inferior): Do not set
inferior_ignoring_startup_exec_events
* inferior.h (inferior_ignoring_startup_exec_events): Delete
declaration.
(enum stop_kind): Improve documentation. Add STOP_QUIETLY_REMOTE.
* config/gdbserver.exp (gdb_reconnect): New.
* gdb.base/so-disc-shr.c, gdb.base/solib-disc.c,
gdb.base/solib-disc.exp: New files.
* lib/gdb.exp (gdb_test_multiple): Allow tests to match "Ending
remote debugging".
(gdb_compile): Add shlib_load flag.
* lib/gdbserver-support.exp (gdbserver_run): Save the protocol and
port.
(gdbserver_reconnect): New.
is always active if SOFTWARE_SINGLE_STEP_P is true.
(resume): Use gdbarch_software_single_step[_p] instead of
SOFTWARE_SINGLE_STEP[_P].
(handle_inferior_event): Do not check for SOFTWARE_SINGLE_STEP_P.
* gdbarch.sh (software_single_step): Remove target macro.
* gdbarch.h, gdbarch.c: Regenerate.
(normal_stop): Allocate regcache for stop_registers.
(struct inferior_status): Remove stop_registers member.
(save_inferior_status): Do not save stop_registers.
(restore_inferior_status): Do not restore stop_registers.
(discard_inferior_status): Do not discard stop_registers.
(build_infrun): Remove.
(_initialize_infrun): Do not swap stop_registers.