* breakpoint.h (gdbpy_breakpoint_object): Renamed from
breakpoint_object. All uses updated.
* python/python-internal.h (gdbpy_breakpoint_object): Renamed from
breakpoint_object. All uses updated.
* python.c (*): All uses of breakpoint_object updated.
* python.h (*): All uses of breakpoint_object updated.
* python/py-breakpoint.c (*): All uses of breakpoint_object updated.
* python/py-finishbreakpoint.c (*): Ditto.
After the previous patch, there's actually no breakpoint type that
returns BPSTAT_SIGNAL_HIDE, so we can go back to having
bpstat_explains_signal return a boolean. The signal hiding actually
disappears.
gdb/
2013-11-14 Pedro Alves <palves@redhat.com>
* break-catch-sig.c (signal_catchpoint_explains_signal): Adjust to
return a boolean.
* breakpoint.c (bpstat_explains_signal): Adjust to return a
boolean.
(explains_signal_watchpoint, base_breakpoint_explains_signal):
Adjust to return a boolean.
* breakpoint.h (enum bpstat_signal_value): Delete.
(struct breakpoint_ops) <explains_signal>: New returns a boolean.
(bpstat_explains_signal): Likewise.
* infrun.c (handle_inferior_event) <random signal checks>:
bpstat_explains_signal now returns a boolean - adjust. No longer
consider hiding signals.
This patch introduces two new GDB/MI commands implementing the equivalent
of the "catch exception" and "catch assert" GDB/CLI commands.
gdb/ChangeLog:
* breakpoint.h (init_ada_exception_breakpoint): Add parameter
"enabled".
* breakpoint.c (init_ada_exception_breakpoint): Add parameter
"enabled". Set B->ENABLE_STATE accordingly.
* ada-lang.h (ada_exception_catchpoint_kind): Move here from
ada-lang.c.
(create_ada_exception_catchpoint): Add declaration.
* ada-lang.c (ada_exception_catchpoint_kind): Move to ada-lang.h.
(create_ada_exception_catchpoint): Make non-static. Add new
parameter "disabled". Use it in call to
init_ada_exception_breakpoint.
(catch_ada_exception_command): Add parameter "enabled" in call
to create_ada_exception_catchpoint.
(catch_assert_command): Likewise.
* mi/mi-cmds.h (mi_cmd_catch_assert, mi_cmd_catch_exception):
Add declarations.
* mi/mi-cmds.c (mi_cmds): Add the "catch-assert" and
"catch-exception" commands.
* mi/mi-cmd-catch.c: Add #include "ada-lang.h".
(mi_cmd_catch_assert, mi_cmd_catch_exception): New functions.
This fixes PR cli/15603.
The bug here is that when a software watchpoint is being used, gdb
will stop responding to C-c. This is a regression caused by the
"catch signal" patch.
The problem is that software watchpoints always end up on the bpstat
list. However, this makes bpstat_explains_signal return
BPSTAT_SIGNAL_HIDE, causing infrun to think that the signal is not a
"random signal".
The fix is to change bpstat_explains_signal to handle this better. I
chose to do it in a "clean API" way, by passing the signal value to
bpstat_explains_signal and then adding an explains_signal method for
watchpoints, which handles the specifics.
Built and regtested on x86-64 Fedora 18.
New test case included.
* break-catch-sig.c (signal_catchpoint_explains_signal): Add 'sig'
argument.
* breakpoint.c (bpstat_explains_signal): Add 'sig' argument.
Special case signals other than GDB_SIGNAL_TRAP.
(explains_signal_watchpoint): New function.
(base_breakpoint_explains_signal): Add 'sig' argument.
(initialize_breakpoint_ops): Set 'explains_signal' method for
watchpoints.
* breakpoint.h (struct breakpoint_ops) <explains_signal>: Add
signal argument.
(bpstat_explains_signal): Likewise.
* infrun.c (handle_syscall_event, handle_inferior_event): Update.
* gdb.base/random-signal.c: New file.
* gdb.base/random-signal.exp: New file.
* breakpoint.h (handle_solib_event): Moved function declaration
to solib.h.
* breakpoint.c (handle_solib_event): Moved function to solib.c.
(bpstat_stop_status): Pass new argument to handle_solib_event.
* solib.h (update_solib_breakpoints): New function declaration.
(handle_solib_event): Moved function declaration from
breakpoint.h.
* solib.c (update_solib_breakpoints): New function.
(handle_solib_event): Moved function from breakpoint.c.
Updated to call solib_ops->handle_event if not NULL.
* solist.h (target_so_ops): New fields "update_breakpoints" and
"handle_event".
* infrun.c (set_stop_on_solib_events): New function.
(_initialize_infrun): Use the above for "set
stop-on-solib-events".
(handle_inferior_event): Pass new argument to handle_solib_event.
* solib-svr4.c (probe.h): New include.
(svr4_free_library_list): New forward declaration.
(probe_action): New enum.
(probe_info): New struct.
(probe_info): New static variable.
(NUM_PROBES): New definition.
(svr4_info): New fields "using_xfer", "probes_table" and
"solib_list".
(free_probes_table): New function.
(free_solib_list): New function.
(svr4_pspace_data_cleanup): Free probes table and solib list.
(svr4_copy_library_list): New function.
(svr4_current_sos_via_xfer_libraries): New parameter "annex".
(svr4_read_so_list): New parameter "prev_lm".
(svr4_current_sos_direct): Renamed from "svr4_current_sos".
(svr4_current_sos): New function.
(probe_and_action): New struct.
(hash_probe_and_action): New function.
(equal_probe_and_action): Likewise.
(register_solib_event_probe): Likewise.
(solib_event_probe_at): Likewise.
(solib_event_probe_action): Likewise.
(solist_update_full): Likewise.
(solist_update_incremental): Likewise.
(disable_probes_interface_cleanup): Likewise.
(svr4_handle_solib_event): Likewise.
(svr4_update_solib_event_breakpoint): Likewise.
(svr4_update_solib_event_breakpoints): Likewise.
(svr4_create_solib_event_breakpoints): Likewise.
(enable_break): Free probes table before creating breakpoints.
Use svr4_create_solib_event_breakpoints to create breakpoints.
(svr4_solib_create_inferior_hook): Free the solib list.
(_initialize_svr4_solib): Initialise
svr4_so_ops.handle_solib_event and svr4_so_ops.update_breakpoints.
If !PARSE_CONDITION_AND_THREAD, then ARG is just the location, nothing
else. The fact that the describing comment of create_breakpoint
doesn't mention this just looks like an oversight of when extra_string
was added. "parse_condition_and_thread" has been a misnomer ever
since extra_string was added -- better rename it avoid more confusion.
This makes it "parse_arg", as that'll remain stable even if/when more
explicit parameters are added.
gdb/
2013-04-08 Pedro Alves <palves@redhat.com>
Keith Seitz <keiths@redhat.com>
* breakpoint.c (create_breakpoint): Rename
"parse_condition_and_thread" parameter to "parse_arg". Update
describing comment. If !PARSE_ARG, then error out if ARG is not
the empty string after extracting the location.
* breakpoint.h (create_breakpoint): Rename
"parse_condition_and_thread" parameter to "parse_arg".
gdb/testsuite/
2013-04-08 Pedro Alves <palves@redhat.com>
* gdb.mi/mi-break.exp (test_error): Add tests with garbage after
the location.
Code cleanup.
* breakpoint.c (print_breakpoint_location): Replace bp_location field
source_file references by symtab field references. Remove variables
sal and fullname.
(momentary_breakpoint_from_master, add_location_to_breakpoint):
(clear_command, say_where): Replace bp_location field source_file
references by symtab field references.
(bp_location_dtor): Remove the source_file reference.
(update_static_tracepoint): Replace bp_location field source_file
references by symtab field references.
(breakpoint_free_objfile): New function.
* breakpoint.h (struct bp_location): Extend the comment for line_number.
Replace the field source_file by field symtab, extend its comment.
(breakpoint_free_objfile): New declaration.
* objfiles.c (free_objfile): Call breakpoint_free_objfile.
* tui/tui-winsource.c (tui_update_breakpoint_info): Replace bp_location
field source_file references by symtab field references.
Two modifications:
1. The addition of 2013 to the copyright year range for every file;
2. The use of a single year range, instead of potentially multiple
year ranges, as approved by the FSF.
They are equivalent to "catch load" and "catch unload" from CLI.
Rationale: GUIs might be interested in catching solib load or
unload events.
2012-11-16 Mircea Gherzan <mircea.gherzan@intel.com>
* Makefile.in (SUBDIR_MI_OBS): Add mi-cmd-catch.o.
(SUBDIR_MI_SRCS): Add mi/mi-cmd-catch.c.
* breakpoint.c (add_solib_catchpoint): New function that
can be used by both CLI and MI, factored out from
catch_load_or_unload.
(catch_load_or_unload): Strip it down and make it use the
new add_solib_catchpoint.
* breakpoint.h (add_solib_catchpoint): Declare it.
* mi/mi-cmd-break.h: New file.
* mi/mi-cmd-break.c: Include mi-cmd-break.h.
(setup_breakpoint_reporting): New function used for both
catchpoints and breakpoints.
(mi_cmd_break_insert): Use setup_breakpoint_reporting.
* mi/mi-cmd-catch.c: New file.
* mi/mi-cmds.c (mi_cmds): Add the handlers for -catch-load
and -catch-unload.
* mi/mi-cmds.h: Declare the handlers for -catch-load and
-catch-unload.
Before this change, detach_breakpoints would take a pid, and then
set inferior_ptid to a ptid that it constructs using pid_to_ptid (pid).
Unfortunately, this ptid is not necessarily valid. Consider for
instance the case of ia64-hpux, where ttrace refuses a register-read
operation if the LWP is not provided.
This problems shows up when GDB is trying to handle fork events.
Assuming GDB is configured to follow the parent, GDB will try to
detach from the child. But before doing so, it needs to remove
all breakpoints inside that child. On ia64, this involves reading
inferior (the child's) memory. And on ia64-hpux, reading memory
requires us to read the bsp and bspstore registers, in order to
determine where that memory is relative to the value of those
registers, and thus to determine which ttrace operation to use in
order to fetch that memory (see ia64_hpux_xfer_memory).
This patch therefore changes detach_breakpoints to take a ptid instead
of a pid, and then updates all callers.
One of the consequences of this patch is that it trips an assert
on GNU/Linux targets. But this assert appears to have not actual
purpose, and is thus removed.
gdb/ChangeLog:
* breakpoint.h (detach_breakpoints): pid parameter is now a ptid.
* breakpoint.c (detach_breakpoints): Change pid parameter into
a ptid. Adjust code accordingly.
* infrun.c (handle_inferior_event): Delete variable child_pid.
Update call to detach_breakpoints to pass the child ptid for
fork events.
* linux-nat.c (linux_nat_iterate_watchpoint_lwps): Remove
assert that inferior_ptid's lwp is zero.
(linux_handle_extended_wait): Update call to detach_breakpoints.
* inf-ttrace.c (inf_ttrace_follow_fork): Update call to
detach_breakpoints.
Remove stale dummy frames.
* breakpoint.c: Include dummy-frame.h.
(longjmp_breakpoint_ops): New variable.
(update_breakpoints_after_exec, breakpoint_init_inferior): Delete also
bp_longjmp_call_dummy.
(bpstat_what, bptype_string, print_one_breakpoint_location)
(init_bp_location): Support bp_longjmp_call_dummy.
(set_longjmp_breakpoint): Use longjmp_breakpoint_ops. Comment why.
(set_longjmp_breakpoint_for_call_dummy)
(check_longjmp_breakpoint_for_call_dummy, longjmp_bkpt_dtor): New
functions.
(initialize_breakpoint_ops): Initialize longjmp_breakpoint_ops.
* breakpoint.h (enum bptype): New item bp_longjmp_call_dummy. Delete
FIXME comment and extend the other comment for bp_call_dummy.
(set_longjmp_breakpoint_for_call_dummy)
(check_longjmp_breakpoint_for_call_dummy): New declarations.
* dummy-frame.c: Include gdbthread.h.
(pop_dummy_frame_bpt): New function.
(pop_dummy_frame): Call pop_dummy_frame_bpt.
(dummy_frame_discard): New function.
(cleanup_dummy_frames): Update the comment about longjmps.
* dummy-frame.h (dummy_frame_discard): New declaration.
* gdbthread.h (struct thread_info): Extend initiating_frame comment.
* infcall.c (call_function_by_hand): New variable longjmp_b. Call
set_longjmp_breakpoint_for_call_dummy. Chain its breakpoints with BPT.
* infrun.c (handle_inferior_event) <BPSTAT_WHAT_CLEAR_LONGJMP_RESUME>:
Add case 4 comment. Call check_longjmp_breakpoint_for_call_dummy and
keep_going if IS_LONGJMP and there is no other reason to stop.
gdb/testsuite/
Remove stale dummy frames.
* gdb.base/call-signal-resume.exp (maintenance print dummy-frames)
(maintenance info breakpoints): New tests.
* gdb.base/stale-infcall.c: New file.
* gdb.base/stale-infcall.exp: New file.
* breakpoint.h: Include command.h.
(add_catch_command): Use completer_ftype.
* cli/cli-decode.c (set_cmd_completer): Use completer_ftype.
* cli/cli-decode.h (struct cmd_list_element) <completer>:
Use completer_ftype.
* command.h (completer_ftype): New typedef.
(set_cmd_completer): Use it.
* python/py-cmd.c (struct cmdpy_completer) <completer>: Use
completer_ftype.
* breakpoint.h (bp_location): Add related_address member.
* inferior.h (get_return_value): Take a pointer to struct value
instead of struct type for the function requested.
* value.h (using_struct_return): Likewise.
* gdbarch.sh (return_value): Take a pointer to struct value
instead of struct type for the function requested.
* breakpoint.c (set_breakpoint_location_function): Initialize
related_address for bp_gnu_ifunc_resolver breakpoints.
* elfread.c (elf_gnu_ifunc_resolver_return_stop): Pass the
requested function's address to gdbarch_return_value.
* eval.c (evaluate_subexp_standard): Pass the requested
function's address to using_struct_return.
* infcall.c (call_function_by_hand): Pass the requested
function's address to using_struct_return and
gdbarch_return_value.
* infcmd.c (get_return_value): Take a pointer to struct value
instead of struct type for the function requested.
(print_return_value): Update accordingly.
(finish_command_continuation): Likewise.
* stack.c (return_command): Pass the requested function's
address to using_struct_return and gdbarch_return_value.
* value.c (using_struct_return): Take a pointer to struct value
instead of struct type for the function requested. Pass the
requested function's address to gdbarch_return_value.
* python/py-finishbreakpoint.c (finish_breakpoint_object):
New function_value member, replacing function_type.
(bpfinishpy_dealloc): Update accordingly.
(bpfinishpy_pre_stop_hook): Likewise.
(bpfinishpy_init): Likewise. Record the requested function's
address.
* mips-tdep.c (mips_fval_reg): New enum.
(mips_o32_push_dummy_call): For MIPS16 FP doubles do not swap
words put in GP registers.
(mips_o64_push_dummy_call): Update a comment.
(mips_o32_return_value): Take a pointer to struct value instead
of struct type for the function requested and use it to check if
using the MIPS16 calling convention. Return the designated
general purpose registers for floating-point values returned in
MIPS16 mode.
(mips_o64_return_value): Likewise.
* ppc-tdep.h (ppc_sysv_abi_return_value): Update prototype.
(ppc_sysv_abi_broken_return_value): Likewise.
(ppc64_sysv_abi_return_value): Likewise.
* alpha-tdep.c (alpha_return_value): Take a pointer to struct
value instead of struct type for the function requested.
* amd64-tdep.c (amd64_return_value): Likewise.
* amd64-windows-tdep.c (amd64_windows_return_value): Likewise.
* arm-tdep.c (arm_return_value): Likewise.
* avr-tdep.c (avr_return_value): Likewise.
* bfin-tdep.c (bfin_return_value): Likewise.
* cris-tdep.c (cris_return_value): Likewise.
* frv-tdep.c (frv_return_value): Likewise.
* h8300-tdep.c (h8300_return_value): Likewise.
(h8300h_return_value): Likewise.
* hppa-tdep.c (hppa32_return_value): Likewise.
(hppa64_return_value): Likewise.
* i386-tdep.c (i386_return_value): Likewise.
* ia64-tdep.c (ia64_return_value): Likewise.
* iq2000-tdep.c (iq2000_return_value): Likewise.
* lm32-tdep.c (lm32_return_value): Likewise.
* m32c-tdep.c (m32c_return_value): Likewise.
* m32r-tdep.c (m32r_return_value): Likewise.
* m68hc11-tdep.c (m68hc11_return_value): Likewise.
* m68k-tdep.c (m68k_return_value): Likewise.
(m68k_svr4_return_value): Likewise.
* m88k-tdep.c (m88k_return_value): Likewise.
* mep-tdep.c (mep_return_value): Likewise.
* microblaze-tdep.c (microblaze_return_value): Likewise.
* mn10300-tdep.c (mn10300_return_value): Likewise.
* moxie-tdep.c (moxie_return_value): Likewise.
* mt-tdep.c (mt_return_value): Likewise.
* ppc-linux-tdep.c (ppc_linux_return_value): Likewise.
* ppc-sysv-tdep.c (ppc_sysv_abi_return_value): Likewise.
(ppc_sysv_abi_broken_return_value): Likewise.
(ppc64_sysv_abi_return_value): Likewise.
* ppcnbsd-tdep.c (ppcnbsd_return_value): Likewise.
* rl78-tdep.c (rl78_return_value): Likewise.
* rs6000-aix-tdep.c (rs6000_return_value): Likewise.
* rx-tdep.c (rx_return_value): Likewise.
* s390-tdep.c (s390_return_value): Likewise.
* score-tdep.c (score_return_value): Likewise.
* sh-tdep.c (sh_return_value_nofpu): Likewise.
(sh_return_value_fpu): Likewise.
* sh64-tdep.c (sh64_return_value): Likewise.
* sparc-tdep.c (sparc32_return_value): Likewise.
* sparc64-tdep.c (sparc64_return_value): Likewise.
* spu-tdep.c (spu_return_value): Likewise.
* tic6x-tdep.c (tic6x_return_value): Likewise.
* v850-tdep.c (v850_return_value): Likewise.
* vax-tdep.c (vax_return_value): Likewise.
* xstormy16-tdep.c (xstormy16_return_value): Likewise.
* xtensa-tdep.c (xtensa_return_value): Likewise.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
gdb/testsuite/
* gdb.base/return-nodebug.exp: Also test float and double types.
Revert this patch to allow breakpoint always-inserted
in record target.
2011-12-05 Pedro Alves <pedro@codesourcery.com>
* breakpoint.c: Include record.h.
(breakpoints_always_inserted_mode): Return false when the record
target is in use.
* breakpoint.c (iterate_over_bp_locations): New.
* breakpoint.h: Declare.
New typedef walk_bp_location_callback.
* record.c (record_open): Call record_init_record_breakpoints.
(record_sync_record_breakpoints): New.
(record_init_record_breakpoints): New.
* NEWS: Mention supporting breakpoint always-inserted mode in
record target.
Pedro Alves <palves@redhat.com>
PR breakpoints/13776:
* breakpoint.c (breakpoint_init_inferior): Delete step-resume
breakpoints.
(delete_longjmp_breakpoint_at_next_stop): New.
* breakpoint.h (delete_longjmp_breakpoint_at_next_stop): Declare.
* target.c (generic_mourn_inferior): Call mark_breakpoints_out
before deleting the inferior. Add comments.
* thread.c (clear_thread_inferior_resources): Don't delete lonjmp
breakpoints immediately, but only on next stop. Move that code
next to where we mark other breakpoints for deletion.
* remote.c (remote_supports_cond_breakpoints): New forward
declaration.
(remote_add_target_side_condition): New function.
(remote_insert_breakpoint): Add target-side breakpoint
conditional if supported.
(remote_insert_hw_breakpoint): Likewise.
(init_remote_ops): Set to_supports_evaluation_of_breakpoint_conditions
hook.
* target.c (update_current_target): Inherit
to_supports_evaluation_of_breakpoint_conditions.
Default to_supports_evaluation_of_breakpoint_conditions to return_zero.
* target.h (struct target_ops)
<to_supports_evaluation_of_breakpoint_conditions>: New field.
(target_supports_evaluation_of_breakpoint_conditions): New #define.
* breakpoint.c (get_first_locp_gte_addr): New forward declaration.
(condition_evaluation_both, condition_evaluation_auto,
condition_evaluation_host, condition_evaluation_target,
condition_evaluation_enums, condition_evaluation_mode_1,
condition_evaluation_mode): New static globals.
(translate_condition_evaluation_mode): New function.
(breakpoint_condition_evaluation_mode): New function.
(gdb_evaluates_breakpoint_condition_p): New function.
(ALL_BP_LOCATIONS_AT_ADDR): New helper macro.
(mark_breakpoint_modified): New function.
(mark_breakpoint_location_modified): New function.
(set_condition_evaluation_mode): New function.
(show_condition_evaluation_mode): New function.
(bp_location_compare_addrs): New function.
(get_first_location_gte_addr): New helper function.
(set_breakpoint_condition): Free condition bytecode if locations
has become unconditional. Call mark_breakpoint_modified (...).
(condition_command): Call update_global_location_list (1) for
breakpoints.
(breakpoint_xfer_memory): Use is_breakpoint (...).
(is_breakpoint): New function.
(parse_cond_to_aexpr): New function.
(build_target_condition_list): New function.
(insert_bp_location): Handle target-side conditional
breakpoints and call build_target_condition_list (...).
(update_inserted_breakpoint_locations): New function.
(insert_breakpoint_locations): Handle target-side conditional
breakpoints.
(bpstat_check_breakpoint_conditions): Add comment.
(bp_condition_evaluator): New function.
(bp_location_condition_evaluator): New function.
(print_breakpoint_location): Print information on where the condition
will be evaluated.
(print_one_breakpoint_location): Likewise.
(init_bp_location): Call mark_breakpoint_location_modified (...) for
breakpoint location.
(force_breakpoint_reinsertion): New functions.
(update_global_location_list): Handle target-side breakpoint
conditions.
Reinsert locations that are already inserted if conditions have
changed.
(bp_location_dtor): Free agent expression bytecode.
(disable_breakpoint): Call mark_breakpoint_modified (...).
Call update_global_location_list (...) with parameter 1 for breakpoints.
(disable_command): Call mark_breakpoint_location_modified (...).
Call update_global_location_list (...) with parameter 1 for breakpoints.
(enable_breakpoint_disp): Call mark_breakpoint_modified (...).
(enable_command): mark_breakpoint_location_modified (...).
(_initialize_breakpoint): Update documentation and add
condition-evaluation breakpoint subcommand.
* breakpoint.h: Include ax.h.
(condition_list): New data structure.
(condition_status): New enum.
(bp_target_info) <cond_list>: New field.
(bp_location) <condition_changed, cond_bytecode>: New fields.
(is_breakpoint): New prototype.
* 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 (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.
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.