when breakpoints fail. Move general breakpoint error messages to
insert_breakpoints.
* breakpoint.c (insert_breakpoints): Change warnings when
breakpoints are nto inserted to specify the type. Remove call to
memory_error when hardware breakpoints can't be inserted. Remove
multiple calls to warning so all messages are sent to the user at
once.
(delete_breakpoints): Make insert error messsages more explicit.
procfs appears to be broken when debugging on multi-processor
machines. So enable software single stepping in order to avoid
using the procfs interface to do next/step operations, using
internal breakpoints instead.
* infrun.c (handle_inferior_event): Readjust the stop_pc by
DECR_PC_AFTER_BREAK when hitting a single step breakpoint, to
make this pc address equal to the value it would have if the
system stepping capability was used. Also set a new flag used
to ensure that we don't readjust the PC one more time later.
* breakpoint.c (bpstat_stop_status): Do not adjust the PC
address by DECR_PC_AFTER_BREAK when software single step is
in use for this architecture, as this has already been taken
care of in handle_inferior_event().
signal, check whether we hit a breakpoint before checking for a
single step breakpoint. Otherwise, GDB fails to notice that a
breakpoint has been hit when stepping onto a breakpoint.
regcache'''.
(xmalloc_inferior_status): Delete function.
(free_inferior_status): Delete function.
(normal_stop): Use regcache_cpy.
(struct inferior_status): Change type of fields ``stop_registers''
and ``registers'' to ``struct regcache''.
(write_inferior_status_register): Use regcache_write.
(save_inferior_status): Instead of calling
xmalloc_inferior_status, allocate the inf_status buffer directly.
Use regcache_dup_no_passthrough and regcache_dup to save the
buffers.
(restore_inferior_status): Use regcache_xfree and regcache_cpy.
Replace the stop_registers regcache instead of overriding it. Use
regcache_xfree. Instead of calling free_inferior_status, xfree
the buffer directly.
(discard_inferior_status): Use regcache_xfree. Instead of calling
free_inferior_status, xfree the buffer directly.
(build_infrun): Use regcache_xmalloc.
(_initialize_infrun): Delete redundant call to build_infrun.
* Makefile.in (infcmd.o): Add $(regcache_h).
* infcmd.c: Include "regcache.h".
(run_stack_dummy): Use deprecated_grub_regcache_for_registers to
obtain the address of `stop_registers' register buffer.
(print_return_value): Ditto.
* inferior.h (struct regcache): Add opaque declaration.
(stop_registers): Change variable's declared type to ``struct
regcache''.
selected_frame_address and selected_level with field
selected_frame_id.
(save_inferior_status): Update. Use get_frame_id.
(struct restore_selected_frame_args): Delete.
(restore_selected_frame): Update. Use frame_find_by_id.
(restore_inferior_status): Update.
* breakpoint.h (struct breakpoint): Change type of
watchpoint_frame to frame_id.
* breakpoint.c (insert_breakpoints): Use frame_find_by_id. Remove
call to get_current_frame.
(do_enable_breakpoint): Use frame_find_by_id. Remove call to
get_current_frame.
(watchpoint_check): Use frame_find_by_id.
* frame.h (record_selected_frame): Delete declaration.
* stack.c (record_selected_frame): Delete function.
* frame.h (struct frame_id): Define.
(get_frame_id): Declare.
(frame_find_by_id): Declare.
* frame.c (frame_find_by_id): New function.
(get_frame_id): New function.
(execute_cmd_pre_hook): Declare.
* cli/cli-script.c (clear_hook_in_cleanup): New function.
(execute_cmd_post_hook, execute_cmd_pre_hook): New
functions. Execute pre/post hook while ensuring that afterwords
hook_in is cleared.
* top.c (execute_command): Use execute_cmd_post_hook, and
execute_cmd_pre_hook to execute pre/post commands.
* infrun.c (normal_stop): Pass stop_command and not pre_hook to
hook_stop_stub.
(hook_stop_stub): Call execute_cmd_pre_hook.
* gdbarch.c gdbarch.h: Regenerate.
* breakpoint.c (create_longjmp_breakpoint): Always compile this
function.
(breakpoint_reset): Test GET_LONGJMP_TARGET_P().
* infrun.c (GET_LONGJMP_TARGET): Delete default definition.
(handle_inferior_event): Test GET_LONGJMP_TARGET_P().
* arm-tdep.h (struct gdbarch_tdep): Add jb_pc and jb_elt_size fields.
* arm-tdep.c (arm_get_longjmp_target): New function.
(arm_gdbarch_init): Initialize jb_pc to -1. If ABI handler changes
this to a positive value register arm_get_longjmp_target as the
longjmp handler.
* arm-linux-tdep.c (arm_get_longjmp_target): Delete.
(arm_linux_init_abi): Set up longjmp description in tdep.
* armnbsd-nat.c (get_longjmp_target): Delete.
* armnbsd-tdep.c (arm_netbsd_init_abi_common): Set up longjmp
description in tdep.
* config/arm/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC): Delete.
(get_longjmp_target): Delete declaration.
(GET_LONGJMP_TARGET): Delete.
* config/arm/tm-linux.h (arm_get_longjmp_target): Delete declaration.
(GET_LONGJMP_TARGET): Delete.
* top.c (command_loop): Remove tui insert_mode hacks; don't call
tuiCleanUp because this must be made with atexit by tui.
* symfile.c (symbol_file_command): Remove call to TUIDO
* stack.c (show_and_print_stack_frame_stub): Remove tui check;
not necessary when using the selected frame hooks.
(print_stack_frame_stub): Likewise.
(print_frame_info_base): Likewise.
(print_frame_info): Likewise.
(up_silently_command): Likewise.
(down_silently_command): Likewise.
(show_stack_frame): Likewise for TUIDO.
(select_frame): Likewise.
(select_and_print_frame): Likewise.
(stack_publish_stopped_with_no_frame): Remove.
(select_and_maybe_print_frame): Remove.
* main.c (captured_main): Remove tui_fileopen and tuiInit; tui
must use the initialize ui hook.
* infrun.c (normal_stop): Remove call to TUIDO; tui must use the
selected frame hooks.
* event-top.c (command_handler): Remove tui insert_mode hack.
* defs.h: Remove TUIDO; Only include tui.h.
* breakpoint.c (mention): Remove calls to TUIDO.
(delete_breakpoint): Remove tui hacks; tui must install
the breakpoint hooks.
* infrun.c (handle_inferior_event): Replace prev_pc test in all
calls to bpstat_stop_status (removed in 1999-09-24). This test
helps distinguish stepping over a breakpoint trap from stepping
thru a jump to the instruction after a breakpoint trap.
(handle_inferior_event): Don't bother writing the PC if
DECR_PC_AFTER_BREAK is zero (optimization).
* breakpoint.c (bpstat_stop_status): Add comment explaining the
purpose and usage of the "not_a_breakpoint" argument in computing
the breakpoint address.
* infrun.c: Eliminate the "thread_step_needed" state variable,
and replace it with a relatively simple test in resume.
(resume): Replace thread_step_needed logic with a test for
stepping, breakpoint_here_p and breakpoints_inserted.
Move CANNOT_STEP_BREAKPOINT logic to after thread_step logic.
(proceed): Discard thread_step_needed logic.
(wait_for_inferior, fetch_inferior_event, handle_inferior_event):
Discard thread_step_needed logic.
* infrun.c (context_switch): New function. Abstract the operation
of saving and restoring infrun's state when switching threads.
(handle_inferior_event): Normalize the handling of the 'thread hop'
event (when the wrong thread hits a thread-specific breakpoint,
and we need to solo-step that thread past the breakpoint).
Call keep_going, instead of target_resume. Handle the subsequent
singlestep-trap as a normal event instead of just resuming.
* gdbthread.h (struct thread_info): Add new fields:
current_line, current_symtab, step_sp, for saved infrun state.
* thread.c (save_infrun_state, load_infrun_state): Save and
restore current_line, current_symtab, and step_sp.
(add_thread): Rather than adding assignments to initialize
the new fields, just use memset (tp, 0, sizeof (*tp).
This way future new fields will not be overlooked.
* infrun.c (handle_inferior_event): Save and restore save_sp,
current_line, and current_symtab when switching threads.
* thread.c (delete_step_resume_breakpoint): New function.
Maintain internal consistency of the thread list while deleting
a step_resume_breakpoint.
* gdbthread.h (delete_step_resume_breakpoint): Export.
* breakpoint.c (bpstat_find_step_resume_breakpoint):
Make thread-aware: don't return a step_resume_breakpoint
for the wrong thread.
* infrun.c (wait_for_inferior): Call delete_step_resume_breakpoint
instead of delete_breakpoint_current_contents.
(fetch_inferior_event): Ditto.
(handle_inferior_event): Call delete_step_resume_breakpoint
instead of delete_breakpoint.
* infrun.c (handle_inferior_event): After singlestepping over a
thread-specific breakpoint, use currently_stepping() to decide
whether to step or continue.
* arch-utils.c (default_prepare_to_proceed)
(generic_prepare_to_proceed): Added new functions.
* arch-utils.h: New function declarations for
default_prepare_to_proceed() and generic_prepare_to_proceed().
* gdbarch.sh: Added PREPARE_TO_PROCEED.
* gdbarch.c: Regenerated.
* gdbarch.h: Regenerated.
* inferior.h: Added get_last_target_status() declaration.
* infrun.c (get_last_target_status): Added new function.
(handle_inferior_event): Saves last pid and waitstatus, which will
get returned by get_last_target_status().
* hppa-tdep.c (prepare_to_proceed): Added comment stating that
prepare_to_proceed() is potentially redundant since
default_prepare_to_proceed() has been added.
* linux-thread.c (prepare_to_proceed): Ditto.
* lin-lwp.c (prepare_to_proceed): Ditto.
* m3-nat.c (prepare_to_proceed): Ditto.