summaryrefslogtreecommitdiff
path: root/gdb/breakpoint.h
Commit message (Collapse)AuthorAgeFilesLines
* New GDB/MI commands to catch Ada exceptionsJoel Brobecker2013-10-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* gdb/qiyao2013-07-271-9/+1
| | | | | | | | | | | * breakpoint.h: Include break-common.h. (enum target_hw_bp_type): Move to ... * common/break-common.h: ... here. New. gdb/gdbserver/ * i386-low.c: Include break-common.h. (enum target_hw_bp_type): Remove.
* gdb/qiyao2013-07-061-2/+1
| | | | | | | | | | | | * breakpoint.h (struct breakpoint_ops) <create_breakpoints_sal>: Remove parameter 'lsal'. * breakpoint.c (create_breakpoint): Move local variable 'lsal' to inner block. Caller update. (base_breakpoint_create_breakpoints_sal): Update. (bkpt_create_breakpoints_sal): Likewise. (tracepoint_create_breakpoints_sal): Likewise. (strace_marker_create_breakpoints_sal): Get 'lsal' from the element 0 of vector 'canonical->sals'.
* 2013-06-25 Yao Qi <yao@codesourcery.com>Hui Zhu2013-06-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hui Zhu <hui@codesourcery.com> Pedro Alves <palves@redhat.com> PR breakpoints/15075 PR breakpoints/15434 * breakpoint.c (bpstat_stop_status): Call b->ops->after_condition_true. (update_dprintf_command_list): Don't append "continue" command to the command list of dprintf breakpoint. (base_breakpoint_after_condition_true): New function. (base_breakpoint_ops): Add base_breakpoint_after_condition_true. (dprintf_after_condition_true): New function. (initialize_breakpoint_ops): Set dprintf_after_condition_true. * breakpoint.h (breakpoint_ops): Add after_condition_true. 2013-06-25 Yao Qi <yao@codesourcery.com> Hui Zhu <hui@codesourcery.com> Pedro Alves <palves@redhat.com> PR breakpoints/15075 PR breakpoints/15434 * gdb.base/dprintf-next.c: New file. * gdb.base/dprintf-next.exp: New file. * gdb.base/dprintf-non-stop.c: New file. * gdb.base/dprintf-non-stop.exp: New file. * gdb.base/dprintf.exp: Don't check "continue" in the output of "info breakpoints". * gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify): Don't check "continue" in script field.
* Fix PR cli/15603Tom Tromey2013-06-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 2013-06-04 Gary Benson <gbenson@redhat.com>gary2013-06-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2013-05-21 Hui Zhu <hui@codesourcery.com>Hui Zhu2013-05-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | * breakpoint.c (dprintf_breakpoint_ops): Remove its static. * breakpoint.h (dprintf_breakpoint_ops): Add extern. * mi/mi-cmd-break.c (ctype.h): New include. (gdb_obstack.h): New include. (mi_argv_to_format, mi_cmd_break_insert_1): New. (mi_cmd_break_insert): Call mi_cmd_break_insert_1. (mi_cmd_dprintf_insert): New. * mi/mi-cmds.c (mi_cmds): Add "dprintf-insert". * mi/mi-cmds.h (mi_cmd_dprintf_insert): New extern. 2013-05-21 Hui Zhu <hui@codesourcery.com> * gdb.texinfo (GDB/MI Breakpoint Commands): Describe the "-dprintf-insert" command. 2013-05-21 Hui Zhu <hui@codesourcery.com> * gdb.mi/Makefile.in (PROGS): Add "mi-dprintf". * gdb.mi/mi-dprintf.exp, gdb.mi/mi-dprintf.c: New.
* * Makefile.in (SFILES): Add break-catch-throw.cTom Tromey2013-04-151-0/+2
| | | | | | | | (COMMON_OBS): Add break-catch-throw.o. * break-catch-throw.c: New file. * breakpoint.c: Move exception-catching code to new file. (ep_parse_optional_if_clause): No longer static. * breakpoint.h (ep_parse_optional_if_clause): Declare.
* create_breapoint / explicit mode: Error out if there's garbage after the ↵Pedro Alves2013-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | breakpoint location. 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.
* * breakpoint.h (struct breakpoint): Add comment toKeith Seitz2013-03-201-1/+2
| | | | | extra_string indicating that this member is mallod'd. * breakpoint.c (base_breakpoint_dtor): Free extra_string.
* gdb/Jan Kratochvil2013-02-031-3/+9
| | | | | | | | | | | | | | | | | | | | 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.
* 2013-01-03 Pedro Alves <palves@redhat.com>Tom Tromey2013-01-161-4/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tom Tromey <tromey@redhat.com> PR cli/7221: * NEWS: Add "catch signal". * breakpoint.c (base_breakpoint_ops): No longer static. (bpstat_explains_signal): New function. (init_catchpoint): No longer static. (base_breakpoint_explains_signal): New function. (base_breakpoint_ops): Initialize new field. * breakpoint.h (enum bpstat_signal_value): New. (struct breakpoint_ops) <explains_signal>: New field. (bpstat_explains_signal): Remove macro, declare as function. (base_breakpoint_ops, init_catchpoint): Declare. * break-catch-sig.c: New file. * inferior.h (signal_catch_update): Declare. * infrun.c (signal_catch): New global. (handle_syscall_event): Update for change to bpstat_explains_signal. (handle_inferior_event): Likewise. Always handle random signals via bpstats. (signal_cache_update): Check signal_catch. (signal_catch_update): New function. (_initialize_infrun): Initialize signal_catch. * Makefile.in (SFILES): Add break-catch-sig.c. (COMMON_OBS): Add break-catch-sig.o. gdb/doc * gdb.texinfo (Set Catchpoints): Document "catch signal". (Signals): Likewise. gdb/testsuite * gdb.base/catch-signal.c: New file. * gdb.base/catch-signal.exp: New file.
* Update years in copyright notice for the GDB files.Joel Brobecker2013-01-011-1/+1
| | | | | | | 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.
* MI: add the -catch-load and -catch-unload commandsmgherzan2012-12-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * ada-exp.y (write_object_renaming, write_var_or_type)Tom Tromey2012-12-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (write_ambiguous_var, write_var_from_sym): Make blocks const. * ada-lang.c (replace_operator_with_call) (find_old_style_renaming_symbol): Make blocks const. * ada-lang.h (ada_find_renaming_symbol): Update. (struct ada_symbol_info) <block>: Now const. * breakpoint.c (watch_command_1): Update. * breakpoint.h (struct watchpoint) <exp_valid_block, cond_exp_valid_block>: Now const. * c-exp.y (classify_inner_name, classify_name): Make block argument const. * expprint.c (print_subexp_standard) <OP_VAR_VALUE>: Make 'b' const. * expression.h (innermost_block, parse_exp_1): Update. (union exp_element) <block>: Now const. * gdbtypes.c (lookup_template_type, lookup_enum, lookup_union) (lookup_struct): Make block argument const. * gdbtypes.h (lookup_template_type): Update. * go-exp.y (classify_name, classify_packaged_name) (package_name_p): Make block argument const. * objc-lang.c (lookup_struct_typedef): Make block argument const. * objc-lang.h (lookup_struct_typedef): Update. * parse.c (parse_exp_in_context, parse_exp_1) (write_exp_elt_block): Make block arguments const. (expression_context_block, innermost_block): Now const. * parser-defs.h (write_exp_elt_block): Update. (expression_context_block, innermost_block, block_found): Now const. * printcmd.c (struct display) <block>: Now const. * symtab.h (lookup_struct, lookup_union, lookup_enum): Update. * valops.c (address_of_variable): Make block argument const. * value.h (value_of_variable): Update. * varobj.c (struct varobj_root) <valid_block>: Now const.
* gdb/qiyao2012-09-261-0/+1
| | | | | | | PR breakpoints/13898 * breakpoint.h (tracepoint_breakpoint_ops): Forward declaration. * mi/mi-cmd-break.c (mi_cmd_break_insert): Set breakpoint_ops per breakpoint type.
* Change detach_breakpoints to take a ptid instead of a pidJoel Brobecker2012-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add target-side support for dynamic printf.Stan Shebs2012-07-021-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Mention the additional style. * breakpoint.h (struct bp_target_info): New fields tcommands, persist. (struct bp_location): New field cmd_bytecode. * breakpoint.c: Include format.h. (disconnected_dprintf): New global. (parse_cmd_to_aexpr): New function. (build_target_command_list): New function. (insert_bp_location): Call it. (remove_breakpoints_pid): Skip dprintf breakpoints. (print_one_breakpoint_location): Ditto. (dprintf_style_agent): New global. (dprintf_style_enums): Add dprintf_style_agent. (update_dprintf_command_list): Add agent case. (agent_printf_command): New function. (_initialize_breakpoint): Add new commands. * common/ax.def (printf): New bytecode. * ax.h (ax_string): Declare. * ax-gdb.h (gen_printf): Declare. * ax-gdb.c: Include cli-utils.h, format.h. (gen_printf): New function. (maint_agent_print_command): New function. (_initialize_ax_gdb): Add maint agent-printf command. * ax-general.c (ax_string): New function. (ax_print): Add printf disassembly. * Makefile.in (SFILES): Add format.c (COMMON_OBS): Add format.o. * common/format.h: New file. * common/format.c: New file. * printcmd.c: Include format.h. (ui_printf): Call parse_format_string. * remote.c (remote_state): New field breakpoint_commands. (PACKET_BreakpointCommands): New enum. (remote_breakpoint_commands_feature): New function. (remote_protocol_features): Add new BreakpointCommands entry. (remote_can_run_breakpoint_commands): New function. (remote_add_target_side_commands): New function. (remote_insert_breakpoint): Call it. (remote_insert_hw_breakpoint): Ditto. (_initialize_remote): Add new packet configuration for target-side breakpoint commands. * target.h (struct target_ops): New field to_can_run_breakpoint_commands. (target_can_run_breakpoint_commands): New macro. * target.c (update_current_target): Handle to_can_run_breakpoint_commands. [gdbserver] * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define. (ax.o): Add it to build rule. (ax-ipa.o): Ditto. (OBS): Add format.o. (IPA_OBS): Add format.o. * server.c (handle_query): Claim support for breakpoint commands. (process_point_options): Add command case. (process_serial_event): Leave running if there are printfs in effect. * mem-break.h (any_persistent_commands): Declare. (add_breakpoint_commands): Declare. (gdb_no_commands_at_breakpoint): Declare. (run_breakpoint_commands): Declare. * mem-break.c (struct point_command_list): New struct. (struct breakpoint): New field command_list. (any_persistent_commands): New function. (add_commands_to_breakpoint): New function. (add_breakpoint_commands): New function. (gdb_no_commands_at_breakpoint): New function. (run_breakpoint_commands): New function. * linux-low.c (linux_wait_1): Test for and run breakpoint commands locally. * ax.c: Include format.h. (ax_printf): New function. (gdb_eval_agent_expr): Add printf opcode. [doc] * gdb.texinfo (Dynamic Printf): Mention agent style and disconnected dprintf. (Maintenance Commands): Describe maint agent-printf. (General Query Packets): Mention BreakpointCommands feature. (Packets): Document commands extension to Z0 packet. * agentexpr.texi (Bytecode Descriptions): Document printf bytecode. [testsuite] * gdb.base/dprintf.exp: Add agent style tests.
* gdb/Jan Kratochvil2012-06-181-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.c (add_catch_command): Use completer_ftype.Tom Tromey2012-06-131-2/+2
| | | | | | | | | | | | * 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.
* gdb/Maciej W. Rozycki2012-05-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2012-05-14 Stan Shebs <stan@codesourcery.com>Stan Shebs2012-05-141-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add dynamic printf. * breakpoint.h (enum bptype): New type bp_dprintf. (struct breakpoint): New field extra_string. (struct breakpoint_ops): Add arg to create_breakpoints_sal. (create_breakpoint): Add extra_string arg. * breakpoint.c (dprintf_breakpoint_ops): New. (is_breakpoint): Add bp_dprintf. (bpstat_what): Add dprintf case. (bptype_string): Ditto. (print_one_breakpoint_location): Ditto. (init_bp_location): Ditto. (bkpt_print_mention): Ditto. (dprintf_style_enums): New array. (dprintf_style): New global. (dprintf_function): New global. (dprintf_channel): New global. (update_dprintf_command_list): New function. (update_dprintf_commands): New function. (init_breakpoint_sal): Add extra_string argument, handle it. (create_breakpoint_sal): Add extra_string argument. (create_breakpoints_sal): Add extra_string argument, update callers. (find_condition_and_thread): Add extra argument. (create_breakpoint): Add extra_string argument, record it. (dprintf_command): New function. (break_command_1): Add arg to create_breakpoint call. (handle_gnu_v3_exceptions): Ditto. (trace_command): Ditto. (ftrace_command): Ditto. (strace_command): Ditto. (bkpt_print_mention): Add dprintf case. (create_breakpoint_sal_default): Add extra_string argument. (_initialize_breakpoint): Add new commands. * mi/mi-cmd-break.c (mi_cmd_break_insert): Add arg to call. * python/py-breakpoint.c (bppy_init): Ditto. * python/py-finishbreakpoint.c (bpfinishpy_init): Ditto. * gdb.texinfo (Dynamic Printf): New subsection. * gdb.base/dprintf.c: New file. * gdb.base/dprintf.exp: New file.
* 2012-04-27 Sergio Durigan Junior <sergiodj@redhat.com>sergiodj2012-04-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tom Tromey <tromey@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> * Makefile.in (SFILES): Add `probe' and `stap-probe'. (COMMON_OBS): Likewise. (HFILES_NO_SRCDIR): Add `probe'. * NEWS: Mention support for static and SystemTap probes. * amd64-tdep.c (amd64_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * arm-linux-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (arm_stap_is_single_operand): New function. (arm_stap_parse_special_token): Likewise. (arm_linux_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * ax-gdb.c (require_rvalue): Removing static declaration. (gen_expr): Likewise. * ax-gdb.h (gen_expr): Declaring function. (require_rvalue): Likewise. * breakpoint.c: Include `gdb_regex.h' and `probe.h'. (bkpt_probe_breakpoint_ops): New variable. (momentary_breakpoint_from_master): Set the `probe' value. (add_location_to_breakpoint): Likewise. (break_command_1): Using proper breakpoint_ops according to the argument passed by the user in the command line. (bkpt_probe_insert_location): New function. (bkpt_probe_remove_location): Likewise. (bkpt_probe_create_sals_from_address): Likewise. (bkpt_probe_decode_linespec): Likewise. (tracepoint_probe_create_sals_from_address): Likewise. (tracepoint_probe_decode_linespec): Likewise. (tracepoint_probe_breakpoint_ops): New variable. (trace_command): Using proper breakpoint_ops according to the argument passed by the user in the command line. (initialize_breakpoint_ops): Initializing breakpoint_ops for static probes on breakpoints and tracepoints. * breakpoint.h (struct bp_location) <probe>: New field. * cli-utils.c (skip_spaces_const): New function. (extract_arg): Likewise. * cli-utils.h (skip_spaces_const): Likewise. (extract_arg): Likewise. * coffread.c (coff_sym_fns): Add `sym_probe_fns' value. * configure.ac: Append `stap-probe.o' to be generated when ELF support is present. * configure: Regenerate. * dbxread.c (aout_sym_fns): Add `sym_probe_fns' value. * elfread.c: Include `probe.h' and `arch-utils.h'. (probe_key): New variable. (elf_get_probes): New function. (elf_get_probe_argument_count): Likewise. (elf_evaluate_probe_argument): Likewise. (elf_compile_to_ax): Likewise. (elf_symfile_relocate_probe): Likewise. (stap_probe_key_free): Likewise. (elf_probe_fns): New variable. (elf_sym_fns): Add `sym_probe_fns' value. (elf_sym_fns_lazy_psyms): Likewise. (elf_sym_fns_gdb_index): Likewise. (_initialize_elfread): Initialize objfile cache for static probes. * gdb_vecs.h (struct probe): New forward declaration. (probe_p): New VEC declaration. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh (stap_integer_prefix): New variable. (stap_integer_suffix): Likewise. (stap_register_prefix): Likewise. (stap_register_suffix): Likewise. (stap_register_indirection_prefix): Likewise. (stap_register_indirection_suffix): Likewise. (stap_gdb_register_prefix): Likewise. (stap_gdb_register_suffix): Likewise. (stap_is_single_operand): New function. (stap_parse_special_token): Likewise. (struct stap_parse_info): Forward declaration. * i386-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (i386_stap_is_single_operand): New function. (i386_stap_parse_special_token): Likewise. (i386_elf_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * i386-tdep.h (i386_stap_is_single_operand): New function. (i386_stap_parse_special_token): Likewise. * machoread.c (macho_sym_fns): Add `sym_probe_fns' value. * mipsread.c (ecoff_sym_fns): Likewise. * objfiles.c (objfile_relocate1): Support relocation for static probes. * parse.c (prefixify_expression): Remove static declaration. (initialize_expout): Likewise. (reallocate_expout): Likewise. * parser-defs.h (initialize_expout): Declare function. (reallocate_expout): Likewise. (prefixify_expression): Likewise. * ppc-linux-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (ppc_stap_is_single_operand): New function. (ppc_stap_parse_special_token): Likewise. (ppc_linux_init_abi): Initializing proper fields used by SystemTap probes' arguments parser. * probe.c: New file, for generic statically defined probe support. * probe.h: Likewise. * s390-tdep.c: Including headers needed to perform the parsing of SystemTap probes' arguments. (s390_stap_is_single_operand): New function. (s390_gdbarch_init): Initializing proper fields used by SystemTap probes' arguments parser. * somread.c (som_sym_fns): Add `sym_probe_fns' value. * stap-probe.c: New file, for SystemTap probe support. * stap-probe.h: Likewise. * symfile.h: Include `gdb_vecs.h'. (struct sym_probe_fns): New struct. (struct sym_fns) <sym_probe_fns>: New field. * symtab.c (init_sal): Initialize `probe' field. * symtab.h (struct probe): Forward declaration. (struct symtab_and_line) <probe>: New field. * tracepoint.c (start_tracing): Adjust semaphore on breakpoints locations. (stop_tracing): Likewise. * xcoffread.c (xcoff_sym_fns): Add `sym_probe_fns' value.
* gdb:qiyao2012-04-241-0/+4
| | | | | | | | | | | | | | | | | | 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.
* gdb/qiyao2012-04-241-1/+1
| | | | | | | * breakpoint.c (ep_is_catchpoint): Renamed to ... (is_catchpoint): ... it. (print_one_breakpoint_location): Caller update. * breakpoint.h: Update declaration.
* 2012-03-13 Hui Zhu <teawater@gmail.com>Pedro Alves2012-03-131-2/+12
| | | | | | | | | | | | | | | | | | | | | | Pedro Alves <palves@redhat.com> * breakpoint.c (init_breakpoint_sal): New flags parameter. Handle CREATE_BREAKPOINT_FLAGS_INSERTED. (create_breakpoint_sal, create_breakpoints_sal) (base_breakpoint_create_breakpoints_sal) (tracepoint_create_breakpoints_sal) (strace_marker_create_breakpoints_sal): New flags parameter. Pass down. (break_command_1, handle_gnu_v3_exceptions, trace_command) (ftrace_command, strace_command): Adjust. (create_tracepoint_from_upload): Pass CREATE_BREAKPOINT_FLAGS_INSERTED. * breakpoint.h (enum breakpoint_create_flags): New. (create_breakpoint): New flags parameter. * mi/mi-cmd-break.c (mi_cmd_break_insert): Adjust. * python/py-breakpoint.c (bppy_init): Adjust. * python/py-finishbreakpoint.c (bpfinishpy_init): Adjust. * spu-tdep.c (spu_catch_start): Adjust.
* gdb:qiyao2012-03-131-3/+0
| | | | | | | | | | | | | | | | | | | | | * inferior.h (struct inferior): Remove fields any_syscall_count, syscalls_counts and total_syscalls_count. Move them to new struct catch_syscall_inferior_data in breakpoint.c. * breakpoint.c: Call DEF_VEC_I(int). (struct catch_syscall_inferior_data): New. (get_catch_syscall_inferior_data): New. (catch_syscall_inferior_data_cleanup): New. (insert_catch_syscall): Update to access data in struct catch_syscall_inferior_data. (insert_catch_syscall): Likewise. (remove_catch_syscall): Likewise. (remove_catch_syscall): Likewise. (is_syscall_catchpoint_enabled): Likewise. (add_catch_command): Likewise. (_initialize_breakpoint): Register cleanup. * breakpoint.h: Removed DEF_VEC_I(int). * dwarf2loc.c: Call DEF_VEC_I(int). * mi/mi-main.c: Likewise.
* 2012-03-02 Tom Tromey <tromey@redhat.com>Pedro Alves2012-03-021-0/+3
| | | | | | | | | | | | | | | 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.
* 2012-02-24 Luis Machado <lgustavo@codesourcery.com>Luis Machado2012-02-241-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2012-02-14 Stan Shebs <stan@codesourcery.com>Stan Shebs2012-02-141-0/+5
| | | | | | | | | | | | | | | | | | | | * NEWS: Mention enable count command. * breakpoint.h (struct breakpoint): New field enable_count. * breakpoint.c (enable_breakpoint_disp): Add count argument. (enable_breakpoint): Add arg to call. (struct disp_data): New struct. (do_enable_breakpoint_disp): Interp arg as disp_data and unpack. (do_map_enable_once_breakpoint): Create a struct and pass it. (do_map_enable_delete_breakpoint): Ditto. (do_map_enable_count_breakpoint): New function. (enable_count_command): New function. (bpstat_stop_status): Decrement enable_count. (print_one_breakpoint_location): Report enable count. (_initialize_breakpoint): Add enable count command. * gdb.texinfo (Disabling Breakpoints): Document enable count. * gdb.base/ena-dis-br.exp: Add enable count test.
* PR symtab/12406:Tom Tromey2012-01-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2012-01-24 Pedro Alves <palves@redhat.com>Tom Tromey2012-01-241-5/+12
| | | | | | | | | | | | | | | | | | | | | | * breakpoint.c (bpstat_check_location, bpstat_stop_status, pc_at_non_inline_function): Add `ws' parameter, and pass it down. (breakpoint_hit_catch_fork, breakpoint_hit_catch_vfork) (breakpoint_hit_catch_syscall, breakpoint_hit_catch_exec): Add `ws' parameter. (breakpoint_hit_ranged_breakpoint): Add `ws' parameter. Return false for events other than TARGET_SIGNAL_TRAP. (breakpoint_hit_watchpoint, base_breakpoint_breakpoint_hit): Add `ws' parameter. (bkpt_breakpoint_hit): Add `ws' parameter. Return false for events other than TARGET_SIGNAL_TRAP. (tracepoint_breakpoint_hit): Add `ws' parameter. * breakpoint.h (struct breakpoint_ops) <breakpoint_hit>: Add `ws' parameter. (bpstat_stop_status): Same. (pc_at_non_inline_function): Same. * infrun.c (handle_syscall_event, handle_inferior_event): Adjust to pass the current event's waitstatus to bpstat_stop_status and pc_at_non_inline_function.
* 2012-01-16 Sergio Durigan Junior <sergiodj@redhat.com>sergiodj2012-01-161-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Copyright year update in most files of the GDB Project.Joel Brobecker2012-01-041-3/+1
| | | | | | gdb/ChangeLog: Copyright year update in most files of the GDB Project.
* Introduce gdb.FinishBreakpoint in Pythonkpouget2011-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2011-12-06 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-12-061-4/+11
| | | | | | | | | | | | | | | | | | | | | gdb/ * breakpoint.c (breakpoint_restore_shadows): Rename to ... (breakpoint_xfer_memory): ... this. Change prototype. Handle memory writes too. * breakpoint.h (breakpoint_restore_shadows): Delete. (breakpoint_xfer_memory): Declare. * mem-break.c (default_memory_insert_breakpoint) (default_memory_remove_breakpoint): Use target_write_raw_memory. (memory_xfer_partial): Rename to ... (memory_xfer_partial_1): ... this. Don't mask out breakpoints here. (memory_xfer_partial): New. (target_write_raw_memory): New. * target.h (target_write_raw_memory): New. gdb/testsuite/ * gdb.base/break-always.exp: Test changing memory at addresses with breakpoints inserted.
* the "ambiguous linespec" seriesTom Tromey2011-12-061-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdb 2011-12-06 Joel Brobecker <brobecker@acacore.com> * language.h (struct language_defn): Add new component la_symbol_name_compare. * symfile.h (struct quick_symbol_functions): Update the profile of parameter "name_matcher" for the expand_symtabs_matching method. Update the documentation accordingly. * ada-lang.h (ada_name_for_lookup): Add declaration. * ada-lang.c (ada_name_for_lookup): New function, extracted out from ada_iterate_over_symbols. (ada_iterate_over_symbols): Do not encode symbol name anymore. (ada_expand_partial_symbol_name): Adjust profile. (ada_language_defn): Add value for la_symbol_name_compare field. * linespec.c: #include "ada-lang.h". (iterate_name_matcher): Add language parameter. Replace call to strcmp_iw by call to language->la_symbol_name_compare. (decode_variable): Encode COPY if current language is Ada. * dwarf2read.c (dw2_expand_symtabs_matching): Adjust profile of name_matcher parameter. Adjust call to name_matcher. * psymtab.c (expand_symtabs_matching_via_partial): Likewise. (expand_partial_symbol_names): Update profile of parameter "fun". * psymtab.h (expand_partial_symbol_names): Update profile of parameter "fun". * symtab.c (demangle_for_lookup): Update function documentation. (search_symbols_name_matches): Add language parameter. (expand_partial_symbol_name): Likewise. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Add value for la_symbol_name_compare field. * d-lang.c (d_language_defn): Likewise. * f-lang.c (f_language_defn): Ditto. * jv-lang.c (java_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * opencl-lang.c (opencl_language_defn): Ditto. * p-lang.c (pascal_language_defn): Ditto. * language.c (unknown_language_defn, auto_language_defn) (local_language_defn): Ditto. 2011-12-06 Tom Tromey <tromey@redhat.com> * linespec.c (iterate_over_all_matching_symtabs): Use LA_ITERATE_OVER_SYMBOLS. (lookup_prefix_sym, add_matching_symbols_to_info): Likewise. (find_function_symbols, decode_variable): Remove Ada special case. * language.h (struct language_defn) <la_iterate_over_symbols>: New field. (LA_ITERATE_OVER_SYMBOLS): New macro. * language.c (unknown_language_defn, auto_language_defn) (local_language_defn): Update. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Update. * d-lang.c (d_language_defn): Update. * f-lang.c (f_language_defn): Update. * jv-lang.c (java_language_defn): Update. * m2-lang.c (m2_language_defn): Update. * objc-lang.c (objc_language_defn): Update. * opencl-lang.c (opencl_language_defn): Update. * p-lang.c (pascal_language_defn): Update. * ada-lang.c (ada_iterate_over_symbols): New function. (ada_language_defn): Update. 2011-12-06 Tom Tromey <tromey@redhat.com> Joel Brobecker <brobecker@acacore.com> PR breakpoints/13105, PR objc/8341, PR objc/8343, PR objc/8366, PR objc/8535, PR breakpoints/11657, PR breakpoints/11970, PR breakpoints/12023, PR breakpoints/12334, PR breakpoints/12856, PR shlibs/8929, PR shlibs/7393: * python/py-type.c (compare_maybe_null_strings): Rename from compare_strings. (check_types_equal): Update. * utils.c (compare_strings): New function. * tui/tui-winsource.c (tui_update_breakpoint_info): Update for location changes. * tracepoint.c (scope_info): Update. (trace_find_line_command): Use DECODE_LINE_FUNFIRSTLINE. * symtab.h (iterate_over_minimal_symbols) (iterate_over_some_symtabs, iterate_over_symtabs) (find_pcs_for_symtab_line, iterate_over_symbols) (demangle_for_lookup): Declare. (expand_line_sal): Remove. * symtab.c (iterate_over_some_symtabs, iterate_over_symtabs) (lookup_symtab_callback): New functions. (lookup_symtab): Rewrite. (demangle_for_lookup): New function, extract from lookup_symbol_in_language. (lookup_symbol_in_language): Use it. (iterate_over_symbols): New function. (find_line_symtab): Update. (find_pcs_for_symtab_line): New functions. (find_line_common): Add 'start' argument. (decode_line_spec): Update. Change argument to 'flags', change interpretation. (append_expanded_sal): Remove. (append_exact_match_to_sals): Remove. (expand_line_sal): Remove. * symfile.h (struct quick_symbol_functions) <lookup_symtab>: Remove. <map_symtabs_matching_filename>: New field. * stack.c (func_command): Only look in the current program space. Use DECODE_LINE_FUNFIRSTLINE. * source.c (line_info): Set pspace on sal. Check program space in the loop. Use DECODE_LINE_LIST_MODE. (select_source_symtab): Use DECODE_LINE_FUNFIRSTLINE. * solib-target.c: Remove DEF_VEC_I(CORE_ADDR). * python/python.c (gdbpy_decode_line): Update. * psymtab.c (partial_map_expand_apply): New function. (partial_map_symtabs_matching_filename): Rename from lookup_partial_symbol. Update arguments. (lookup_symtab_via_partial_symtab): Remove. (psym_functions): Update. * objc-lang.h (parse_selector, parse_method): Don't declare. (find_imps): Update. * objc-lang.c (parse_selector, parse_method): Now static. (find_methods): Change arguments. Fill in a vector of symbol names. (uniquify_strings): New function. (find_imps): Change arguments. * minsyms.c (iterate_over_minimal_symbols): New function. * linespec.h (enum decode_line_flags): New. (struct linespec_sals): New. (struct linespec_result) <canonical>: Remove. <pre_expanded, addr_string, sals>: New fields. (destroy_linespec_result, make_cleanup_destroy_linespec_result) (decode_line_full): Declare. (decode_line_1): Update. * linespec.c (struct address_entry, struct linespec_state, struct collect_info): New types. (add_sal_to_sals_basic, add_sal_to_sals, hash_address_entry) (eq_address_entry, maybe_add_address): New functions. (total_number_of_methods): Remove. (iterate_name_matcher, iterate_over_all_matching_symtabs): New functions. (find_methods): Change arguments. Don't canonicalize input. Simplify logic. (add_matching_methods, add_constructors) (build_canonical_line_spec): Remove. (filter_results, convert_results_to_lsals): New functions. (decode_line_2): Change arguments. Rewrite for new data structures. (decode_line_internal): Rename from decode_line_1. Change arguments. Add cleanups. Update for new data structures. (linespec_state_constructor, linespec_state_destructor) (decode_line_full, decode_line_1): New functions. (decode_indirect): Change arguments. Update. (locate_first_half): Use skip_spaces. (decode_objc): Change arguments. Update for new data structures. Simplify logic. (decode_compound): Change arguments. Add cleanups. Remove fallback code, replace with error. (struct decode_compound_collector): New type. (collect_one_symbol): New function. (lookup_prefix_sym): Change arguments. Update. (compare_symbol_name, add_all_symbol_names_from_pspace) (find_superclass_methods ): New functions. (find_method): Rewrite. (struct symtab_collector): New type. (add_symtabs_to_list, collect_symtabs_from_filename): New functions. (symtabs_from_filename): Change API. Rename from symtab_from_filename. (collect_function_symbols): New function. (find_function_symbols): Change API. Rename from find_function_symbol. Rewrite. (decode_all_digits): Change arguments. Rewrite. (decode_dollar): Change arguments. Use decode_variable. (decode_label): Change arguments. Rewrite. (collect_symbols): New function. (minsym_found): Change arguments. Rewrite. (check_minsym, search_minsyms_for_name) (add_matching_symbols_to_info): New function. (decode_variable): Change arguments. Iterate over all symbols. (symbol_found): Remove. (symbol_to_sal): New function. (init_linespec_result, destroy_linespec_result) (cleanup_linespec_result, make_cleanup_destroy_linespec_result): New functions. (decode_digits_list_mode, decode_digits_ordinary): New functions. * dwarf2read.c (dw2_map_expand_apply): New function. (dw2_map_symtabs_matching_filename): Rename from dw2_lookup_symtab. Change arguments. (dwarf2_gdb_index_functions): Update. * dwarf2loc.c: Remove DEF_VEC_I(CORE_ADDR). * defs.h (compare_strings): Declare. * cli/cli-cmds.c (compare_strings): Move to utils.c. (edit_command, list_command): Use DECODE_LINE_LIST_MODE. Call filter_sals. (compare_symtabs, filter_sals): New functions. * breakpoint.h (struct bp_location) <line_number, source_file>: New fields. (struct breakpoint) <line_number, source_file>: Remove. <filter>: New field. * breakpoint.c (print_breakpoint_location, init_raw_breakpoint) (momentary_breakpoint_from_master, add_location_to_breakpoint): Update for changes to locations. (init_breakpoint_sal): Add 'filter' argument. Set 'filter' on breakpoint. (create_breakpoint_sal): Add 'filter' argument. (remove_sal, expand_line_sal_maybe): Remove. (create_breakpoints_sal): Remove 'sals' argument. Handle pre-expanded sals and the filter. (parse_breakpoint_sals): Use decode_line_full. (check_fast_tracepoint_sals): Use get_sal_arch. (create_breakpoint): Create a linespec_sals. Update. (break_range_command): Use decode_line_full. Update. (until_break_command): Update. (clear_command): Update match conditions for linespec.c changes. Use DECODE_LINE_LIST_MODE. (say_where): Update for changes to locations. (bp_location_dtor): Free 'source_file'. (base_breakpoint_dtor): Free 'filter'. Don't free 'source_file'. (update_static_tracepoint): Update for changes to locations. (update_breakpoint_locations): Disable ranged breakpoint if too many locations match. Update. (addr_string_to_sals): Use decode_line_full. Resolve all sal PCs. (breakpoint_re_set_default): Don't call expand_line_sal_maybe. (decode_line_spec_1): Update. Change argument name to 'flags', change interpretation. * block.h (block_containing_function): Declare. * block.c (block_containing_function): New function. * skip.c (skip_function_command): Update. (skip_re_set): Update. * infcmd.c (jump_command): Use DECODE_LINE_FUNFIRSTLINE. * mi/mi-main.c (mi_cmd_trace_find): Use DECODE_LINE_FUNFIRSTLINE. * NEWS: Add entry. 2011-12-06 Tom Tromey <tromey@redhat.com> * elfread.c (elf_gnu_ifunc_resolver_return_stop): Allow breakpoint's pspace to be NULL. * breakpoint.h (struct breakpoint) <pspace>: Update comment. * breakpoint.c (init_raw_breakpoint): Conditionally set breakpoint's pspace. (init_breakpoint_sal): Don't set breakpoint's pspace. (prepare_re_set_context): Conditionally switch program space. (addr_string_to_sals): Check executing_startup on location's program space. 2011-12-06 Tom Tromey <tromey@redhat.com> * breakpoint.h (enum enable_state) <bp_startup_disabled>: Remove. * breakpoint.c (should_be_inserted): Explicitly check if program space is executing startup. (describe_other_breakpoints): Update. (disable_breakpoints_before_startup): Change executing_startup earlier. Remove loop. (enable_breakpoints_after_startup): Likewise. (init_breakpoint_sal): Don't use bp_startup_disabled. (create_breakpoint): Don't use bp_startup_disabled. (update_global_location_list): Use should_be_inserted. (bkpt_re_set): Update. gdb/testsuite 2011-12-06 Joel Brobecker <brobecker@acacore.com> * gdb.ada/fullname_bp.exp: Add tests for other valid linespecs involving a fully qualified function name. 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.ada/homonym.exp: Add three breakpoint tests. 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.base/solib-weak.exp (do_test): Remove kfail. * gdb.trace/tracecmd.exp: Disable pending breakpoints earlier. * gdb.objc/objcdecode.exp: Update for output changes. * gdb.linespec/linespec.exp: New file. * gdb.linespec/lspec.cc: New file. * gdb.linespec/lspec.h: New file. * gdb.linespec/body.h: New file. * gdb.linespec/base/two/thefile.cc: New file. * gdb.linespec/base/one/thefile.cc: New file. * gdb.linespec/Makefile.in: New file. * gdb.cp/templates.exp (test_template_breakpoints): Update for output changes. * gdb.cp/re-set-overloaded.exp: Remove kfail. * gdb.cp/ovldbreak.exp: Update for output changes. "all" test now makes one breakpoint. * gdb.cp/method2.exp (test_break): Update for output changes. * gdb.cp/mb-templates.exp: Update for output changes. * gdb.cp/mb-inline.exp: Update for output changes. * gdb.cp/mb-ctor.exp: Update for output changes. * gdb.cp/ovsrch.exp: Use fully-qualified names. * gdb.base/solib-symbol.exp: Run to main later. Breakpoint now has multiple matches. * gdb.base/sepdebug.exp: Disable pending breakpoints. Update for error message change. * gdb.base/list.exp (test_list_filename_and_number): Update for error message change. * gdb.base/break.exp: Disable pending breakpoints. Update for output changes. * configure.ac: Add gdb.linespec. * configure: Rebuild. * Makefile.in (ALL_SUBDIRS): Add gdb.linespec. gdb/doc 2011-12-06 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Set Breaks): Update for new behavior.
* gdbTom Tromey2011-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | PR mi/8444: * mi/mi-common.h (EXEC_ASYNC_SOLIB_EVENT, EXEC_ASYNC_FORK) (EXEC_ASYNC_VFORK, EXEC_ASYNC_SYSCALL_ENTRY) (EXEC_ASYNC_SYSCALL_RETURN, EXEC_ASYNC_EXEC): New constants. * mi/mi-common.c (async_reason_string_lookup): Add new reasons. * breakpoint.c (print_it_catch_fork, print_it_catch_vfork) (print_it_catch_syscall, print_it_catch_exec) (internal_bkpt_print_it): Use ui_out. Emit stop reason. (bpstat_print): Add 'kind' argument. Handle TARGET_WAITKIND_LOADED. * infrun.c (normal_stop): Update for bpstat_print change. Don't handle TARGET_WAITKIND_LOADED here. * breakpoint.h (bpstat_print): Update. gdb/testsuite * lib/mi-support.exp (mi_run_cmd_full): Rename from mi_run_cmd. Add "use_mi_command" argument. (mi_run_cmd, mi_run_with_cli): New procs. * gdb.mi/solib-lib.c: New file. * gdb.mi/solib-main.c: New file. * gdb.mi/mi-solib.exp: New file. gdb/doc * gdb.texinfo (GDB/MI Async Records): Document new *stopped reasons.
* * NEWS: Mention tracepoint additions.Stan Shebs2011-11-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.c (install_breakpoint): Add one more parameter so thatqiyao2011-11-181-2/+4
| | | | | | | | | | | update_global_location_list is called conditionally. (create_fork_vfork_event_catchpoint): Update. (create_syscall_event_catchpoint): Update. (create_breakpoint_sal): Update. (create_breakpoint_sal): Update. Call do_cleanups before install_breakpoint. * ada-lang.c (create_ada_exception_catchpoint): Update. * breakpoint.h (install_breakpoint): Update declaration.
* gdb/qiyao2011-11-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remote.c (struct remote_state): <install_in_trace> new field. (PACKET_InstallInTrace): New enum value. (remote_install_in_trace_feature): Support InstallInTrace. (remote_supports_install_in_trace): Likewise. (remote_protocol_features): Likewise. (_initialize_remote): Likewise. (remote_can_download_tracepoint): New. * target.h (struct target): New field `to_can_download_tracepoint'. (target_can_download_tracepoint): New macro. * target.c (update_current_target): Update. * breakpoint.h (struct bp_location): Add comment on field `duplicate'. (should_be_inserted): Don't differentiate breakpoint and tracepoint. (remove_breakpoints): Don't remove tracepoints. (tracepoint_locations_match ): New. (breakpoint_locations_match): Call it. (disable_breakpoints_in_unloaded_shlib): Handle tracepoint. (download_tracepoint_locations): New. (update_global_location_list): Call it. * tracepoint.c (find_matching_tracepoint): Delete. (find_matching_tracepoint_location): Renamed from find_matching_tracepoint. Return bp_location rather than tracepoint. (merge_uploaded_tracepoints): Set `inserted' field to 1 if tracepoint is found. gdb/doc/ * gdb.texinfo (Create and Delete Tracepoints): Describe changed behavior of tracepoint. (General Query Packets): New feature InstallInTrace. (Remote Configuration): Document "set remote install-in-trace-packet". gdb/gdbserver/ * server.c (handle_query): Handle InstallInTrace for qSupported. * tracepoint.c (add_tracepoint): Sort list. (install_tracepoint, download_tracepoint): New. (cmd_qtdp): Call them to install and download tracepoints. (sort_tracepoints): Removed. (cmd_qtstart): Update. gdb/testsuite/ * gdb.trace/change-loc-1.c: New. * gdb.trace/change-loc-2.c: New. * gdb.trace/change-loc.c: New. * gdb.trace/change-loc.exp: New. * gdb.trace/change-loc.h: New. * gdb.trace/trace-break.c (marker): Define new symbol. * gdb.trace/trace-break.exp (break_trace_same_addr_5): New. (break_trace_same_addr_6): New.
* 2011-10-06 Justin Lebar <justin.lebar@gmail.com>jlebar2011-11-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.in: (SFILES): Add skip.c. (HFILES_NO_SRCDIR): Add skip.h. (COMMON_OBS): Add skip.o. * skip.h, skip.c: New. * breakpoint.h (set_default_breakpoint): Remove. (get_sal_arch): Declare. * breakpoint.c: Remove default_breakpoint_valid, default_breakpoint_address, default_breakpoint_symtab, default_breakpoint_line, default_breakpoint_pspace variables. (get_sal_arch): Make public. (set_default_breakpoint): Remove. (parse_breakpoint_sals, create_breakpoint, clear_command, decode_line_spec_1): Remove uses of default_breakpoint variables; replaced with function calls into stack.c. * cli/cli-cmds.h: Add cmd_list_element *skiplist. * cli/cli-cmds.c: Add skiplist. (init_cmd_lists): Initialize skiplist. (init_cli_cmds): Fix comment (classes of commands appear in alphabetical order). * infrun.c (handle_inferior_event): Add check that we don't step into a function whose pc is marked for skip. * stack.c: Declare last_displayed_sal_valid, last_displayed_pspace, last_displayed_addr, last_displayed_symtab, last_displayed_line variables. (set_last_displayed_sal): New static function. (print_frame_info): Switch call to set_default_breakpoint to call to set_last_displayed_sal. (clear_last_displayed_sal, last_displayed_sal_is_valid, get_last_displayed_pspace, get_last_displayed_addr, get_last_displayed_symtab, get_last_displayed_line, get_last_displayed_sal): New public functions. * stack.h (clear_last_displayed_sal, last_displayed_sal_is_valid, get_last_displayed_pspace, get_last_displayed_addr, get_last_displayed_symtab, get_last_displayed_line, get_last_displayed_sal): Declare. 2011-10-06 Justin Lebar <justin.lebar@gmail.com> Add tests for skip command. * testsuite/gdb.base/skip-solib-lib.c: New * testsuite/gdb.base/skip-solib-main.c: New * testsuite/gdb.base/skip-solib.exp: New * testsuite/gdb.base/skip.c: New * testsuite/gdb.base/skip.exp: New * testsuite/gdb.base/skip1.c: New * testsuite/gdb.base/Makefile.in: Adding new files.
* 2011-10-12 Gary Benson <gbenson@redhat.com>gary2011-10-121-0/+6
| | | | | | | | * 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.
* gdb/Jan Kratochvil2011-08-261-2/+3
| | | | | | | | | | | 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.
* gdb/Jan Kratochvil2011-08-211-4/+0
| | | | | | | | | | | | 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.
* * ada-lang.c (ada_exception_breakpoint_ops): Make return typeTom Tromey2011-07-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | const. (ada_exception_sal): Make 'ops' const. (ada_decode_exception_location): Likewise. (ada_decode_assert_location): Likewise. (catch_assert_command): Update. (catch_ada_exception_command): Update. (create_ada_exception_catchpoint): Make 'ops' const. * breakpoint.c (set_raw_breakpoint_without_location) (set_raw_breakpoint, momentary_breakpoint_from_master): Make 'ops' const. (create_internal_breakpoint): Update. (init_raw_breakpoint_without_location): Make 'ops' const. (init_raw_breakpoint, init_catchpoint) (create_fork_vfork_event_catchpoint) (create_syscall_event_catchpoint, init_breakpoint_sal) (create_breakpoint_sal, create_breakpoints_sal) (create_breakpoint, init_ada_exception_breakpoint): Likewise. * breakpoint.h (struct breakpoint) <ops>: Now const. (init_ada_exception_breakpoint, create_breakpoint): Make 'ops' const.
* 2011-07-25 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-07-251-26/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdb/ * breakpoint.h (print_recreate_thread): Declare. (struct breakpoint): Move step_count, pass_count, number_on_target, static_trace_marker_id, static_trace_marker_id_idx ... (struct tracepoint): ... to this new struct. (get_tracepoint, get_tracepoint_by_number_on_target) (get_tracepoint_by_number): Change return type to struct tracepoint pointer. * breakpoint.c (is_tracepoint_type): New, factored out from is_tracepoint. (is_tracepoint): Adjust. (print_one_breakpoint_location): Cast to struct tracepoint as necessary, and adjust. (print_recreate_catch_fork, print_recreate_catch_vfork) (print_recreate_catch_syscall, print_recreate_catch_exec): Call print_recreate_thread. (init_breakpoint_sal): New, factored out from create_breakpoint_sal. (create_breakpoint_sal): Reimplement. (create_breakpoint): Allocate a struct tracecepoint if the caller wanted a tracepoint. Use init_breakpoint_sal and install_breakpoint. (print_recreate_ranged_breakpoint, print_recreate_watchpoint) (print_recreate_masked_watchpoint) (print_recreate_exception_catchpoint): Call print_recreate_thread. (tracepoint_print_one_detail): Adjust. (tracepoint_print_recreate): Adjust. Call print_recreate_thread. Dump the pass count here. (update_static_tracepoint): Adjust. (addr_string_to_sals): Adjust. (create_tracepoint_from_upload): Adjust. Change return type to struct tracepoint pointer. (trace_pass_set_count): Change parameter type to struct tracepoint pointer, and adjust. (trace_pass_command): Adjust. (get_tracepoint, get_tracepoint_by_number_on_target) (get_tracepoint_by_number): Change return type to struct tracepoint pointer, and adjust. (print_recreate_thread): New, factored out from save_breakpoints. (save_breakpoints): Don't print thread and task and passcount recreation here. * remote.c (remote_download_tracepoint): Adjust. * tracepoint.c (trace_actions_command, validate_actionline) (start_tracing, tfind_1, trace_find_tracepoint_command) (trace_dump_command): Adjust. (find_matching_tracepoint): Change return type to struct tracepoint pointer, and adjust. (merge_uploaded_tracepoints, tfile_get_traceframe_address) (tfile_trace_find, tfile_fetch_registers): Adjust. * tracepoint.h (create_tracepoint_from_upload): Change return type to struct tracepoint pointer. * ada-lang.c (print_recreate_exception): Call print_recreate_thread. * mi/mi-cmd-break.c (mi_cmd_break_passcount): Adjust.
* 2011-07-25 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-07-251-46/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdb/ * breakpoint.h (struct breakpoint): Move ops as first field. Move exp_string, exp_string_reparse, exp, exp_valid_block, cond_exp, cond_exp_valid_block, val, val_valid, watchpoint_frame, watchpoint_thread, watchpoint_triggered ... (struct watchpoint): ... to this new struct. (is_watchpoint): Declare. (install_breakpoint): Add new `internal' parameter. * breakpoint.c (is_watchpoint): Delete declaration. (set_breakpoint_condition): Handle watchpoints. (is_watchpoint): Make public. (watchpoint_in_thread_scope): Change parameter type to struct watchpoint. (watchpoint_del_at_next_stop): Change parameter type to struct watchpoint. Remove assertion. Adjust. (update_watchpoint): Ditto. (insert_breakpoints, breakpoint_init_inferior) (watchpoints_triggered, watchpoint_check) (bpstat_check_watchpoint, bpstat_check_breakpoint_conditions) (bpstat_stop_status, print_one_breakpoint_location) (print_one_breakpoint_location, watchpoint_locations_match): Cast to struct watchpoint as necessary, and adjust. (install_breakpoint): Add `internal' argument. If true, don't mention the new breakpoint. Use set_breakpoint_number. (create_fork_vfork_event_catchpoint) (create_syscall_event_catchpoint): Adjust. (dtor_watchpoint): New. (re_set_watchpoint, insert_watchpoint, remove_watchpoint) (breakpoint_hit_watchpoint, resources_needed_watchpoint) (print_it_watchpoint, print_mention_watchpoint) (print_recreate_watchpoint, insert_masked_watchpoint) (remove_masked_watchpoint, resources_needed_masked_watchpoint) (print_one_detail_masked_watchpoint) (print_mention_masked_watchpoint) (print_recreate_masked_watchpoint): Cast to struct watchpoint as necessary, and adjust. (watch_command_1): Allocate and initialize a struct watchpoint instead of a struct breakpoint. Use install_breakpoint. (catch_exec_command_1): Adjust. (base_breakpoint_dtor): Delete accesses to watchpoint specific fields. (delete_breakpoint, enable_breakpoint_disp) (invalidate_bp_value_on_memory_change): Cast to struct watchpoint as necessary, and adjust. (initialize_breakpoint_ops): Install dtor_watchpoint as watchpoints' dtor method. * ada-lang.c (create_ada_exception_catchpoint): Adjust. * python/py-breakpoint.c (bppy_get_expression): Use is_watchpoint. to struct watchpoint as necessary, and adjust.
* 2011-07-25 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-07-251-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ada-lang.c (dtor_exception, re_set_exception): Indirect through the the base class ops table. (catch_exception_breakpoint_ops) (catch_exception_unhandled_breakpoint_ops) (catch_assert_breakpoint_ops): Don't statically initialize. (initialize_ada_catchpoint_ops): New. (_initialize_ada_language): Call it. * breakpoint.c (base_breakpoint_ops, bkpt_base_breakpoint_ops) (bkpt_breakpoint_ops): Forward declare. (catch_fork_breakpoint_ops, catch_vfork_breakpoint_ops) (catch_syscall_breakpoint_ops, catch_exec_breakpoint_ops) (ranged_breakpoint_ops, watchpoint_breakpoint_ops) (masked_watchpoint_breakpoint_ops) (gnu_v3_exception_catchpoint_ops): Don't statically initialize. (dtor_catch_syscall, dtor_catch_exec): Indirect through the the base class ops table. (null_re_set, null_check_status, null_works_in_software_mode) (null_resources_needed, null_print_one_detail): Delete. (bkpt_dtor): Rename to ... (base_breakpoint_dtor): ... this. Make static. (bkpt_allocate_location): Rename to ... (base_breakpoint_allocate_location): ... this. Make static. (base_breakpoint_re_set): New. (internal_error_pure_virtual_called): New. (base_breakpoint_insert_location, base_breakpoint_remove_location) (base_breakpoint_breakpoint_hit, base_breakpoint_check_status) (base_breakpoint_works_in_software_mode) (base_breakpoint_resources_needed, base_breakpoint_print_it) (base_breakpoint_print_one_detail, base_breakpoint_print_mention) (base_breakpoint_print_recreate): New functions. (base_breakpoint_ops): New global. (bkpt_re_set, bkpt_insert_location, bkpt_remove_location) (bkpt_breakpoint_hit): Make static. (bkpt_check_status): Delete. (bkpt_resources_needed): Make static. (bkpt_works_in_software_mode): Delete. (bkpt_print_it, bkpt_print_mention, bkpt_print_recreate): Make static. (bkpt_breakpoint_ops, internal_breakpoint_ops) (momentary_breakpoint_ops): Don't statically initialize. (internal_bkpt_print_recreate, momentary_bkpt_print_recreate): Delete. (tracepoint_insert_location, tracepoint_remove_location) (tracepoint_check_status, tracepoint_works_in_software_mode) (tracepoint_print_it): Delete. (tracepoint_breakpoint_ops): Don't statically initialize. (initialize_breakpoint_ops): New. (_initialize_breakpoint): Call it. * breakpoint.h (null_re_set, null_works_in_software_mode) (null_resources_needed, null_check_status, null_print_one_detail): (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): Delete declarations. (initialize_breakpoint_ops): Declare.
* 2011-07-25 Pedro Alves <pedro@codesourcery.com>Pedro Alves2011-07-251-9/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.