* solib.c (update_solib_list): Update the program space's
added_solibs and deleted_solibs fields.
* progspace.h (struct program_space) <added_solibs,
deleted_solibs>: New fields.
(clear_program_space_solib_cache): Declare.
* progspace.c (release_program_space): Call
clear_program_space_solib_cache.
(clear_program_space_solib_cache): New function.
* infrun.c (handle_inferior_event) <TARGET_WAITKIND_LOADED>: Call
bpstat_stop_status. Use handle_solib_event.
* breakpoint.c: Include gdb_regex.h.
(print_solib_event): New function.
(bpstat_print): Use print_solib_event.
(bpstat_stop_status): Add special case for bp_shlib_event.
(handle_solib_event): New function.
(bpstat_what): Use handle_solib_event.
(struct solib_catchpoint): New.
(dtor_catch_solib, insert_catch_solib, remove_catch_solib)
(breakpoint_hit_catch_solib, check_status_catch_solib)
(print_it_catch_solib, print_one_catch_solib)
(print_mention_catch_solib, print_recreate_catch_solib): New
functions.
(catch_solib_breakpoint_ops): New global.
(catch_load_or_unload, catch_load_command_1)
(catch_unload_command_1): New functions.
(internal_bkpt_check_status): Add special case for
bp_shlib_event.
(internal_bkpt_print_it): Use print_solib_event.
(initialize_breakpoint_ops): Initialize
catch_solib_breakpoint_ops.
(_initialize_breakpoint): Register "catch load" and "catch
unload".
* breakpoint.h (handle_solib_event): Declare.
* NEWS: Add entry for "catch load" and "catch unload".
gdb/doc
* gdb.texinfo (Set Catchpoints): Document "catch load" and "catch
unload".
(Files): Mention new catch commands.
(GDB/MI Async Records): Likewise.
gdb/testsuite
* lib/mi-support.exp (mi_expect_stop): Add special case for
solib-event.
* gdb.base/catch-load-so.c: New file.
* gdb.base/catch-load.exp: New file.
* gdb.base/catch-load.c: New file.
* gdb.base/break-interp.exp (reach_1): Update regexp.
* breakpoint.c (breakpoint_hit_catch_fork)
(breakpoint_hit_catch_vfork, breakpoint_hit_catch_syscall)
(breakpoint_hit_catch_exec): Make use of the `ws' argument.
* infrun.c (inferior_has_forked, inferior_has_vforked)
(inferior_has_execd, inferior_has_called_syscall): Delete.
(handle_syscall_event): Get syscall_number from the execution
control state's wait status.
(wait_for_inferior): Don't clear syscall_number.
* breakpoint.c (bpstat_stop_status): Moving clearing print_it
outside `bs->stop' block.
(bpstat_what): Rework bp_shlib_event handling.
(internal_bkpt_check_status): If the breakpoint is a
bp_shlib_event, then set bs->stop and bs->print if
stop_on_solib_events is set.
Fix watchpoints to be specific for each inferior.
* breakpoint.c (watchpoint_in_thread_scope): Verify also
current_program_space.
* i386-nat.c (i386_inferior_data_cleanup): New.
(i386_inferior_data_get): Replace variable inf_data_local by an
inferior_data call.
(i386_use_watchpoints): Initialize i386_inferior_data.
* linux-nat.c (linux_nat_iterate_watchpoint_lwps): Use INFERIOR_PTID
specific iterate_over_lwps.
gdb/testsuite/
Fix watchpoints to be specific for each inferior.
* gdb.multi/watchpoint-multi.c: New file.
* gdb.multi/watchpoint-multi.exp: New file.
* NEWS: Add item.
* symtab.h (compare_filenames_for_search): Declare.
* symtab.c (compare_filenames_for_search): New function.
(iterate_over_some_symtabs): Use it.
* symfile.h (struct quick_symbol_functions)
<map_symtabs_matching_filename>: Change spec.
* psymtab.c (partial_map_symtabs_matching_filename): Use
compare_filenames_for_search. Update for new spec.
* dwarf2read.c (dw2_map_symtabs_matching_filename): Use
compare_filenames_for_search. Update for new spec.
* breakpoint.c (clear_command): Use compare_filenames_for_search.
gdb/doc
* gdb.texinfo (Specify Location): Document relative file name
handling.
gdb/testsuite
* gdb.linespec/linespec.exp: Change some tests to use $decimal.
Add tests for relative directory.
* breakpoint.c (create_sals_from_address_default): New function.
(create_breakpoints_sal_default): Likewise.
(decode_linespec_default): Likewise.
(is_marker_spec): Removed.
(strace_marker_p): New function.
(init_breakpoint_sal): Using `strace_marker_p' instead of
`is_marker_spec'.
(create_breakpoint): Call method `create_sals_from_address' from
breakpoint_ops, replacing code that created SALs conditionally
on the type of the breakpoint. Call method `create_breakpoints_sal',
replacing code that created breakpoints conditionally on the type
wanted.
(base_breakpoint_create_sals_from_address): New function.
(base_breakpoint_create_breakpoints_sal): Likewise.
(base_breakpoint_decode_linespec): Likewise.
(base_breakpoint_ops): Add methods
`base_breakpoint_create_sals_from_address',
`base_breakpoint_create_breakpoints_sal' and
`base_breakpoint_decode_linespec'.
(bkpt_create_sals_from_address): New function.
(bkpt_create_breakpoints_sal): Likewise.
(bkpt_decode_linespec): Likewise.
(tracepoint_create_sals_from_address): Likewise.
(tracepoint_create_breakpoints_sal): Likewise.
(tracepoint_decode_linespec): Likewise.
(strace_marker_create_sals_from_address): Likewise.
(strace_marker_create_breakpoints_sal): Likewise.
(strace_marker_decode_linespec): Likewise.
(strace_marker_breakpoint_ops): New variable.
(addr_string_to_sals): Remove `marker_spec'. Call method
`decode_linespec' from breakpoint_ops, replacing code that decoded
an address string into a SAL. Use `strace_marker_p' instead of
`marker_spec'.
(strace_command): Decide whether we are dealing with a static
tracepoint with marker or not. Use the appropriate breakpoint_ops.
(initialize_breakpoint_ops): Initialize new fields of breakpoint_ops.
* breakpoint.h (linespec_result, linespec_sals): New forward
declarations.
(breakpoint_ops) <create_sals_from_address>,
<create_breakpoints_sal>, <decode_linespec>: New methods.
* Makefile.in (SUBDIR_PYTHON_OBS): Add py-finishbreakpoint.o.
(SUBDIR_PYTHON_SRCS): Add python/py-finishbreakpoint.c.
Add build rule for this file.
* infcmd.c (print_return_value): Split to create get_return_value.
(get_return_value): New function based on print_return_value. Handle
case where stop_registers are not set.
* inferior.h (get_return_value): New prototype.
* python/py-breakpoint.c (bppy_pending_object): Make non-static.
(gdbpy_breakpoint_created): Set is_py_finish_bp is necessary.
(struct breakpoint_object): Move to python-internal.h
(BPPY_REQUIRE_VALID): Likewise.
(BPPY_SET_REQUIRE_VALID): Likewise.
(gdbpy_breakpoint_created): Initialize is_finish_bp.
(gdbpy_should_stop): Add pre/post hooks before/after calling stop
method.
* python/python-internal.h (breakpoint_object_type): Add as extern.
(bppy_pending_object): Likewise.
(typedef struct breakpoint_object) Removed.
(struct breakpoint_object): Moved from py-breakpoint.c.
Add field is_finish_bp.
(BPPY_REQUIRE_VALID): Moved from py-breakpoint.c.
(BPPY_SET_REQUIRE_VALID): Likewise.
(frame_object_to_frame_info): New prototype.
(gdbpy_initialize_finishbreakpoints): New prototype.
(bpfinishpy_is_finish_bp): Likewise.
(bpfinishpy_pre_stop_hook): Likewise.
(bpfinishpy_post_stop_hook): Likewise.
* python/py-finishbreakpoint.c: New file.
* python/py-frame.c(frame_object_to_frame_info): Make non-static and
accept PyObject instead of frame_object.
(frapy_is_valid): Don't cast to frame_object.
(frapy_name): Likewise.
(frapy_type): Likewise.
(frapy_unwind_stop_reason): Likewise.
(frapy_pc): Likewise.
(frapy_block): Likewise.
(frapy_function): Likewise.
(frapy_older): Likewise.
(frapy_newer): Likewise.
(frapy_find_sal): Likewise.
(frapy_read_var): Likewise.
(frapy_select): Likewise.
* python/python.c (gdbpy_is_stopped_at_finish_bp): New noop function.
(_initialize_python): Add gdbpy_initialize_finishbreakpoints.
* python/python.h: Include breakpoint.h
(gdbpy_is_stopped_at_finish_bp): New prototype.
doc/
* gdb.texinfo (Finish Breakpoints in Python): New subsection.
(Python API): Add menu entry for Finish Breakpoints.
testsuite/
* Makefile.in (EXECUTABLES): Add py-finish-breakpoint and
py-finish-breakpoint2
(MISCALLANEOUS): Add py-events-shlib.so and py-events-shlib-nodebug.so
* gdb.python/py-breakpoint.exp (mult_line): Define and use variable
instead of line number.
* gdb.python/py-finish-breakpoint.c: New file.
* gdb.python/py-finish-breakpoint.exp: New file.
* gdb.python/py-finish-breakpoint.py: New file.
* gdb.python/py-finish-breakpoint2.cc: New file.
* gdb.python/py-finish-breakpoint2.exp: New file.
* gdb.python/py-finish-breakpoint2.py: New file.
* breakpoint.h (struct tracepoint): New field traceframe_usage.
* breakpoint.c (print_one_breakpoint_location): Identify
tracepoints as such when reporting hit counts, report
trace buffer usage.
(create_tracepoint_from_upload): Copy status info.
* tracepoint.h (struct trace_status): Rename error_desc to stop_desc,
add fields user_name, notes, start_time, stop_time.
(struct uploaded_tp): Add fields hit_count, traceframe_usage.
* tracepoint.c (trace_user): New global.
(trace_notes): New global.
(trace_stop_notes): New global.
(start_tracing): Add argument and trace note handling.
(stop_tracing): Ditto.
(trace_start_command): Add notes argument.
(trace_stop_command): Ditto.
(trace_status_command): Report additional status info.
(trace_status_mi): Similarly.
(trace_save): Update, record tracepoint status.
(set_disconnected_tracing): Call target method directly.
(send_disconnected_tracing_value): Remove.
(set_trace_user): New function.
(set_trace_notes): New function.
(set_trace_stop_notes): New function.
(parse_trace_status): Handle additional status.
(parse_tracepoint_status): New function.
(parse_tracepoint_definition): Call it.
(tfile_get_tracepoint_status): New function.
(init_tfile_ops): Use it.
(_initialize_tracepoint): Add new setshows.
* target.h (struct target_ops): New methods to_get_tracepoint_status
and to_set_trace_notes.
(target_get_tracepoint_status): New macro.
(target_set_trace_notes): New macro.
* target.c (update_current_target): Add new methods.
* remote.c (remote_get_tracepoint_status): New function.
(remote_set_trace_notes): New function.
(init_remote_ops): Add them.
* mi/mi-main.c (mi_cmd_trace_start): Add argument to call.
(mi_cmd_trace_stop): Ditto.
* tracepoint.c (struct tracepoint): New field traceframe_usage.
(tracing_start_time): New global.
(tracing_stop_time): New global.
(tracing_user_name): New global.
(tracing_notes): New global.
(tracing_stop_note): New global.
(cmd_qtstart): Set traceframe_usage, start_time.
(stop_tracing): Set stop_time.
(cmd_qtstatus): Report additional status.
(cmd_qtp): New function.
(handle_tracepoint_query): Call it.
(cmd_qtnotes): New function.
(handle_tracepoint_general_set): Call it.
(get_timestamp): Rename from tsv_get_timestamp.
* gdb.texinfo (Starting and Stopping Trace Experiments): Document
note-related options and variables.
(Tracepoint Packets): Document packet changes.
* gdb.trace/tstatus.exp: New.
* gdb.trace/actions.c: Include string.h.
* breakpoint.h (pc_at_non_inline_function): Declare.
* breakpoint.c (is_non_inline_function,
pc_at_non_inline_function): New functions.
* infrun.c (handle_inferior_event): Don't call skip_inline_frames
if the stop is at a location where functions cannot be inlined.
Initially, I noticed that the save command was often missing
new lines in the file that it generated. For instance, consider:
% gdb save-bp
(gdb) b break_me
(gdb) b save-bp.c:27
(gdb) save breakpoints bps
The contents of the bps file would be:
% cat bps
break break_mebreak save-bp.c:27
Looking further into the problem, I realized that the missing newlines
are just a consequence of a missing call to print_recreate_thread.
After having generated the breakpoint location in the break command,
we cannot put a new line until we have looked at whether we need to
add a 'thread NUM' argument.
gdb/ChangeLog:
* breakpoint.c (bkpt_print_recreate): Add call to
print_recreate_thread.
gdb/testsuite/ChangeLog:
* gdb.base/save-bp.exp, gdb.base/save-bp.c: New files.
* breakpoint.c (update_watchpoint): Handle the case of the
watchpoint to update not being in the breakpoint list yet.
(hw_watchpoint_use_count): New, factored out from
hw_watchpoint_used_count.
(hw_watchpoint_used_count): Rename to ...
(hw_watchpoint_used_count_others): ... this. Add `except'
parameter. Don't count resources of `except'. Use
hw_watchpoint_use_count.
* breakpoint.c (bpstat_do_actions): New variable cleanup_if_error, call
make_bpstat_clear_actions_cleanup and discard_cleanups for it.
* defs.h (make_bpstat_clear_actions_cleanup): New declaration.
* exceptions.c (throw_exception): Remove the bpstat_clear_actions call.
* inf-loop.c (inferior_event_handler): New variable cleanup_if_error,
call make_bpstat_clear_actions_cleanup and discard_cleanups for it.
Call bpstat_clear_actions for failed fetch_inferior_event_wrapper.
* infrun.c (fetch_inferior_event): Call
make_bpstat_clear_actions_cleanup.
* top.c (execute_command): New variable cleanup_if_error, call
make_bpstat_clear_actions_cleanup and discard_cleanups for it.
* utils.c (do_bpstat_clear_actions_cleanup)
(make_bpstat_clear_actions_cleanup): New functions.
gdb/testsuite/
* gdb.base/commands.exp (error_clears_commands_left): New function.
(): Call it.
No functionality change.
* breakpoint.c (bpstat_clear_actions): Remove the BS parameter, make
function comment a reference, new variables tp and bs, move here code
from throw_exception.
* breakpoint.h (bpstat_clear_actions): Remove the BS parameter,
describe it in the comment.
* exceptions.c (throw_exception): Remove variable tp, move the code for
bpstat_clear_actions to bpstat_clear_actions.
Code cleanup.
* breakpoint.c (bpstat_clear_actions): Remove clearing of commands_left.
(command_line_is_silent): New function.
(bpstat_do_actions_1): No longer use commands_left, use
command_line_is_silent for commands.
(bpstat_alloc): Remove clearing of commands_left.
(bpstat_stop_status): Remove initialization of commands_left, use
command_line_is_silent.
* breakpoint.h (struct bpstats): Remove commands_left.
* breakpoint.c (update_global_location_list): Ensure
invariant 'first loc marked not duplicated and inserted,
following locs marked duplicated/not inserted' is respected
for multiple locations at the same address.
(unduplicated_should_be_inserted) New function.
(swap_insertion) New function.
2011-08-03 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.base/break-always.exp: Complete the test
with duplicated breakpoints and enabling/disabling them.
gdb/
* breakpoint.c (works_in_software_mode_watchpoint): Also return
true for software watchpoints.
gdb/testsuite/
* gdb.base/watchpoint.exp
(test_disable_enable_software_watchpoint): New procedure.
(top level): Run it.
Implement most breakpoint_ops methods for all breakpoint types,
and move the default handlings to the proper callbacks.
gdb/
* breakpoint.c (update_watchpoint): Always call the breakpoint's
works_in_software_mode method.
(insert_bp_location): Go through breakpoint_ops->insert_location
for software and hardware watchpoints.
(create_internal_breakpoint): Pass bkpt_breakpoint_ops as
breakpoint_ops.
(remove_breakpoint_1): Go through breakpoint_ops->remove_location
for software and hardware watchpoints.
(print_it_typical): Delete.
(print_bp_stop_message): Always call the breakpoint_ops->print_it
method.
(watchpoint_check): Adjust comment.
(bpstat_check_location): Simply always call the breakpoint's
breakpoint_hit method.
(bpstat_stop_status): Always call the breakpoint's check_status
method. Remove special cases for watchpoints and internal event
breakpoints from here (moved to the check_status implementations).
(print_one_breakpoint_location): Assume b->ops is never NULL.
Remove static tracepoint marker id printing from here (moved to
the print_one_detail callback implementation of tracepoints).
(init_bp_location): Assert OPS is never NULL.
(allocate_bp_location): Always call the breakpoint's
allocate_location method, and remove the default code from here.
(free_bp_location): Always call the location's dtor method, and
remove the default code from here.
(init_raw_breakpoint_without_location): Assert OPS is never NULL.
(set_raw_breakpoint_without_location): Add new breakpoint_ops
parameter. Pass it down.
(set_raw_breakpoint): Ditto.
(print_it_catch_fork): Adjust to take a bpstat as argument.
(catch_fork_breakpoint_ops): Install methods.
(print_it_catch_vfork): Adjust to take a bpstat as argument.
(catch_vfork_breakpoint_ops): Install methods.
(dtor_catch_syscall): Call the base dtor.
(print_it_catch_syscall): Adjust to take a bpstat as argument.
(catch_syscall_breakpoint_ops): Install methods.
(dtor_catch_exec): Call the base dtor.
(print_it_catch_exec): Adjust to take a bpstat as argument.
(catch_exec_breakpoint_ops): Install methods.
(hw_breakpoint_used_count, hw_watchpoint_used_count): Always call
the breakpoint's resources_needed method, and remove the default
code from here.
(set_momentary_breakpoint): Pass bkpt_breakpoint_ops as
breakpoint_ops.
(clone_momentary_breakpoint): Clone the original's ops.
(mention): Always call the breakpoint's print_mention method, and
remove the default code from here.
(create_breakpoint_sal): Adjust to pass the ops to
set_raw_breakpoint rather than setting it manually.
(create_breakpoint): Assert ops is never NULL. Adjust to pass the
ops to set_raw_breakpoint_without_location rather than setting it
manually.
(break_command_1): Pass bkpt_breakpoint_ops as breakpoint_ops.
(print_it_ranged_breakpoint): Adjust to take a bpstat as argument.
(ranged_breakpoint_ops): Install methods.
(break_range_command): Adjust to pass the ops to
set_raw_breakpoint rather than setting it manually.
(re_set_watchpoint, breakpoint_hit_watchpoint)
(check_status_watchpoint, resources_needed_watchpoint)
(works_in_software_mode_watchpoint, print_it_watchpoint)
(print_mention_watchpoint, print_recreate_watchpoint): New
functions.
(watchpoint_breakpoint_ops): Install new methods.
(print_it_masked_watchpoint): New function.
(masked_watchpoint_breakpoint_ops): Install new methods.
(watch_command_1): Adjust to pass the right breakpoint_ops to
set_raw_breakpoint_without_location rather than setting it
manually later. Record the current pspace.
(print_it_exception_catchpoint): Adjust to take a bpstat as
argument.
(gnu_v3_exception_catchpoint_ops): Install new methods.
(say_where): New function.
(null_re_set, null_check_status, null_works_in_software_mode)
(null_resources_needed, null_print_one_detail, bp_location_dtor):
New functions.
(bp_location_ops): New global.
(bkpt_dtor, bkpt_allocate_location, bkpt_re_set)
(bkpt_insert_location, bkpt_remove_location, bkpt_breakpoint_hit)
(bkpt_check_status, bkpt_resources_needed)
(bkpt_works_in_software_mode, bkpt_print_it, bkpt_print_mention)
(bkpt_print_recreate): New functions.
(bkpt_breakpoint_ops): New global.
(tracepoint_re_set, tracepoint_insert_location)
(tracepoint_remove_location, tracepoint_breakpoint_hit)
(tracepoint_check_status, tracepoint_works_in_software_mode)
(tracepoint_print_it, tracepoint_print_one_detail)
(tracepoint_print_mention, tracepoint_print_recreate): New
functions.
(tracepoint_breakpoint_ops): New global.
(delete_breakpoint): Always call the breakpoint's dtor method, and
remove the default handling from here.
(breakpoint_re_set_default): Make static.
(breakpoint_re_set_one): Always call the breakpoints re_set
method, and remove the default handling from here.
(trace_command, ftrace_command, strace_command)
(create_tracepoint_from_upload): Pass appropriate breakpoints_ops
to create_breakpoint.
(save_breakpoints): Always call the breakpoint's print_recreate
method, and remove the default handling from here.
* ada-lang.c (dtor_exception): Call the base dtor.
(re_set_exception): Call the base method.
(print_it_exception, print_it_catch_exception): Adjust to take a
bpstat as argument.
(catch_exception_breakpoint_ops): Install methods.
(print_it_catch_exception_unhandled): Adjust to take a bpstat as
argument.
(catch_exception_unhandled_breakpoint_ops): Install methods.
(print_it_catch_assert): Adjust to take a bpstat as argument.
(catch_assert_breakpoint_ops): Install methods.
* breakpoint.h (struct breakpoint_ops): Adjust the print_it method
to take a bpstat as argument.
(enum print_stop_action): Add describing comments to each enum
value.
(breakpoint_re_set_default): Delete declaration.
(null_re_set, null_works_in_software_mode, null_resources_needed)
(null_check_status, null_print_one_detail): Declare.
(bkpt_breakpoint_ops): Declare.
(bkpt_dtor, bkpt_allocate_location, bkpt_re_set)
(bkpt_insert_location, bkpt_remove_location, bkpt_breakpoint_hit)
(bkpt_check_status, bkpt_resources_needed)
(bkpt_works_in_software_mode, bkpt_print_it)
(null_print_one_detail, bkpt_print_mention, bkpt_print_recreate):
Declare.
* mi/mi-cmd-break.c (mi_cmd_break_insert): Adjust to pass
bkpt_breakpoint_ops.
* python/py-breakpoint.c (bppy_init): Ditto.
* breakpoint.c (bpstat_stop_status): Call the check_status
breakpoint_ops method.
(print_one_breakpoint_location): Also print the condition for Ada
exception catchpoints.
(allocate_bp_location): New, factored out from
allocate_bp_location.
(allocate_bp_location): Adjust. Call the owner breakpoint's
allocate_location method, if there is one.
(free_bp_location): Call the locations's dtor method, if there is
one.
(init_raw_breakpoint_without_location): New breakpoint_ops
parameter. Use it.
(set_raw_breakpoint_without_location): Adjust.
(init_raw_breakpoint): New breakpoint_ops parameter. Pass it down.
(set_raw_breakpoint): Adjust.
(catch_fork_breakpoint_ops, catch_vfork_breakpoint_ops)
(catch_syscall_breakpoint_ops): Install NULL allocate_location,
re_set and check_status methods.
(init_catchpoint): Don't memset, initialize thread, addr_string
and enable_state. Pass the ops down to init_raw_breakpoint.
(install_catchpoint): Rename to ...
(install_breakpoint): ... this, and make extern.
(create_fork_vfork_event_catchpoint): Adjust.
(catch_exec_breakpoint_ops): Install NULL allocate_location,
re_set and check_status methods.
(create_syscall_event_catchpoint): Adjust.
(ranged_breakpoint_ops, watchpoint_breakpoint_ops)
(masked_watchpoint_breakpoint_ops): Install NULL
allocate_location, re_set and check_status methods.
(catch_exec_command_1): Adjust.
(gnu_v3_exception_catchpoint_ops): Install NULL allocate_location,
re_set and check_status methods.
(create_ada_exception_breakpoint): Rename to ...
(init_ada_exception_breakpoint): ... this. Add a struct
breakpoint parameter, and delete the exp_string, cond_string and
cond parameters. Use init_raw_breakpoint, and don't install or
mention the breakpoint yet. Don't clear breakpoint fields that
init_raw_breakpoint already clears.
(re_set_breakpoint): Delete, split into ...
(breakpoint_re_set_default, prepare_re_set_context): ... these new
functions.
(breakpoint_re_set_one): Call the breakpoint's
breakpoint_ops->re_set implementation, if there's one. Adjust.
* breakpoint.h: Forward declare struct bpstats and struct bp_location.
(struct bp_location_ops): New type.
(struct bp_location): New field `ops'.
(struct breakpoint_ops): New `allocate_location', `re_set' and
`check_status' fields. Make `breakpoint_hit''s description match
reality.
(init_bp_location): Declare.
(breakpoint_re_set_default): Declare.
(create_ada_exception_breakpoint): Rename to ...
(init_ada_exception_breakpoint): ... this. Add a struct
breakpoint parameter, and delete the exp_string, cond_string and
cond parameters.
(install_breakpoint): Declare.
* ada-lang.c: Include exceptions.h.
<Ada exceptions description>: Update.
(struct ada_catchpoint_location): New type.
(ada_catchpoint_location_dtor): New function.
(ada_catchpoint_location_ops): New global.
(ada_catchpoint): New type.
(create_excep_cond_exprs): New function.
(dtor_exception, allocate_location_exception, re_set_exception)
(should_stop_exception, check_status_exception): New functions.
(print_one_exception, print_mention_exception)
(print_recreate_exception): Adjust.
(dtor_catch_exception, allocate_location_catch_exception)
(re_set_catch_exception, check_status_catch_exception): New
functions.
(catch_exception_breakpoint_ops): Install them.
(dtor_catch_exception_unhandled)
(allocate_location_catch_exception_unhandled)
(re_set_catch_exception_unhandled)
(check_status_catch_exception_unhandled): New functions.
(catch_exception_unhandled_breakpoint_ops): Install them.
(dtor_catch_assert, allocate_location_catch_assert)
(re_set_catch_assert, check_status_catch_assert): New functions.
(catch_assert_breakpoint_ops): Install them.
(ada_exception_catchpoint_p): Delete.
(catch_ada_exception_command_split)
(ada_exception_catchpoint_cond_string): Rename exp_string
parameter to excep_string. Adjust.
(ada_parse_catchpoint_condition): Delete.
(ada_exception_sal): Rename the exp_string parameter to
excep_string. Delete the cond_string and cond parameters.
Adjust.
(ada_decode_exception_location): Rename the exp_string parameter
to excep_string. Delete the cond_string and cond parameters.
Adjust.
(create_ada_exception_catchpoint): New function.
(catch_ada_exception_command, ada_decode_assert_location)
(catch_assert_command): Adjust.
* ada-lang.h (ada_exception_catchpoint_p): Delete declaration.
* ada-lang.c: Include arch-utils.h.
(ada_decode_exception_location): Make static.
(catch_ada_exception_command): Moved here from breakpoint.c.
(ada_decode_assert_location): Make static.
(catch_assert_command): Moved here from breakpoint.c.
(_initialize_ada_lang): Install the exception and assert
catchpoint commands here.
* ada-lang.h (ada_decode_exception_location)
(ada_decode_assert_location): Delete declarations.
* breakpoint.c (CATCH_PERMANENT, CATCH_TEMPORARY): Moved to
breakpoint.h.
(create_ada_exception_breakpoint): Make extern.
(catch_ada_exception_command, catch_assert_command): Moved to
ada-lang.c.
(add_catch_command): Make extern.
(_initilize_breakpoint): Don't install the exception and assert
catchpoint commands here.
* breakpoint.h (CATCH_PERMANENT, CATCH_TEMPORARY): Moved from
breakpoint.c
(add_catch_command, create_ada_exception_breakpoint): Declare.
* breakpoint.c (init_raw_breakpoint_without_location): Don't add
the breakpoint to the breakpoint chain here.
(set_raw_breakpoint_without_location): Add the breakpoint to the
breakpoint chain here.
(init_raw_breakpoint): Adjust comments.
(set_raw_breakpoint): Add the breakpoint to the breakpoint chain
here.
(init_catchpoint): Don't set the catchpoint's breakpoint number
here.
(install_catchpoint): New function.
(create_fork_vfork_event_catchpoint)
(create_syscall_event_catchpoint, catch_exec_command_1): Adjust to
use install_catchpoint.
* breakpoint.h (struct breakpoint_ops): New field `dtor'.
(struct breakpoint): Delete field `syscalls_to_be_caught'.
* breakpoint.c (init_raw_breakpoint_without_location): Remove
reference to syscalls_to_be_caught.
(catch_fork_breakpoint_ops, catch_vfork_breakpoint_ops): Install a
NULL `dtor'.
(struct syscall_catchpoint): New type.
(dtor_catch_syscall): New function.
(insert_catch_syscall, remove_catch_syscall)
(breakpoint_hit_catch_syscall, print_one_catch_syscall)
(print_recreate_catch_syscall): Adjust.
(catch_syscall_breakpoint_ops): Install dtor_catch_syscall.
(catch_exec_breakpoint_ops): Install a NULL `dtor'.
(create_syscall_event_catchpoint): Adjust to use init_catchpoint.
(ranged_breakpoint_ops, watchpoint_breakpoint_ops)
(masked_watchpoint_breakpoint_ops)
(gnu_v3_exception_catchpoint_ops): Install a NULL `dtor'.
(delete_breakpoint): Call the `dtor' breakpoint_ops method, if
there is one. Remove references to syscalls_to_be_caught.
(catching_syscall_number): Adjust.
* ada-lang.c (catch_exception_breakpoint_ops)
(catch_exception_unhandled_breakpoint_ops)
(catch_assert_breakpoint_ops): Install a NULL `dtor'.
* breakpoint.c (add_to_breakpoint_chain)
(init_raw_breakpoint_without_location): New functions, factored
out from ...
(set_raw_breakpoint_without_location): ... this one.
(init_raw_breakpoint): New function, factored out from
set_raw_breakpoint and adjusted to use
init_raw_breakpoint_without_location.
(set_raw_breakpoint): Adjust.
(init_catchpoint): New function, factored out from
create_catchpoint_without_mention and adjusted to use
init_raw_breakpoint.
(create_catchpoint_without_mention): Adjust.
gdb/ChangeLog:
From Stephen Kitt <steve@sk2.org>
* breakpoint.c, breakpoint.h, cli/cli-dump.c, dwarf2expr.c,
gdbarch.c, gdbarch.sh, remote.c: Various spelling fixes.
gdb/testsuite/ChangeLog:
From Stephen Kitt <steve@sk2.org>
* gdb.base/help.exp: Adjust following some spelling corrections
in GDB.
gdb/
* continuations.h (continuation_ftype): Add `err' parameter.
Document parameters.
(do_all_continuations, do_all_continuations_thread)
(do_all_intermediate_continuations)
(do_all_intermediate_continuations_thread)
(do_all_inferior_continuations): Add `err' parameter.
* continuations.c (do_my_continuations_1, do_my_continuations)
(do_all_inferior_continuations, do_all_continuations_ptid)
(do_all_continuations_thread_callback)
(do_all_continuations_thread, do_all_continuations)
(do_all_intermediate_continuations_thread_callback)
(do_all_intermediate_continuations_thread)
(do_all_intermediate_continuations): Add `err' parameter, and pass
it down all the way to the continuations proper.
* inf-loop.c (inferior_event_handler): If fetching an inferior
event throws an error, don't pop the target, and still call the
continuations, but with `err' set. Adjust all other continuation
calls.
* breakpoint.c (until_break_command_continuation): Add `err'
parameter.
* infcmd.c (step_1_continuation): Add `err' parameter. Don't
issue another step if `err' is set.
(struct until_next_continuation_args): New.
(until_next_continuation): Add `err' parameter. Adjust.
(until_next_command): Adjust.
(struct finish_command_continuation_args): Add `thread' field.
(finish_command_continuation): Add `err' parameter. Handle it.
(finish_forward): Adjust.
(attach_command_continuation): Add `err' parameter. Handle it.
* infrun.c (infrun_thread_stop_requested_callback): Adjust to
cancel the continuations.
* interps.c (interp_set): Adjust to cancel the continuations.
* thread.c (clear_thread_inferior_resources): Adjust to cancel the
continuations rather than discarding.
(free_thread): Don't clear thread inferior resources here.
(delete_thread_1): Do it here instead. And do it before removing
the thread from the threads list. Tag the thread as exited before
clearing thread inferior resources.
gdb/
* breakpoint.c (watchpoint_check): If the watchpoint went out of
scope, clear its command list.
(map_breakpoint_numbers): Don't walk the related breakpoints list
of each breakpoint.
gdb/testsuite/
* gdb.base/commands.exp (watchpoint_command_test): Check that the
watchpoint's command list didn't execute when the watchpoint went
out of scope.
experiment is still running.
gdb/
* breakpoint.c (disable_breakpoint): Disable all locations
associated with a tracepoint on target if a trace experiment is
running.
(disable_command): Disable a specific tracepoint location on target if
a trace experiment is running.
(do_enable_breakpoint): Enable all locations associated with a
tracepoint on target if a trace experiment is running.
(enable_command) Enable a specific tracepoint location on target if a
trace experiment is running.
* target.c (update_current_target): Add INHERIT and de_fault clauses for
to_supports_enable_disable_tracepoint, to_enable_tracepoint and
to_disable_tracepoint.
* target.h: Add declaration of struct bp_location.
(struct target_ops): Add new functions
to_supports_enable_disable_tracepoint, to_enable_tracepoint and
to_disable_tracepoint to target operations.
(target_supports_enable_disable_tracepoint): New macro.
(target_enable_tracepoint): New macro.
(target_disable_tracepoint): New macro.
* remote.c (struct remote_state): Add new field.
(remote_enable_disable_tracepoint_feature): New.
(remote_protocol_features): Add new entry.
(remote_supports_enable_disable_tracepoint): New.
(remote_enable_tracepoint): New.
(remote_disable_tracepoint): New.
(init_remote_ops): Add remote_enable_tracepoint,
remote_disable_tracepoint and remote_supports_enable_disable_tracepoint
to remote operations.
* tracepoint.c (start_tracing): Allow tracing to start without any
tracepoints enabled with just a warning if they can be re-enabled
later.
* NEWS: Add news item for the new behaviour of the enable and disable
GDB commands when applied to tracepoints.
Add news items for the new remote packets QTEnable and QTDisable.
gdb/doc/
* gdb.texinfo: Document change in the behaviour of the enable and
disable GDB commands when applied to tracepoints.
Document the EnableDisableTracepoints remote stub feature.
Document QTEnable and QTDisable in the list of tracepoint packets.
gdb/gdbserver/
* server.c (handle_query): Add EnableDisableTracepoints to the list
of supported features.
* tracepoint.c (clear_installed_tracepoints): Uninstall disabled
tracepoints.
(cmd_qtenable_disable): New.
(cmd_qtstart): Install tracepoints even if disabled.
(handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
receiving a QTEnable or QTDisable packet.
(gdb_collect): Skip data collection if fast tracepoint is disabled.
(ust_marker_to_static_tracepoint): Do not ignore disabled static
tracepoints.
(gdb_probe): Skip data collection if static tracepoint is disabled.
Thiago Jung Bauermann <bauerman@br.ibm.com>
Implement support for PowerPC BookE masked watchpoints.
gdb/
* NEWS: Mention masked watchpoint support. Create "Changed commands"
section.
* breakpoint.h (struct breakpoint_ops) <works_in_software_mode>: New
method. Initialize to NULL in all existing breakpoint_ops instances.
(struct breakpoint) <hw_wp_mask>: New field.
* breakpoint.c (is_masked_watchpoint): Add prototype.
(update_watchpoint): Don't set b->val for masked watchpoints. Call
breakpoint's breakpoint_ops.works_in_software_mode if available.
(watchpoints_triggered): Handle the case of a hardware masked
watchpoint trigger.
(watchpoint_check): Likewise.
(works_in_software_mode_watchpoint): New function.
(insert_masked_watchpoint, remove_masked_watchpoint)
(resources_needed_masked_watchpoint)
(works_in_software_mode_masked_watchpoint, print_it_masked_watchpoint)
(print_one_detail_masked_watchpoint, print_mention_masked_watchpoint)
(print_recreate_masked_watchpoint, is_masked_watchpoint): New
functions.
(masked_watchpoint_breakpoint_ops): New structure.
(watch_command_1): Check for the existence of the `mask' parameter.
Set b->ops according to the type of hardware watchpoint being created.
* ppc-linux-nat.c (ppc_linux_insert_mask_watchpoint)
(ppc_linux_remove_mask_watchpoint)
(ppc_linux_masked_watch_num_registers): New functions.
(_initialize_ppc_linux_nat): Initialize to_insert_mask_watchpoint,
to_remove_mask_watchpoint and to_masked_watch_num_registers.
* target.c (update_current_target): Mention to_insert_mask_watchpoint,
to_remove_mask_watchpoint, and to_masked_watch_num_registers.
(target_insert_mask_watchpoint, target_remove_mask_watchpoint)
(target_masked_watch_num_registers): New functions.
* target.h (struct target_ops) <to_insert_mask_watchpoint>,
<to_remove_mask_watchpoint>, <to_masked_watch_num_registers>: New
methods.
(target_insert_mask_watchpoint, target_remove_mask_watchpoint)
(target_masked_watch_num_registers): Add prototypes.
gdb/doc/
* gdb.texinfo (Set Watchpoints): Document mask parameter.
(PowerPC Embedded): Mention support of masked watchpoints.
* breakpoint.c (update_watchpoint): Change between software and
hardware watchpoint for all kinds of watchpoints, not just
read/write ones. Determine b->exact value here instead of
in watch_command_1. Error out if there are not enough resources
for a read or access hardware watchpoint.
(watch_command_1): Remove logic of checking whether there are
enough resources available, since update_watchpoint will do that
work now. Don't set b->exact here. Catch exceptions thrown by
update_watchpoint and delete the watchpoint.
(can_use_hardware_watchpoint): Remove exact_watchpoints argument.
Use target_exact_watchpoints instead.
(delete_breakpoint): Notify observers only if deleted watchpoint
has a breakpoint number assigned to it.
gdb/
* breakpoint.c (user_settable_breakpoint): Delete.
(user_breakpoint_p): Remove check on user_settable_breakpoint.
(delete_command): Check user_breakpoint_p instead of looking at
the breakpoint's type.
(disable_command): Ditto.
(enable_command): Ditto.
(delete_trace_command): Use user_breakpoint_p instead of looking
at the breakpoint number directly. When checking if there are
user visible tracepoints, in order to know whether to ask the user
for confirmation, check whether the breakpoint is actually a
tracepoint.
This rewrites the code generating the Ada exception catchpoint hit
notification for both the GDB/MI case as well as the non-MI case,
by using the relevant ui_out_* functions to generate the output.
the MI notifications for Ada exception catchpoints now include
the stop reason, and the breakpoint "disp", much like other breakpoint
events do. It also introduces a new field "exception-name" for
exception catchpoints (excluding "failed assertion catchpoints,
where we just want to know that it was a failed assertion).
gdb/ChangeLog:
* breakpoint.h (bpdisp_text): Add declaration.
* breakpoint.c (bpdisp_text): Make non-static.
* ada-lang.c: #include "mi/mi-common.h".
(print_it_exception): Rewrite to improve GDB/MI output.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Ada Exception Information): Document
the "exception-name" field in the *stopped async record.
gdb/testsuite/ChangeLog:
* gdb.ada/mi_catch_ex: New testcase.
Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com>
Implement support for PowerPC BookE ranged breakpoints.
gdb/
* NEWS: Mention support for ranged breakpoints on embedded PowerPC.
* breakpoint.h (struct bp_target_info) <length>: New member
variable.
(struct breakpoint_ops) <breakpoint_hit>: Take struct bp_location
instead of struct breakpoint as argument, and also add ASPACE
and BP_ADDR arguments. Update all callers.
(struct breakpoint_ops) <print_one_detail>: New method.
(struct breakpoint) <addr_string_range_end>: New member variable.
* breakpoint.c (breakpoint_location_address_match): Add function
prototype.
(insert_bp_location): Set bl->target_info.length.
(breakpoint_here_p): Call breakpoint_location_address_match.
(moribund_breakpoint_here_p): Likewise.
(regular_breakpoint_inserted_here_p): Likewise.
(breakpoint_thread_match): Likewise.
(bpstat_stop_status): Likewise.
(bpstat_check_location): Move call to
breakpoint_ops.breakpoint_hit to the top.
(print_one_breakpoint_location): Call
breakpoint_ops.print_one_detail if available.
(breakpoint_address_match_range): New function.
(breakpoint_location_address_match): Likewise.
(breakpoint_locations_match): Compare the length field of the
locations too.
(hw_breakpoint_used_count): Count resources used by all locations
in a breakpoint, and use breakpoint_ops.resources_needed if
available.
(breakpoint_hit_ranged_breakpoint): New function.
(resources_needed_ranged_breakpoint): Likewise.
(print_it_ranged_breakpoint): Likewise.
(print_one_ranged_breakpoint): Likewise.
(print_one_detail_ranged_breakpoint): Likewise.
(print_mention_ranged_breakpoint): Likewise.
(print_recreate_ranged_breakpoint): Likewise.
(ranged_breakpoint_ops): New structure.
(find_breakpoint_range_end): New function.
(break_range_command): Likewise.
(delete_breakpoint): Free addr_string_range_end.
(update_breakpoint_locations): Add SALS_END argument. Update
all callers. Calculate breakpoint length if a non-zero SALS_END
is given. Call breakpoint_locations_match instead of
breakpoint_address_match.
(reset_breakpoint): Find SaL of the end of the range if B is a
ranged breakpoint.
(_initialize_breakpoint): Register break-range command.
* defs.h (print_core_address): Add function prototype.
* ppc-linux-nat.c (ppc_linux_ranged_break_num_registers): New
function.
(ppc_linux_insert_hw_breakpoint): Support ranged breakpoints.
(ppc_linux_remove_hw_breakpoint): Likewise.
(_initialize_ppc_linux_nat): Initialize
to_ranged_break_num_registers.
* target.c (update_current_target): Add comment about
to_ranged_break_num_registers.
(target_ranged_break_num_registers): New function.
* target.h (struct target_ops) <to_ranged_break_num_registers>:
New method.
(target_ranged_break_num_registers): Add function prototype.
* ui-out.c (ui_out_field_core_addr): Move address-printing logic to ...
* utils.c (print_core_address): ... here.
gdb/doc/
* gdb.texinfo (PowerPC Embedded): Document ranged breakpoints.
Support resolution of STT_GNU_IFUNC via breakpoints.
* breakpoint.c (print_it_typical): Support bp_gnu_ifunc_resolver and
bp_gnu_ifunc_resolver_return.
(bpstat_what): Rename parameter to bs_head, new variable bs, adjust
the loop. Support bp_gnu_ifunc_resolver and
bp_gnu_ifunc_resolver_return. New comment after the loop. New loop
for bp_gnu_ifunc_resolver and bp_gnu_ifunc_resolver_return
breakpoints.
(bptype_string, print_one_breakpoint_location): Support
bp_gnu_ifunc_resolver and bp_gnu_ifunc_resolver_return.
(user_settable_breakpoint): Return true also for
bp_gnu_ifunc_resolver.
(allocate_bp_location): Support bp_gnu_ifunc_resolver and
bp_gnu_ifunc_resolver_return.
(set_breakpoint_location_function): New parameter explicit_loc,
describe it. Call find_pc_partial_function_gnu_ifunc with new
variable IS_GNU_IFUNC and adjust the address for STT_GNU_IFUNC if
EXPLICIT_LOC is not set.
(set_raw_breakpoint): Set EXPLICIT_LOC for
set_breakpoint_location_function.
(clone_momentary_breakpoint): Use true for EXPLICIT_LOC of
set_breakpoint_location_function.
(mention): Support bp_gnu_ifunc_resolver and
bp_gnu_ifunc_resolver_return.
(add_location_to_breakpoint): Set EXPLICIT_LOC for
set_breakpoint_location_function.
(update_breakpoint_locations): Remove static.
(breakpoint_re_set_one): Support bp_gnu_ifunc_resolver and
bp_gnu_ifunc_resolver_return.
* breakpoint.h (enum bptype): New fields bp_gnu_ifunc_resolver and
bp_gnu_ifunc_resolver_return.
(update_breakpoint_locations): New declaration.
* elfread.c: Include gdbthread.h and regcache.h.
(elf_gnu_ifunc_resolver_stop, elf_gnu_ifunc_resolver_return_stop): New
functions.
(elf_gnu_ifunc_fns): Install them.
* minsyms.c (stub_gnu_ifunc_resolver_stop)
(stub_gnu_ifunc_resolver_return_stop): New functions.
(stub_gnu_ifunc_fns): Install them.
* symtab.h (struct gnu_ifunc_fns): New fields gnu_ifunc_resolver_stop
and gnu_ifunc_resolver_return_stop.
(gnu_ifunc_resolver_stop, gnu_ifunc_resolver_return_stop): New.
Support a ring of related breakpoints.
* breakpoint.c (watchpoint_del_at_next_stop): New, move here code from
other functions, add gdb_assert.
(update_watchpoint, watchpoint_check): Add gdb_assert. Use
watchpoint_del_at_next_stop.
(bpstat_check_watchpoint): Use watchpoint_del_at_next_stop.
(bpstat_stop_status): Handle ring in related_breakpoint.
(set_raw_breakpoint_without_location): Initialize ring in
related_breakpoint.
(delete_breakpoint): Handle ring in related_breakpoint, use
watchpoint_del_at_next_stop.
(map_breakpoint_numbers): Handle ring in related_breakpoint.
gdb/testsuite/
Support a ring of related breakpoints.
* gdb.base/watchpoint-delete.c: New file.
* gdb.base/watchpoint-delete.exp: New file.
* gdb.texinfo (Breakpoints In Python): Add description and
example
of Python stop function operation.
2010-03-14 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-breakpoint.exp: Add Python stop operations
tests.
2011-03-14 Phil Muldoon <pmuldoon@redhat.com>
* python/python.h: Declare gdbpy_should_stop and
gdbpy_breakpoint_has_py_cond.
* python/python.c: Add python.h to includes. Remove
python.h from
HAVE_PYTHON definition
(gdbpy_should_stop): New dummy function.
(gdbpy_breakpoint_has_py_cond): New dummy function.
* python/py-breakpoint.c (bppy_init): Rewrite to allow
sub-classing capabilities.
(gdbpy_should_stop): New function.
(gdbpy_breakpoint_has_py_cond): New function.
(local_setattro): New function.
* breakpoint.c (condition_command): Add check for Python
'stop'
operation.
(bpstat_check_breakpoint_conditions): Execute Python
'stop'
operation function as part of stop/continue tests.
(print_breakpoint_location): Use it instead of WRAP_INDENT argument.
Allocate ui_stream locally instead of using STB argument.
(print_one_breakpoint_location): Update call.
* ui-out.c (ui_out_query_field): New function.
* ui-out.h (ui_out_query_field): Add prototype.
* breakpoint.c (breakpoint_1): Change first argument from an int
to a char pointer, so that the function now accepts a list of
breakpoints rather than just one. Use new function
'number_is_in_list' to implement.
(breakpoints_info): Pass char * instead of int to breakpoint_1.
(watchpoints_info): Ditto.
(tracepoints_info): Ditto.
(maintenance_info_breakpoints): Ditto.
(_initialize_breakpoint): Update help strings to reflect the fact
that these functions can now take more than one argument.
* cli/cli-utils.c (number_is_in_list): New function.
* cli/cli-utils.h (number_is_in_list): Export.
2011-02-21 Michael Snyder <msnyder@vmware.com>
* gdb.texinfo (Set Breaks): Add @dots{} to arguments of info break.
(Set Watchpoints): Add @dots{} to argument of info watchpoints.
(Listing Tracepoints): Add @dots{} to argument of info tracepoints.
2011-02-21 Michael Snyder <msnyder@vmware.com>
* gdb.base/break.exp: Add tests for "info break" with arguments.
* gdb.trace/infotrace.exp: Update patterns for error and help.
* gdb.base/completion.exp: Update pattern.
* gdb.base/ena-dis-br.exp: Update pattern.
* gdb.base/help.exp: Update patterns.
* breakpoint.h (get_number_or_range): Declare.
* printcmd.c (ALL_DISPLAYS): Declare.
(delete_display): Reimplement taking a display pointer.
(undisplay_command): Accept a range of displays to delete, using
get_number_or_range.
* breakpoint.c (longjmp_names): New variable.
(struct breakpoint_objfile_data): New type.
(breakpoint_objfile_key): New variable.
(msym_not_found): New variable.
(msym_not_found_p): New predicate.
(get_breakpoint_objfile_data): New function.
(create_overlay_event_breakpoint): Check per-objfile cache for
symbols first.
(create_longjmp_master_breakpoint): Likewise.
(create_std_terminate_master_breakpoint): Likewise.
(create_exception_master_breakpoint): Likewise.
(_initialize_breakpoint): Register per-objfile data key.
* breakpoint.c (update_watchpoint): Fix name of the
update_global_location_list function.
(print_one_breakpoint): Fix typo.
(_initialize_breakpoint): Remove extra space in hbreak help
string.
* breakpoint.h (struct bp_location) <length>: Fix field
description.
Thiago Jung Bauermann <bauerman@br.ibm.com>
Implement support for PowerPC BookE ranged watchpoints.
gdb/
* breakpoint.h
(struct breakpoint_ops) <resources_needed>: New method.
Initialize to NULL in all existing breakpoint_ops instances.
(struct breakpoint) <exact>: New field.
(target_exact_watchpoints): Declare external global.
* breakpoint.c (target_exact_watchpoints): New global flag.
(update_watchpoint): Set b->type to bp_hardware_watchpoint and
b->enable_state to bp_enabled before calling
hw_watchpoint_used_count.
(hw_watchpoint_used_count): Iterate over all bp_locations in a
watchpoint. Call breakpoint's breakpoint_ops.resources_needed
if available.
(insert_watchpoint, remove_watchpoint): Use fixed length of 1 byte
if the watchpoint is exact.
(resources_needed_watchpoint): New function.
(watchpoint_breakpoint_ops): Add resources_needed_watchpoint.
(watch_command_1): Set b->exact if the user asked for an exact
watchpoint and one can be set.
(can_use_hardware_watchpoint): Add exact_watchpoints argument.
Pass fixed length of 1 to target_region_ok_for_hw_watchpoint if
the user asks for an exact watchpoint and one can be set. Return
number of needed debug registers to watch the expression.
* gdbtypes.c (is_scalar_type): New function, based on
valprint.c:scalar_type_p.
(is_scalar_type_recursive): New function.
* gdbtypes.h (is_scalar_type_recursive): Declare.
* ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint): Always
handle regions when ranged watchpoints are available.
(create_watchpoint_request): New function.
(ppc_linux_insert_watchpoint, ppc_linux_remove_watchpoint): Use
create_watchpoint_request.
* rs6000-tdep.c (show_powerpc_exact_watchpoints): New function.
(_initialize_rs6000_tdep): Add `exact-watchpoints' boolean to the
`set powerpc' and `show powerpc' commands.
* target.h (struct target_ops) <to_region_ok_for_hw_watchpoint>:
Mention documentation comment in the target macro.
(target_region_ok_for_hw_watchpoint): Document return value.
gdb/doc/
* gdb.texinfo (PowerPC Embedded): Document ranged watchpoints and
the "set powerpc exact-watchpoints" flag.
Convert hardware watchpoints to use breakpoint_ops.
gdb/
* breakpoint.h (breakpoint_ops) <insert>: Rename to...
<insert_location>: ... this. Return int instead of void.
Accept pointer to struct bp_location instead of pointer to
struct breakpoint. Adapt all implementations.
(breakpoint_ops) <remove>: Rename to...
<remove_location>: ... this. Accept pointer to struct bp_location
instead of pointer to struct breakpoint. Adapt all implementations.
* breakpoint.c (insert_catchpoint): Delete function.
(insert_bp_location): Call the watchpoint or catchpoint's
breakpoint_ops.insert method.
(remove_breakpoint_1): Call the watchpoint or catchpoint's
breakpoint_ops.remove method.
(insert_watchpoint, remove_watchpoint): New functions.
(watchpoint_breakpoint_ops): New structure.
(watch_command_1): Initialize the OPS field.
* inf-child.c (inf_child_insert_fork_catchpoint)
(inf_child_remove_fork_catchpoint, inf_child_insert_vfork_catchpoint)
(inf_child_remove_vfork_catchpoint, inf_child_insert_exec_catchpoint)
(inf_child_remove_exec_catchpoint, inf_child_set_syscall_catchpoint):
Delete functions.
(inf_child_target): Remove initialization of to_insert_fork_catchpoint,
to_remove_fork_catchpoint, to_insert_vfork_catchpoint,
to_remove_vfork_catchpoint, to_insert_exec_catchpoint,
to_remove_exec_catchpoint and to_set_syscall_catchpoint.
* target.c (update_current_target): Change default implementation of
to_insert_fork_catchpoint, to_remove_fork_catchpoint,
to_insert_vfork_catchpoint, to_remove_vfork_catchpoint,
to_insert_exec_catchpoint, to_remove_exec_catchpoint and
to_set_syscall_catchpoint to return_one.
(debug_to_insert_fork_catchpoint, debug_to_insert_vfork_catchpoint)
(debug_to_insert_exec_catchpoint): Report return value.
* target.h (to_insert_fork_catchpoint, to_insert_vfork_catchpoint)
(to_insert_exec_catchpoint): Change declaration to return int instead
of void.
gdb/testsuite/
* gdb.base/foll-exec.exp: Adapt to new error string when the catchpoint
type is not supported.
* gdb.base/foll-fork.exp: Likewise.
* gdb.base/foll-vfork.exp: Likewise.
* breakpoint.c (breakpoint_restore_shadows): When looking for the
location with the lowest address that overlaps the memory range we
want to restore shadows for, account for multiple locations at the
same address.
Rename and move inferior_thread_state and inferior_status.
* gdbthread.h (struct thread_control_state): New struct, move fields
step_range_start, step_range_end, step_frame_id, step_stack_frame_id,
trap_expected, proceed_to_finish, in_infcall, step_over_calls,
stop_step and stop_bpstat here from struct thread_info.
(struct thread_suspend_state): New struct, move field stop_signal here
from struct thread_info.
(struct thread_info): Move the fields above from this struct.
* inferior.h: Move the inferior_thread_state and inferior_status
declarations comment to their definitions at infrun.c.
(struct inferior_control_state): New struct, move field stop_soon from
struct inferior here.
(struct inferior_suspend_state): New empty struct.
(struct inferior): New fields control and suspend. Move out field
stop_soon.
* infrun.c (struct inferior_thread_state): Rename to ...
(infcall_suspend_state): ... here. Replace field stop_signal by
fields thread_suspend and inferior_suspend.
(save_inferior_thread_state): Rename to ...
(save_infcall_suspend_state): ... here. New variable inf. Update the
code for new fields.
(restore_inferior_thread_state): Rename to ...
(restore_infcall_suspend_state): ... here. New variable inf. Update
the code for new fields.
(do_restore_inferior_thread_state_cleanup): Rename to ...
(do_restore_infcall_suspend_state_cleanup): ... here.
(make_cleanup_restore_inferior_thread_state): Rename to ...
(make_cleanup_restore_infcall_suspend_state): ... here.
(discard_inferior_thread_state): Rename to ...
(discard_infcall_suspend_state): ... here.
(get_inferior_thread_state_regcache): Rename to ...
(get_infcall_suspend_state_regcache): ... here.
(struct inferior_status): Rename to ...
(struct infcall_control_state): ... here. Replace fields
step_range_start, step_range_end, step_frame_id, step_stack_frame_id,
trap_expected, proceed_to_finish, in_infcall, step_over_calls,
stop_step, stop_bpstat and stop_soon by fields thread_control and
inferior_control.
(save_inferior_status): Rename to ...
(save_infcall_control_state): ... here. Update the code for new
fields.
(restore_inferior_status): Rename to ...
(restore_infcall_control_state): ... here. Update the code for new
fields.
(do_restore_inferior_status_cleanup): Rename to ...
(do_restore_infcall_control_state_cleanup): ... here.
(make_cleanup_restore_inferior_status): Rename to ...
(make_cleanup_restore_infcall_control_state): ... here.
(discard_inferior_status): Rename to ...
(discard_infcall_control_state): ... here.
* alpha-tdep.c, breakpoint.c, dummy-frame.c, dummy-frame.h,
exceptions.c, fbsd-nat.c, gdbthread.h, infcall.c, infcmd.c,
inferior.c, inferior.h, infrun.c, linux-nat.c, mi/mi-interp.c,
mips-tdep.c, procfs.c, solib-irix.c, solib-osf.c, solib-spu.c,
solib-sunos.c, solib-svr4.c, thread.c, windows-nat.c: Update all the
references to the moved fields and renamed functions.
* python/py-breakpoint.c (BPPY_REQUIRE_VALID): Check if bp is
NULL.
(BPPY_SET_REQUIRE_VALID): Ditto.
(bpnum_is_valid): Delete function.
(bppy_get_visibility): New function.
(bppy_new): Parse for, and validate internal keyword. Pass
internal keyword to breakpoint or watchpoint functions.
(build_bp_list): New function.
(gdbpy_breakpoints): Rewrite. Use build_bp_list and
iterate_over_breakpoints.
(gdbpy_breakpoint_created): Rewrite. Do not store breakpoints in a
look-aside vector.
(gdbpy_breakpoint_deleted): Rewrite, defer breakpoint management
to internal breakpoint chain.
* breakpoint.c (set_breakpoint_number): New function.
(breakpoint_1): Check if breakpoint number is more than zero.
(set_raw_breakpoint_without_location): Set py_bp_object to NULL.
(create_breakpoint_sal): Take a new parameter called internal.
Call set_breakpoint_number with internal parameter. Do not
mention internal breakpoints. All callers updated.
(create_breakpoint): Ditto.
(create_breakpoints_sal): Ditto.
(watch_command_1): Ditto.
(watch_command_wrapper): Take a new parameter called internal.
All callers updated.
(rwatch_command_wrapper): Ditto.
(awatch_command_wrapper): Ditto.
(save_breakpoints): Update breakpoint save condition check.
(iterate_over_breakpoints): New function.
* breakpoint.h: Add conditional python includes. Add py_bp_object
and comment to struct breakpoint. Update all callers.
* defs.h: Add PyObject definition for GDB builds without Python.
2010-11-11 Phil Muldoon <pmuldoon@redhat.com>
* gdb.texinfo (Breakpoints In Python): Document "internal"
parameter, and visible attribute.
2010-11-11 Phil Muldoon <pmuldoon@redhat.com>
* gdb.python/py-breakpoint.exp: Add internal watchpoint and
breakpoint tests.
* breakpoint.c (watch_command_1): Get a pointer of the lazy
version of the expression's value, even if reading the value from
memory fails. When creating a -location watchpoint, get the
value's address from the lazy value pointer.
gdb/testsuite/
* gdb.base/watchpoint.exp: Test "watch -location" with an
innacessible location.
value specially.
testsuite/
* gdb.base/watchpoint.exp: Call test_inaccessible_watchpoint
before disabling hardware watchpoints.
(test_inaccessible_watchpoint): Check that hardware watchpoints
are used. Test for watchpoints on a constant address.
* breakpoint.c (save_breakpoints): Use RETURN_MASK_ALL.
* cli-out.c: Include vec.h.
(cli_field_fmt, cli_spaces, cli_text, cli_message, cli_flush): New
variable stream, initialize it, use it.
(cli_redirect): New function comment. Replace the stream and
original_stream fields by the new streams field. Remove the
original_stream != NULL conditional, assert error on NULL instead.
(out_field_fmt, field_separator): New variable stream, initialize it, use it.
(cli_out_data_ctor): Assert non-NULL stream. Replace the stream and
original_stream fields by the new streams field.
(cli_out_set_stream): Replace the stream field by the new streams
field.
* cli-out.h: Include vec.h.
(ui_filep): New typedef, call DEF_VEC_P for it.
(struct cli_ui_out_data): Replace the stream and original_stream
fields by the new streams field.
* cli/cli-logging.c (set_logging_redirect): Call ui_out_redirect with
NULL first. Extend the comment.
(handle_redirections): Call ui_out_redirect with output.
* python/py-breakpoint.c (bppy_get_commands): Move ui_out_redirect
calls outside of the TRY_CATCH block.
gdb/testsuite/
* gdb.base/ui-redirect.exp: New file.
2010-08-17 Pedro Alves <pedro@codesourcery.com>
PR breakpoints/11371
* breakpoint.c (breakpoint_init_inferior): Decrement the
location's reference count instead of deleting right away.
(bpstat_free): Decrement the location's reference count. Make
static.
(bpstat_copy): Increment the location's reference count.
(bpstat_find_breakpoint): Adjust.
(bpstat_num): Adjust.
(print_it_typical): Adjust. Use the breakpoint pointer in the
bpstat instead of the location's owner.
(bpstat_alloc): Remove const qualifier from the 'bl' parameter.
Adjust to record the location's owner in the bpstat.
(watchpoint_check): Use the breakpoint pointer in the bpstat
instead of the location's owner.
(bpstat_check_breakpoint_conditions): Don't handle
bp_watchpoint_scope here. Use the breakpoint pointer in the
bpstat instead of the location's owner.
(bpstat_stop_status): Defer inferior function calls to after
building the bpstat list. Handle bp_watchpoint_scope here. Use
the breakpoint pointer in the bpstat instead of the location's
owner.
(bpstat_what): Use the breakpoint pointer in the bpstat instead of
the location's owner.
(free_bp_location): Don't walk bpstats clearing locations.
(incref_bp_location): New.
(decref_bp_location): New.
(breakpoint_auto_delete): Use the breakpoint pointer in the bpstat
instead of the location's owner.
(update_global_location_list): Clear the location's owner, and
decrement the location's reference count instead of deleting it
right away.
(breakpoint_retire_moribund): Decrement the location's reference
count instead of deleting it right away.
(bpstat_remove_bp_location): Delete.
(bpstat_remove_breakpoint): New.
(bpstat_remove_bp_location_callback): Delete.
(bpstat_remove_breakpoint_callback): New.
(delete_breakpoint): Iterate over all threads' stop_bpstat's
clearing references to the breakpoint that is being deleted.
* breakpoint.h (struct bp_location) <refc>: New field.
<owner>: Update comments.
(bpstat_free): Delete declaration.
(struct bpstats): Change the type of the breakpoint_at field to
struct breakpoint point, from struct bp_location pointer. Add new
field bp_location_at.
gdb/testsuite/
2010-08-17 Jan Kratochvil <jan.kratochvil@redhat.com>
Pedro Alves <pedro@codesourcery.com>
PR breakpoints/11371
* gdb.base/watch-cond-infcall.exp: New file.
* gdb.base/watch-cond-infcall.c: New file.
* breakpoint.c (update_watchpoint): Add source empty line. Prefer
EXP_STRING_REPARSE to EXP_STRING.
(watch_command_1): Set also EXP_STRING_REPARSE.
(delete_breakpoint): Free also EXP_STRING_REPARSE.
* breakpoint.h (struct breakpoint): New field exp_string_reparse.
Update comment for exp_string.
This is a problem that I noticed on GNU/Linux, when using both GDB
and GDBserver to debug an Ada program. To reproduce, use any Ada
program, built with debug info ("gnatmake -g ...").
Then start the program with gdbserver:
% gdbserver :4444 simple_main
And then insert a breakpoint using the name of an Ada function,
followed by connecting to the target server:
(gdb) b simple.test_simple
Breakpoint 1 at 0x401f28: file simple.adb, line 16.
(gdb) tar rem :4444
Remote debugging using :4444
Reading symbols from /lib64/ld-linux-x86-64.so.2...
Reading symbols from /usr/lib/debug/lib/ld-2.11.1.so...done.
done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
!! -> Error in re-setting breakpoint 1: Can't find member of namespace, class,
!! -> struct, or union named "simple.test_simple"
!! -> Hint: try 'simple.test_simple<TAB> or 'simple.test_simple<ESC-?>
!! -> (Note leading single quote.)
0x00007f4db3cf2af0 in _start () from /lib64/ld-linux-x86-64.so.2
Created trace state variable $trace_timestamp for target's variable 1.
The problem is related to the fact that GDB found debug symbols for
ld.so in /usr/lib/debug. For debugger configured with a prefix that
is different from /usr, one way to force the problem to reproduce is
to use:
(gdb) set debug-file-directory /usr/lib/debug
(assuming that debug info has been installed at that location).
The problem is that the wrong language is used to parse the breakpoint
location because it gets changed from under us as a side effect of
some of the code that we do in prepration for re-parsing. In particular,
breakpoint_re_set_one reads:
set_language (b->language);
input_radix = b->input_radix;
s = b->addr_string;
save_current_space_and_thread ();
switch_to_program_space_and_thread (b->pspace);
marker_spec = b->type == bp_static_tracepoint && is_marker_spec (s);
[if (marker_spec) decode_tracepoint_spec (...) else decode_line_1]
What happens in our case is that debugging information gets found
for ld.so. As a result, the current_frame language is C whereas it
would have been unknown if we did not have debugging info. And
save_current_space_and_thread() implicitly causes the current frame
to be selected, which changes the language automatically if the new
language is not uknown and the the language mode is auto.
The fix, until all parsing routines (including decode_line_1) get upgraded
to take a language, is to select the breakpoint language as late as possible.
In this case, we don't need to do that until we actually try to parse
the breakpoint addr_string.
gdb/ChangeLog:
* breakpoint.c (breakpoint_re_set_one): Move call to set_language
down, just before the block that parse the breakpoint addr_string.
Thiago Jung Bauermann <bauerman@br.ibm.com>
Support for hw accelerated condition watchpoints in booke powerpc.
* breakpoint.c (fetch_watchpoint_value): Rename to fetch_subexp_value
and move to eval.c. Change callers.
(insert_bp_location): Pass watchpoint condition in
target_insert_watchpoint.
(remove_breakpoint_1) Pass watchpoint condition in
target_remove_watchpoint.
(watchpoint_locations_match): Call
target_can_accel_watchpoint_condition.
* eval.c: Include wrapper.h.
(fetch_subexp_value): Moved from breakpoint.c.
* ppc-linux-nat.c (ppc_linux_region_ok_for_hw_watchpoint):
Formatting fix.
(can_use_watchpoint_cond_accel): New function.
(calculate_dvc): Likewise.
(num_memory_accesses): Likewise.
(check_condition): Likewise.
(ppc_linux_can_accel_watchpoint_condition): Likewise
(ppc_linux_insert_watchpoint): Call can_use_watchpoint_cond_accel,
check_condition and calculate_dvc.
(ppc_linux_remove_watchpoint): Likewise.
(_initialize_ppc_linux_nat): Set to_can_accel_watchpoint_condition to
ppc_linux_can_accel_watchpoint_condition
* target.c (debug_to_insert_watchpoint): Add argument for watchpoint
condition.
(debug_to_remove_watchpoint): Likewise.
(debug_to_can_accel_watchpoint_condition): New function.
(update_current_target): Set to_can_accel_watchpoint_condition.
(setup_target_debug): Set to_can_accel_watchpoint_condition.
* target.h: Add opaque declaration for struct expression.
(struct target_ops) <to_insert_watchpoint>,
<to_remove_watchpoint>: Add new arguments to pass the watchpoint
<to_can_accel_watchpoint_condition>: New member.
condition. Update all callers and implementations.
(target_can_accel_watchpoint_condition): New macro.
* value.c (free_value_chain): New function.
* value.h (fetch_subexp_value): New prototype.
(free_value_chain): Likewise.
Thiago Jung Bauermann <bauerman@br.ibm.com>
* breakpoint.c (can_use_hardware_watchpoint): Answer "what does this
represent?" question in comment. Change comment to a proper sentence.
* infrun.c (handle_inferior_event): Handle presence of single-step
breakpoints for TARGET_WAITKIND_FORKED and TARGET_WAITKIND_VFORKED.
Cancel single-step breakpoints for TARGET_WAITKIND_EXITED,
TARGET_WAITKIND_SIGNALED, and TARGET_WAITKIND_EXECD.
* breakpoint.c (detach_single_step_breakpoints): New function.
(detach_breakpoints): Call it.
(cancel_single_step_breakpoints): New function.
* breakpoint.h (cancel_single_step_breakpoints): Add prototype.
* spu-tdep.c (spu_memory_remove_breakpoint): New function.
(spu_gdbarch_init): Install it.
testsuite/ChangeLog:
* gdb.cell/fork.exp: New file.
* gdb.cell/fork.c: Likewise.
* gdb.cell/fork-spu.c: Likewise.
2010-06-16 Sergio Durigan Junior <sergiodj@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* breakpoint.c: Include parser-defs.h.
(watchpoint_exp_is_const): New function.
(watch_command_1): Call watchpoint_exp_is_const to check
if the expression is constant.
gdb/doc/ChangeLog:
2010-06-16 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.texinfo: Include information about the correct use
of addresses in the `watch' command.
gdb/testsuite/ChangeLog:
2010-06-16 Jan Kratochvil <jan.kratochvil@redhat.com>
Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.base/watch-notconst.c: New file.
* gdb.base/watch-notconst.S: New file.
* gdb.base/watch-notconst2.c: New file.
* gdb.base/watch-notconst2.S: New file.
* gdb.base/watch-notconst.exp: New file.
* gdb.base/watchpoint.c (global_ptr_ptr): New variable.
(func4): Add operations on `global_ptr_ptr'.
* gdb.base/watchpoint.exp (test_constant_watchpoint): New
routine to test watchpoints created with a constant expression.
(test_inaccessible_watchpoint): Include tests for watchpoints
created with a constant expression.
* breakpoint.c (breakpoint_restore_shadows): New OWNER comment.
(should_be_inserted): Return zero also on NULL OWNER.
(breakpoint_program_space_exit): New OWNER comment.
(insert_breakpoint_locations): Extend comment for OWNER.
(remove_breakpoint_1, remove_breakpoint): Assert on OWNER.
(breakpoint_init_inferior, breakpoint_here_p, breakpoint_thread_match):
New OWNER comment.
(print_it_typical): Return PRINT_UNKNOWN on NULL OWNER.
(watchpoint_check): New assert on BREAKPOINT_AT and OWNER.
(bpstat_check_location): New assert on OWNER.
(bpstat_check_watchpoint, bpstat_check_breakpoint_conditions): Move BL
and B initializations to the code block. New assert on them.
(print_one_breakpoint_location): New OWNER comment.
(watchpoint_locations_match): Assert on OWNER.
(breakpoint_locations_match): Move HW_POINT1 and HW_POINT2
initializations to the code block. New assert on OWNER.
(set_breakpoint_location_function): New assert on OWNER.
(disable_breakpoints_in_shlibs, disable_breakpoints_in_unloaded_shlib)
(bp_location_compare, update_global_location_list)
(update_global_location_list): New OWNER comment.
gdb/testsuite/
* gdb.base/moribund-step.exp: New.
Clear stale specific bp_location from former whole breakpoint.
* breakpoint.c (delete_breakpoint): Move the stale referencing clear
code ...
(free_bp_location): ... here. Rename there the called function to
bpstat_remove_bp_location_callback.
(bpstat_remove_breakpoint_callback): Rename to ...
(bpstat_remove_bp_location_callback): ... here, change DATA resolution
to struct bp_location. Change the called function to
bpstat_remove_bp_location. Create new declaration for the function.
(bpstat_remove_breakpoint): Rename to ...
(bpstat_remove_bp_location): ..., change the parameter to loc, adjust
code for the new parameter type.
Implement `save-breakpoints'.
gdb/
* breakpoint.c (save_cmdlist): New.
(breakpoint_set_cmdlist, breakpoint_show_cmdlist): Moved up close
to save_cmdlist.
(print_recreate_catch_fork): New.
(catch_fork_breakpoint_ops): Install it.
(print_recreate_catch_vfork): New.
(catch_vfork_breakpoint_ops): Install it.
(print_recreate_catch_syscall): New.
(catch_syscall_breakpoint_ops): Install it.
(print_recreate_catch_exec): New.
(catch_exec_breakpoint_ops): Install it.
(print_recreate_exception_catchpoint): New.
(gnu_v3_exception_catchpoint_ops): Install it.
(save_breakpoints): New, based on tracepoint_save_command, but
handle all breakpoint types.
(save_breakpoints_command): New.
(tracepoint_save_command): Rename to...
(save_tracepoints_command): ... this, and reimplement using
save_breakpoints.
(save_command): New.
(_initialize_breakpoints): Install the "save" command prefix.
Install the "save breakpoints" command. Make "save-tracepoints" a
deprecated alias for "save tracepoints".
* breakpoint.h (struct breakpoint_ops): New field `print_recreate'.
* ada-lang.c (print_recreate_exception): New.
(print_recreate_catch_exception): New.
(catch_exception_breakpoint_ops): Install it.
(print_recreate_catch_exception_unhandled): New.
(catch_exception_unhandled_breakpoint_ops): Install it.
(print_recreate_catch_assert): New.
(catch_assert_breakpoint_ops): Install it.
* NEWS: Mention the new `save breakpoints' command. Mention the
new `save tracepoints' alias and that `save-tracepoints' is now
deprecated.
gdb/doc/
* gdb.texinfo (Save Breakpoints): New node.
(save-tracepoints): Rename to ...
(save tracepoints): ... this. Mention that `save-tracepoints' is
a deprecated alias to `save tracepoints'.
gdb/testsuite/
* gdb.trace/save-trace.exp: Adjust.
is_hardware_watchpoint.
(watchpoints_triggered): Ditto.
(bpstat_check_location): Use is_watchpoint and
is_hardware_watchpoint.
(bpstat_check_watchpoint): Use is_watchpoint and
is_hardware_watchpoint.
(bpstat_stop_status): Fix comment.
(user_settable_breakpoint): Use is_watchpoint.
(hw_watchpoint_used_count): Use is_hardware_watchpoint.
(disable_watchpoints_before_interactive_call_start): Use
is_watchpoint.
(enable_watchpoints_after_interactive_call_stop): Use
is_watchpoint.
(clear_command): Use is_watchpoint.
(do_enable_breakpoint): Use is_watchpoint.
Nathan Sidwell <nathan@codesourcery.com>
* breakpoint.c (breakpoint_1): Add filter argument, return number of
breakpoints printed.
(is_hardware_watchpoint): Make argument const.
(is_watchpoint): Ditto.
(is_tracepoint): Merge of tracepoint_type and breakpoint_is_tracepoint,
use it everywhere.
(breakpoints_info): Pass NULL to breakpoint_1.
(maintenance_info_breakpoints): Ditto.
(watchpoints_info): New function.
(tracepoints_info): Use breakpoint_1 filter.
(set_ignore_count): Warn that tracepoint ignore count will be ignored.
(_initialize_breakpoint): Make "info watchpoints" its own command.
* breakpoint.h (is_tracepoint): Rename from breakpoint_is_tracepoint.
* mi/mi-cmd-break.c (mi_cmd_break_commands): Use is_tracepoint.
* gdb.texinfo (Setting Breakpoints): "info watch" no longer a synonym.
(Setting Watchpoints): Update description of "info watch".
(Disabling Breakpoints): Only "info break" lists all.
* gdb.base/completion.exp: Update for new "info watchpoints".
* gdb.base/default.exp: Ditto.
* gdb.base/help.exp: Ditto.
* gdb.base/watchpoint.exp: Ditto.
* gdb.trace/infotrace.exp: Update "info tracpoints" output.
* breakpoint.c (tracepoint_save_command): Include variables,
conditionals, tracepoint types, and default-collect.
* tracepoint.c (save_trace_state_variables): New function.
* tracepoint.h (save_trace_state_variables): Declare it.
* gdb.trace/save-trace.exp: Test save/restore of default-collect
and tracepoint conditionals.
(gdb_verify_tracepoints): Delete unused return.
(skip_prologue_sal): Remove local definition.
(resolve_sal_pc): Remove now unnecessary code.
* linespec.c (minsym_found): Call skip_prologue_sal.
* symtab.c (find_function_start_pc): Remove.
(find_function_start_sal): Extract prologue skipping into ...
(skip_prologue_sal): ... this new function. Handle code both
with and without debug info. Respect SAL's explicit_pc and
explicit_line flags. Inline old find_function_start_pc.
* symtab.h (find_function_start_pc): Remove.
(skip_prologue_sal): Add prototype.
PR breakpoints/9352:
* NEWS: Mention changes to `commands' and `rbreak'.
* symtab.c (do_end_rbreak_breakpoints): New function.
(rbreak_command): Call start_rbreak_breakpoints; arrange to call
end_rbreak_breakpoints.
* breakpoint.c (breakpoint_count, tracepoint_count): Now static.
(set_breakpoint_count): Likewise. Clear last_was_multi.
(multi_start, multi_end, last_was_multi): New globals.
(start_rbreak_breakpoints, end_rbreak_breakpoints): New
functions.
(struct commands_info): New
(do_map_commands_command): New function.
(commands_command_1): New function.
(commands_command): Use it.
(commands_from_control_command): Likewise.
(do_delete_breakpoint): New function.
(delete_command): Use it.
(map_breakpoint_numbers): Add 'data' argument. Pass to callback.
(do_map_disable_breakpoint): New function.
(disable_command): Use it.
(do_map_enable_breakpoint): New function.
(enable_command): Use it.
(enable_once_breakpoint): Add argument.
(enable_once_command): Update.
(enable_delete_breakpoint): Add argument.
(enable_delete_command): Update.
(break_command_really): Set last_was_multi when needed.
(check_tracepoint_command): Fix formatting.
(validate_commands_for_breakpoint): New function.
(breakpoint_set_commands): Use it.
(tracepoint_save_command): Update.
* breakpoint.h (start_rbreak_breakpoints, end_rbreak_breakpoints):
Declare.
gdb/doc
PR breakpoints/9352:
* gdb.texinfo (Break Commands): Update.
gdb/testsuite
PR breakpoints/9352:
* gdb.base/default.exp: Update.
* gdb.base/commands.exp: Update.
* gdb.cp/extern-c.exp: Test setting commands on multiple
breakpoints at once.
* defs.h (read_command_lines, read_command_lines_1): New
parameters validator and closure.
* tracepoint.h (struct action_line): Remove.
* breakpoint.h (struct breakpoint): Remove the 'actions'
field.
* defs.h (enum command_control_type): New value
while_stepping_control.
(struct command_line): Add comments.
* breakpoint.c (breakoint_is_tracepoint): New.
(breakpoint_set_commands): For tracepoints,
verify the commands are permissible.
(check_tracepoint_commands): New.
(commands_command): Require that each new line is validated using
check_tracepoint_command, if we set commands for a tracepoint.
(create_tracepoint_from_upload): Likewise.
(print_one_breakpoint_location): Remove the code to print
actions specifically.
(tracepoint_save_command): Relay to print_command_lines.
* cli/cli-script.c (process_next_line): New parameters validator
and closure. Handle 'while-stepping'. Call validator if not null.
(read_command_lines, read_command_lines1): Likewise.
(recurse_read_control_structure): New parameters validator and
closure. Handle while_stepping_control.
(print_command_lines): Handle while-stepping.
(get_command_line, define_command, document_command): Adjust.
* remote.c (remote_download_tracepoint): Adjust.
* tracepoint.c (make_cleanup_free_actions, read_actions)
(free_actions, do_free_actions_cleanup): Remove.
(trace_actions_command): Use read_command_lines.
(validate_actionline): Use error in one place.
(encode_actions_1): New, extracted from...
(encode_actions): ...this. Also use cleanups for exception
safety.
(trace_dump_command): Adjust.
* mi/mi-cmd-break (mi_cmd_break_commands): Validate commands if
it's tracepoint.
* breakpoint.c (condition_command): Handle watchpoint conditions.
(is_hardware_watchpoint): Add comment.
(is_watchpoint): New.
(update_watchpoint): Don't reparse the watchpoint's condition
unless necessary.
(WP_IGNORE): New.
(watchpoint_check): Use it.
(bpstat_check_watchpoint): Handle it.
(bpstat_check_breakpoint_conditions): Evaluate watchpoint local
conditions in a frame where it makes sense.
(watch_command_1): Store the innermost block of the condition
expression.
(delete_breakpoint): Delete the watchpoint condition expression.
* breakpoint.h (struct bp_location) <cond>: Update comment.
(struct breakpoint): New fields `cond_exp' and
`cond_exp_valid_block'.
gdb/testsuite/
* gdb.base/watch-cond.c, gdb.base/watch-cond.exp: New.
* breakpoint.c (clear_syscall_counts): Take struct inferior*.
* inferior.c (add_inferior_silent): Notify inferior_added
observer.
(delete_inferior_1): Notify inferior_removed observer.
(exit_inferior_1): Pass inferior, not pid, to observer.
(inferior_appeared): Likewise.
(add_inferior_with_spaces): New.
(add_inferior_command): Use the above.
* inferior.h (delete_inferior_1, add_inferior_with_spaces):
Declare.
* inflow.c (inflow_inferior_exit): Likewise.
* jit.c (jit_inferior_exit_hook): Likewise.
* mi/mi-cmds.c (mi_cmds): Register add-inferior and
remove-inferior.
* mi/mi-cmds.h (mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
* mi/mi-interp.c (mi_inferior_added, mi_inferior_removed): New.
(report_initial_inferior): New.
(mi_inferior_removed): Register the above. Make sure
inferior_added observer is called on the first inferior.
(mi_new_thread, mi_thread_exit): Thread group is now identified by
inferior number, not pid.
(mi_solib_loaded, mi_solib_unloaded): Report which inferiors are
affected.
* mi/mi-main.c (current_context): New.
(proceed_thread_callback): Use typed closure.
Proceed everything if pid is 0. Most implementation split into
(proceed_thread): ... this.
(run_one_inferior): New.
(mi_cmd_exec_continue, mi_cmd_exec_interrupt, mi_cmd_exec_run):
Adjust for multiexec behaviour.
(mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
(mi_cmd_execute): Handle the 'thread-group' option here.
Do some extra checks.
* mi-parse.c (mi_parse): Handle the --all and --thread-group
options.
* mi-parse.h (struct mi_parse): New fields all and thread_group.
PR9605
gdb/
* breakpoint.c (insert_bp_location): If inserting the read
watchpoint failed, fallback to an access watchpoint.
(bpstat_check_watchpoint): Stop for read watchpoint triggers even
if the value changed, if not watching the same memory for writes.
(watchpoint_locations_match): Add comment.
(update_global_location_list): Copy the location's watchpoint type.
* i386-nat.c (i386_length_and_rw_bits): It's an internal error to
handle read watchpoints here.
(i386_insert_watchpoint): Read watchpoints aren't supported.
* remote.c (remote_insert_watchpoint): Return 1 for unsupported
packets.
* target.h (target_insert_watchpoint): Update description.
2010-02-22 Pedro Alves <pedro@codesourcery.com>
PR9605
gdbserver/
* i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
handing a read watchpoint.
(i386_low_insert_watchpoint): Read watchpoints aren't supported.
2010-02-22 Pedro Alves <pedro@codesourcery.com>
PR9605
gdb/testsuite/
* gdb.base/watch-read.c, gdb.base/watch-read.exp: New files.
Return false if no breakpoint was created, true otherwise.
(trace_command): Don't set the tracepoint count if no tracepoint
was created.
(ftrace_command): Ditto.
(create_tracepoint_from_upload): Bail out if the tracepoint wasn't
created in the breakpoints table.