aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
AgeCommit message (Collapse)AuthorFilesLines
2011-12-06the "ambiguous linespec" seriesTom Tromey2-7/+9
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.
2011-12-06 * python/lib/gdb/command/pretty_printers.pyTom Tromey1-1/+1
(InfoPrettyPrinter.invoke1): Remove extra double quote.
2011-12-02 * python/py-type.c (type_object_methods): Fix "array" doc string.Doug Evans1-2/+4
2011-11-282011-11-28 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon6-21/+43
PR python/13369 PR python/13374 * python/python.c (gdbpy_decode_line): Do not acquire GIL. * python/py-inferior.c (inferior_to_inferior_object): Ditto. * python/py-value.c (valpy_nonzero): Use TRY_CATCH to catch GDB exceptions. * python/py-type.c (typy_strip_typedefs): Ditto. (typy_legacy_template_argument): Ditto. * python/py-inferior.c (inferior_to_inferior_object): Ditto. * python/py-breakpoint.c (bppy_set_ignore_count): Ditto.
2011-11-15* python/py-type.c (typy_get_composite): New function.Paul Koning1-29/+126
(typy_nonzero): New function. (typy_values): Rename from typy_fields. (typy_fields): New function. (typy_length): Raise exception if not struct, union, or enum type. (typy_getitem): Ditto. (typy_has_key): Ditto. (typy_make_iter): Ditto.
2011-11-10 * python/py-type.c (typy_fields_items): Call check_typedef.Doug Evans1-7/+26
testsuite/ * gdb.python/py-type.c (TS): New typedef. (ts): New global. * gdb.python/py-type.exp: Test field list of typedef.
2011-11-042011-11-04 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-4/+14
PR Python/13345 * python/python.c (python_run_simple_file): Expand tilde in path.
2011-11-042011-11-04 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-8/+21
PR Python/13363 * python/py-type.c (typy_lookup_type): Do not return a type in an exception handler.
2011-10-28* python/lib/gdb/types.py (deep_items): Rename from deepitems.Paul Koning1-2/+2
* NEWS: Mention deep_items.
2011-10-27 * cli/cli-cmds.c (source_script_with_search): Pass full path toDoug Evans4-20/+14
source_script_from_stream if it may have been found on the search path. * python/py-auto-load.c (source_section_scripts): Pass full path to source_python_script_for_objfile. * python/python.c (source_python_script): Delete stream parameter. All callers updated. (source_python_script_for_objfile): Ditto. * python/python-internal.h (source_python_script_for_objfile): Update. * python/python.h (source_python_script): Update. testsuite/ * gdb.python/python.exp: Test source -s.
2011-10-27Move unwind reasons to an external .def fileKevin Pouget1-13/+8
gdb/ * frame.c (frame_stop_reason_string): Rewrite using unwind_stop_reasons.def. * frame.h (enum unwind_stop_reason): Likewise. * python/py-frame.c (gdbpy_initialize_frames): Likewise. (gdbpy_frame_stop_reason_string): Use new enum unwind_stop_reason constants for bound-checking. * unwind_stop_reasons.def: New file. * stack.c (backtrace_command_1): Handle UNWIND_FIRST_ERROR as an alias instead of a distinct value. doc/ * gdb.texinfo ((Frames In Python): Document gdb.FRAME_UNWIND_FIRST_ERROR contant.
2011-10-272011-10-27 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-9/+23
PR python/13331 * python/py-function.c (fnpy_call): Check 'args' is not NULL. (convert_values_to_python): Return on Python tuple allocation failure. Return NULL on value conversion error.
2011-10-272011-10-27 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon5-50/+118
* python/py-breakpoint.c (bppy_set_enabled): Use TRY_CATCH. (bppy_set_task): Ditto. (bppy_delete_breakpoint): Ditto. * python/py-symbol.c (gdbpy_lookup_symbol): Ditto. (gdbpy_lookup_global_symbol): Ditto. * python/py-lazy-string.c (stpy_convert_to_value): Ditto. * python/py-frame.c (frapy_is_valid): Ditto. (frame_info_to_frame_object): Ditto. * python/py-type.c (typy_lookup_type): Ditto. (typy_getitem): Ditto. (typy_has_key): Ditto. (typy_richcompare): Use TRY_CATCH. Do not return Py_NE on error.
2011-10-26* python/lib/gdb/types.py (deepitems): New function.Paul Koning1-0/+20
2011-10-25PR python/13327Paul Koning1-8/+43
* python/py-value.c (value_to_value_object): Remove fetching of the value if it was lazy. (valpy_get_is_lazy): New function. (valpy_fetch_lazy): New function.
2011-10-242011-10-24 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-0/+2
PR python/13310 * python/py-param.c (call_doc_function): Correctly deference on function exit.
2011-10-202011-10-20 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon2-6/+10
PR python/13308 PR python/13309 * python/py-breakpoint.c (gdbpy_breakpoints): Fix List reference leak. * python/py-inferior.c (gdbpy_inferiors): Fix List reference leak. Delete unused variables.
2011-10-202011-10-20 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon5-20/+100
PR python/12656 * python/py-frame.c (frapy_read_var): Use const struct *block. * python/py-type.c (typy_lookup_typename): Likewise. (typy_lookup_type): Likewise. (typy_legacy_template_argument): Likewise. (typy_template_argument): Likewise. (gdbpy_lookup_type): Likewise. * python/py-symbol.c (gdbpy_lookup_symbol): Likewise. * python/py-block.c (blpy_block_object): Likewise. (blpy_iter): Likewise. (blpy_get_start): Likewise. (blpy_get_end): Likewise. (blpy_get_function): Likewise. (blpy_get_superblock): Likewise. (set_block): Likewise. (block_to_block_object): Likewise. (block_object_to_block): Likewise. (blpy_is_valid): Likewise. (blpy_get_global_block): New function. (blpy_get_static_block): New function. (blpy_is_global): New function. (blpy_is_static): New function. * blockframe.c (block_innermost_frame): Likewise. * valops.c (value_of_variable): Likewise. * frame.h: Update prototypes. * python/python-internal.h: Likewise. * value.h: Likewise. 2011-10-20 Phil Muldoon <pmuldoon@redhat.com> PR python/12656 * gdb.texinfo (Blocks In Python): Document is_static, is_global, global_block, static_block function. 2011-10-20 Phil Muldoon <pmuldoon@redhat.com> PR python/12656 * gdb.python/py-block.exp: Add is_global, is_static, static_block, global_block tests.
2011-10-13 * python/py-breakpoint.c (gdbpy_breakpoint_deleted): Ensure GIL isTom Tromey1-8/+8
always released.
2011-10-13 * python/py-type.c (typy_has_key): Make 'field' const.Tom Tromey1-1/+1
2011-10-09gdb/Jan Kratochvil1-0/+1
Recognize virtual tail call frames. * Makefile.in (SFILES): Add dwarf2-frame-tailcall.c. (HFILES_NO_SRCDIR): Add dwarf2-frame-tailcall.h. (COMMON_OBS): Add dwarf2-frame-tailcall.o. * dwarf2-frame-tailcall.c: New file. * dwarf2-frame-tailcall.h: New file. * dwarf2-frame.c: Include dwarf2-frame-tailcall.h. (execute_cfa_program): New function comment. Return INSN_PTR. Reset REGS.PREV only after CIE execution. (struct dwarf2_frame_cache): New field tailcall_cache. (dwarf2_frame_cache): New variables entry_pc, entry_cfa_sp_offset, entry_cfa_sp_offset_p and instr. Execute FDE instructions in two parts, try to find entry_cfa_sp_offset. Call dwarf2_tailcall_sniffer_first. (dwarf2_frame_prev_register): Call dwarf2_tailcall_prev_register_first when appropriate. (dwarf2_frame_dealloc_cache): New function. (dwarf2_frame_sniffer): Preinitialize cache by dwarf2_frame_cache. (dwarf2_frame_unwind): Install dwarf2_frame_dealloc_cache. (dwarf2_signal_frame_unwind): Do not install dwarf2_frame_dealloc_cache. (dwarf2_append_unwinders): Add dwarf2_tailcall_frame_unwind. (dwarf2_frame_cfa): Support also dwarf2_tailcall_frame_unwind. * dwarf2loc.c (func_addr_to_tail_call_list) (tailcall_dump, call_sitep, VEC (call_sitep), chain_candidate) (call_site_find_chain_1, call_site_find_chain): New. * dwarf2loc.h (struct call_site_chain): New. (call_site_find_chain): New declaration. * frame.c (get_frame_address_in_block): Support also TAILCALL_FRAME. * frame.h (enum frame_type): New entry TAILCALL_FRAME. * python/py-frame.c (gdbpy_initialize_frames): Add TAILCALL_FRAME. * stack.c (frame_info): Support also TAILCALL_FRAME. gdb/doc/ Recognize virtual tail call frames. * gdb.texinfo (Optimized Code): Add reference to Tail Call Frames. (Tail Call Frames): New node. (Frames In Python): Add gdb.TAILCALL_FRAME. gdb/testsuite/ Recognize virtual tail call frames. * gdb.arch/amd64-entry-value.cc (c, a, b, amb_z, amb_y, amb_x, amb) (amb_b, amb_a): New. (main): Call a and b. * gdb.arch/amd64-entry-value.exp (tailcall: breakhere, tailcall: bt) (tailcall: p i, tailcall: p j, set $sp0=$sp, up, p $sp0 == $sp, frame 3) (p $sp0 + sizeof (void *) == $sp, ambiguous: breakhere, ambiguous: bt): New tests.
2011-10-09gdb/Jan Kratochvil1-0/+17
Implement basic support for DW_TAG_GNU_call_site. * block.c: Include gdbtypes.h and exceptions.h. (call_site_for_pc): New function. * block.h (call_site_for_pc): New declaration. * defs.h: Include hashtab.h. (make_cleanup_htab_delete, core_addr_hash, core_addr_eq): New declarations. * dwarf2-frame.c (dwarf2_frame_ctx_funcs): Install ctx_no_push_dwarf_reg_entry_value. * dwarf2expr.c (read_uleb128, read_sleb128): Support R as NULL. (dwarf_block_to_dwarf_reg): New function. (execute_stack_op) <DW_OP_GNU_entry_value>: Implement it. (ctx_no_push_dwarf_reg_entry_value): New function. * dwarf2expr.h (struct dwarf_expr_context_funcs): New field push_dwarf_reg_entry_value. (ctx_no_push_dwarf_reg_entry_value, dwarf_block_to_dwarf_reg): New declarations. * dwarf2loc.c: Include gdbcmd.h. (dwarf_expr_ctx_funcs): New forward declaration. (entry_values_debug, show_entry_values_debug, call_site_to_target_addr) (dwarf_expr_reg_to_entry_parameter) (dwarf_expr_push_dwarf_reg_entry_value): New. (dwarf_expr_ctx_funcs): Install dwarf_expr_push_dwarf_reg_entry_value. (dwarf2_evaluate_loc_desc_full): Handle NO_ENTRY_VALUE_ERROR. (needs_dwarf_reg_entry_value): New function. (needs_frame_ctx_funcs): Install it. (_initialize_dwarf2loc): New function. * dwarf2loc.h (entry_values_debug): New declaration. * dwarf2read.c (struct dwarf2_cu): New field call_site_htab. (read_call_site_scope): New forward declaration. (process_full_comp_unit): Copy call_site_htab. (process_die): Support DW_TAG_GNU_call_site. (read_call_site_scope): New function. (dwarf2_get_pc_bounds): Support NULL HIGHPC. (dwarf_tag_name): Support DW_TAG_GNU_call_site. (cleanup_htab): Delete. (write_psymtabs_to_index): Use make_cleanup_htab_delete instead of it. * exceptions.h (enum errors): New NO_ENTRY_VALUE_ERROR. * gdb-gdb.py (StructMainTypePrettyPrinter): Support FIELD_LOC_KIND_DWARF_BLOCK. * gdbtypes.h (enum field_loc_kind): New entry FIELD_LOC_KIND_DWARF_BLOCK. (struct main_type): New loc entry dwarf_block. (struct call_site, FIELD_DWARF_BLOCK, SET_FIELD_DWARF_BLOCK) (TYPE_FIELD_DWARF_BLOCK): New. * python/py-type.c: Include dwarf2loc.h. (check_types_equal): Support FIELD_LOC_KIND_DWARF_BLOCK. New internal_error call on unknown FIELD_LOC_KIND. * symtab.h (struct symtab): New field call_site_htab. * utils.c (do_htab_delete_cleanup, make_cleanup_htab_delete) (core_addr_hash, core_addr_eq): New functions. gdb/testsuite/ Implement basic support for DW_TAG_GNU_call_site. * gdb.arch/Makefile.in (EXECUTABLES): Add amd64-entry-value. * gdb.arch/amd64-entry-value.cc: New file. * gdb.arch/amd64-entry-value.exp: New file.
2011-10-07 * python/lib/gdb/printing.py (register_pretty_printer): New argumentDoug Evans1-5/+13
`replace'. testsuite/ * gdb.python/py-pp-maint.py: Add tests for `replace' arg.
2011-10-07 * python/lib/gdb/printing.py: Whitespace cleanup.Doug Evans1-9/+11
2011-10-07 * python/py-value.c (valpy_call): Initialize ftype to avoid compilerDoug Evans1-1/+1
warning.
2011-10-072011-10-07 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-42/+78
PR python/13624 * python/py-value.c (valpy_call): Check that arguments are a tuple. (is_intlike): Remove call to CHECK_TYPEDEF. (valpy_nonzero): Catch GDB exceptions. (valpy_absolute): Ditto. (valpy_lazy_string): Ditto. (valpy_call): Ditto. (valpy_get_is_optimized_out): Ditto. (valpy_long): Ditto. (valpy_float): Ditto. (valpy_int): Call CHECK_TYPEDEF. Catch GDB exceptions. (valpy_richcompare): Ditto.
2011-10-07Add missing files to previous commit (Allow Python notification of new ↵Kevin Pouget1-0/+70
object-file loadings.)
2011-10-07 Allow Python notification of new object-file loadings.Kevin Pouget6-0/+28
* Makefile.in (SUBDIR_PYTHON_SRCS): Add py-newobjfilevent.c. (SUBDIR_PYTHON_OBS): Add py-newobjfileevent.o. Add build rule for this file. * python/py-event.h (emit_new_objfile_event): New prototype. (newobjfile): New Python event emitter. * python/py-evts.c (gdbpy_initialize_py_events): Add new_objfile to Python event registry. * python/py-inferior.c: Include objfiles.h (python_new_objfile): New function. (gdbpy_initialize_inferior): Add python_new_objfile to the new objfile observers. * python/py-newobjfileevent.c: New file. * python-internal.h (gdbpy_initialize_new_objfile_event): New prototype. * python/python.c (_initialize_python): Add gdbpy_initialize_new_objfile_event call. * NEWS: Add item for new Python event "gdb.newobjfile" 2011-10-06 Kevin Pouget <kevin.pouget@st.com> Allow Python notification of new object-file loadings. * gdb.texinfo (Events In Python): Document `gdb.NewObjFileEvent' event type. 2011-10-06 Kevin Pouget <kevin.pouget@st.com> Allow Python notification of new object-file loadings. * gdb.python/py-events.exp: Test newobjfile event. * gdb.python/py-events.py: Register newobjfile callback. * gdb.python/py-events.c: Add call to shared library * gdb.python/py-events-shlib.c: New file.
2011-10-04* python/py-type.c (typy_make_iter): Add forward declaration.Paul Koning1-32/+10
(typy_fields_items): Use the gdb.Type iterator.
2011-10-042011-10-04 Kevin Pouget <kevin.pouget@st.com>Kevin Pouget3-5/+12
PR python/12691: Add the inferior to Python exited event * python/py-exitedevent.c (create_exited_event_object): Add inferior to exited_event. * python/py-event.h (emit_exited_event): Likewise * python/-inferior.c (python_inferior_exit): Likewise 2011-10-04 Kevin Pouget <kevin.pouget@st.com> PR python/12691: Add the inferior to Python exited event * gdb.python/py-events.exp: Test the inferior attribute of exited event with a fork. * gdb.python/py-events.py: Print inferior number on exit. * gdb.python/py-events.c: Fork the inferior. 2011-10-04 Kevin Pouget <kevin.pouget@st.com> PR python/12691: Add the inferior to Python exited event * gdb.texinfo (Events In Python): Describe exited inferior attribute.
2011-10-03Crash sourcing Python script on WindowsJoel Brobecker1-2/+41
gdb/ChangeLog: * python/python.c (python_run_simple_file): New function. (source_python_script, source_python_script_for_objfile): Replace call to PyRun_SimpleFile by call to python_run_simple_file.
2011-10-03* python/py-value.c (valpy_get_address): Use Py_XINCREF.Paul Koning1-1/+9
(value_to_value_object): Fetch value if it was lazy.
2011-09-28* python/py-type.c (make_fielditem, typy_field_names, typy_items)Paul Koning2-24/+398
(typy_length, typy_get, typy_has_key, typy_make_iter) (typy_iterkeys, typy_iteritems, typy_itervalues, typy_iter) (typy_iterator_iter, typy_iterator_iternext) (typy_iterator_dealloc): New functions to implement standard Python mapping methods on gdb.Type object. (gdb.TypeIterator): New Python type. * python/python-internal.h (gdbpy_iter_kind): New enum. * doc/gdb.texinfo (gdb.Type): Document field access by dictionary key syntax.
2011-09-19 * python/py-auto-load.c (source_section_scripts): Fix fileDoug Evans2-11/+12
descriptor leak. * python/python.c (source_python_script_for_objfile): Tweak comments.
2011-09-15* python/py-cmd.c (gdbpy_string_to_argv): Decrement referencePaul Koning2-4/+3
count of item appended to list. * python/py-type.c (typy_fields): Likewise.
2011-09-152011-09-15 Kevin Pouget <kevin.pouget@st.com>Kevin Pouget3-0/+18
PR Python/12692 Add gdb.selected_inferior() to Python interface. * python/py-inferior.c (GdbMethods): New Python method definition. doc: PR Python/12692 Add gdb.selected_inferior() to Python interface. * gdb.texinfo (Inferiors In Python): Describe new gdb.selected_inferior() function. testsuite: PR Python/12692 Add gdb.selected_inferior() to Python interface. * gdb.python/py-inferior.exp: Add testcase for gdb.selected_inferior().
2011-09-152011-09-15 Kevin Pouget <kevin.pouget@st.com>Kevin Pouget3-12/+42
Handle multiple breakpoint hits in Python interface: * python/py-bpevent.c (create_breakpoint_event_object): Rename C/Python variable to breakpoints. * python/py-stopevent.c (emit_stop_event): Return a Python tuple of bps instead of single breakpoint. Fix some space typos. * python/py-stopevent.c (create_breakpoint_event_object): Rename variable to breakpoints. testsuite: * gdb.python/py-events.exp: Set a duplicate breakpoint and check its presence. * gdb.python/py-events.py (breakpoint_stop_handler): Browse all the breakpoint hits. doc: * gdb.texinfo (Events In Python): New function documentation: gdb.BreakpointEvent.breakpoints. Indicate that gdb.BreakpointEvent.breakpoint is now deprecated.
2011-09-08 * py-cmd.c: Some minor formatting fixes.Doug Evans3-31/+23
(gdbpy_parse_command_name): Rename text arg to name, make const. All callers updated. * python-internal.h (gdbpy_parse_command_name): Update.
2011-09-08gdb/Jan Kratochvil1-8/+0
* findvar.c (read_var_value): Never return NULL, throw an error instead. Update the function comment. State symbol name in the error messages. * python/py-frame.c (frapy_read_var): Remove handling of NULL from read_var_value. * stack.c (print_frame_args): Likewise. * valops.c (value_of_variable): Likewise.
2011-09-062011-09-06 Pedro Alves <pedro@codesourcery.com>Pedro Alves1-1/+1
* event-top.h (MAXPROMPTS, struct prompts): Delete. (set_async_annotation_level, set_async_prompt, pop_prompt) (push_prompt, new_async_prompt): Delete declarations. * top.h (get_prompt, set_prompt): Change prototype. (get_prefix, set_prefix, get_suffix, set_suffix): Delete declarations. * top.c (command_loop): (top_prompt): New global. (get_prefix, set_prefix, get_suffix, ): Delete. (get_prompt, set_prompt): Rewrite. (show_new_async_prompt): Rename to ... (show_prompt): ... this. (init_main): Adjust. Don't handle --annotate=2 here. * event-top.c (new_async_prompt): Delete. (the_prompts): Delete. (more_to_come): Make static. (display_gdb_prompt): Use top_level_prompt() to compute the top level prompt, and don't notify the before_prompt observers directly here. Always trick readline into not trying to display the prompt if sync_execution and displaying the primary prompt. If displaying a local/secondary prompt, always show it, even if sync_execution is set. (change_annotation_level): Delete. (top_level_prompt): New, based on change_annotation_level. (push_prompt, pop_prompt): Delete. (async_disable_stdin): No longer pushes prompt. (command_line_handler): No longer pushes or pops prompt. If more input is expected, call display_gdb_prompt with an explicit empty prompt. (async_stop_sig): Adjust. (set_async_annotation_level, set_async_prompt): Delete. * python/python.c (before_prompt_hook): Adjust.
2011-09-022011-09-02 Pedro Alves <pedro@codesourcery.com>Pedro Alves1-0/+8
* top.c: Include interps.h. (execute_command): If the target can async, but the interpreter is in sync mode, synchronously wait for the command to finish before returning. (execute_command_to_string): Force the interpreter to sync mode. * infrun.c: Include interps.h. (fetch_inferior_event): Don't restore the prompt yet if the interpreter is in sync mode. * interps.c (interpreter_async): New global. * interps.h (interpreter_async): Declare. * inf-loop.c: Include interps.h. (inferior_event_handler): Don't print the language change or run breakpoint commands yet if the interpreter in is sync mode. * main.c (captured_command_loop): Flip the interpreter to async mode. * cli/cli-script.c: Include interps.h. (execute_user_command, while_command, if_command): Force the interpreter to sync mode. * python/python.c: Include interps.h. (python_command, execute_gdb_command): Force the interpreter to sync mode.
2011-08-18 PR c++/12266Keith Seitz1-2/+9
* cp-name-parser.y (struct demangle_info): Remove unused member PREV. (d_grab): Likewise. (allocate_info): Change return type to struct demangle_info *. Always allocate a new demangle_info. Remove unused PREV pointer. (cp_new_demangle_parse_info): New function. (cp_demangled_name_parse_free): New function. (do_demangled_name_parse_free_cleanup): New function. (make_cleanup_cp_demangled_name_parse_free): New function. (cp_demangled_name_to_comp): Change return type to struct demangle_parse_info *. Allocate a new storage for each call. (main): Update usage for cp_demangled_name_to_comp API change. * cp-support.h (struct demangle_parse_info): New structure. (cp_demangled_name_to_comp): Update API change for return type. (cp_new_demangle_parse_info): Declare. (make_cleanup_cp_demangled_name_parse_free): New declaration. (cp_demangled_name_parse_free): Declare. * cp-support.c (cp_canonicalize_string): Update API change for cp_demangled_name_to_comp. (mangled_name_to_comp): Likewise. Return struct demangle_parse_info, too. (cp_class_name_from_physname): Update mangled_name_to_comp API change. (method_name_from_physname): Likewise. (cp_func_name): Update API change for cp_demangled_name_to_comp. (cp_remove_params): Likewise. * python/py-type.c (typy_legacy_template_argument): Likewise. * cp-support.h (cp_canonicalize_string_no_typedefs): Declare. (cp_merge_demangle_parse_infos): Declare. * cp-support.c (ignore_typedefs): New file global. (copy_string_to_obstack): New function. (inspect_type): New function. (replace_typedefs): New function. (replace_typedefs_qualified_name): New function. (cp_canonicalize_string_no_typedefs): New function. * cp-name-parser.y (cp_merge_demangle_parse_infos): New function. (cp_new_demangle__parse_info): Allocate and initialize the obstack. * linespec.c (find_methods): Use cp_canonicalize_string_no_typedefs instead of cp_canonicalize_string. (find_method): Likewise. (decode_compound): Before looking up the name, call cp_canonicalize_string_no_typedefs. (decode_variable): Likewise.
2011-08-172011-08-17 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon2-0/+215
Tom Tromey <tromey@redhat.com> Matt Rice <ratmice@gmail.com> * python/lib/gdb/prompt.py: New file. * python/lib/gdb/command/prompt.py: New file. * NEWS: Document set extended-prompt and gdb.prompt library 2011-08-17 Phil Muldoon <pmuldoon@redhat.com> * gdb.texinfo (Prompt): Add set/show extended-prompt documentation (Basic Python): Add prompt_hook anchor. (Python modules): Reword module text to reflect multiple modules. (gdb.prompt): Document gdb.prompt module. 2011-08-17 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/python.exp: Add extended-prompt tests.
2011-08-12 * NEWS: Mention new "type" attribute of python gdb.Symbol objects.Doug Evans1-0/+18
* python/py-symbol.c (sympy_get_type): New function. (symbol_object_getset): Add "type". doc/ * gdb.texinfo (Symbols In Python): Document symbol.type. testsuite/ * gdb.python/py-symbol.exp: Add test for symbol.type.
2011-08-092011-08-09 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon3-4/+29
* python/lib/gdb/__init__.py: Auto-load files in command and function directories. * python/python.c (finish_python_initialization): Use os.path.join. * python/lib/gdb/command/pretty_printers.py: Self register command. * NEWS: Document auto-loading. 2011-08-09 Phil Muldoon <pmuldoon@redhat.com> * gdb.texinfo (Python): Document command and function auto-loading.
2011-08-05 * python/py-breakpoint.c (gdbpy_initialize_breakpoints): Move theEli Zaretskii6-6/+6
initialization of the tp_new member to the corresponding gdbpy_initialize_* function. * python/py-cmd.c (gdbpy_initialize_commands): Likewise. * python/py-frame.c (gdbpy_initialize_frames): Likewise. * python/py-function.c (gdbpy_initialize_functions): Likewise. * python/py-inferior.c (gdbpy_initialize_inferior): Likewise. * python/py-param.c (gdbpy_initialize_parameters): Likewise.
2011-08-042011-08-04 Pedro Alves <pedro@codesourcery.com>Pedro Alves2-3/+5
* ui-out.h (uiout): Rename to ... (current_uiout): ... this. * ui-out.c (uiout): Rename to ... (current_uiout): ... this. * ada-lang.c (print_it_exception, print_one_exception) (print_mention_exception): Adjust. * breakpoint.c (watchpoint_check): Adjust. (print_breakpoint_location, print_one_breakpoint, breakpoint_1) (default_collect_info, watchpoints_info, print_one_catch_fork) (print_one_catch_vfork, print_one_catch_syscall) (print_one_catch_exec, mention, print_it_ranged_breakpoint) (print_one_ranged_breakpoint, print_mention_ranged_breakpoint) (print_it_watchpoint, print_mention_watchpoint) (print_it_masked_watchpoint, print_mention_masked_watchpoint) (print_it_exception_catchpoint, print_one_exception_catchpoint) (print_mention_exception_catchpoint, say_where, bkpt_print_it) (bkpt_print_mention, momentary_bkpt_print_it) (tracepoint_print_mention, update_static_tracepoint) (tracepoints_info, save_breakpoints): Adjust. * cli-out.c (field_separator): Adjust. * cp-abi.c (list_cp_abis, show_cp_abi_cmd): Adjust. * exceptions.c (catch_exceptions_with_msg, catch_errors): Adjust. * frame.c (get_current_frame): Adjust. * infcmd.c (run_command_1, print_return_value): Adjust. * inferior.c (inferior_command, info_inferiors_command): Adjust. * infrun.c (print_end_stepping_range_reason): Adjust. (print_signal_exited_reason, print_exited_reason): Adjust. (print_signal_received_reason, print_no_history_reason): Adjust. * interps.c (interp_set): Adjust. * osdata.c (info_osdata_command): Adjust. * progspace.c (maintenance_info_program_spaces_command): Adjust. * remote-fileio.c (remote_fileio_request): Adjust. * remote.c (show_remote_cmd): Adjust. * solib.c (info_sharedlibrary_command): Adjust. * source.c (print_source_lines_base): Adjust. * stack.c (print_stack_frame): Adjust. (do_gdb_disassembly, print_frame_info, print_frame): Adjust. * symfile-mem.c (add_vsyscall_page): Adjust. * symfile.c (load_progress, generic_load) (print_transfer_performance): Adjust. * thread.c (info_threads_command, restore_selected_frame) (thread_command): Adjust. * top.c (make_cleanup_restore_ui_file): Adjust. * tracepoint.c (tvariables_info_1, trace_status_mi, tfind_1) (print_one_static_tracepoint_marker): Adjust. * cli/cli-cmds.c (print_disassembly): Adjust. * cli/cli-decode.c (print_doc_line): Adjust. * cli/cli-interp.c (safe_execute_command): Adjust. * cli/cli-logging.c (set_logging_redirect, pop_output_files) (handle_redirections): Adjust. * cli/cli-script.c (show_user_1): Adjust. * cli/cli-setshow.c (do_setshow_command, cmd_show_list): Adjust. * mi/mi-cmd-break.c (breakpoint_notify): Adjust. * mi/mi-cmd-disas.c (mi_cmd_disassemble): Adjust. * mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_path) (mi_cmd_env_dir): Adjust. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file) (print_partial_file_name, mi_cmd_file_list_exec_source_files): Adjust. * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames) (mi_cmd_stack_info_depth, mi_cmd_stack_list_args) (list_args_or_locals): Adjust. * mi/mi-cmd-var.c (print_varobj, mi_cmd_var_create) (mi_cmd_var_delete, mi_cmd_var_set_format, mi_cmd_var_set_frozen) (mi_cmd_var_show_format, mi_cmd_var_info_num_children) (mi_cmd_var_list_children, mi_cmd_var_info_type) (mi_cmd_var_info_path_expression, mi_cmd_var_info_expression) (mi_cmd_var_show_attributes, mi_cmd_var_evaluate_expression) (mi_cmd_var_assign, mi_cmd_var_update, varobj_update_one): Adjust. * mi/mi-interp.c (mi_on_normal_stop): Adjust. * mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_thread_select) (mi_cmd_thread_list_ids, mi_cmd_thread_info, print_one_inferior) (list_available_thread_groups, mi_cmd_list_thread_groups) (mi_cmd_data_list_register_names) (mi_cmd_data_list_changed_registers) (mi_cmd_data_list_register_values, get_register) (mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory) (mi_cmd_data_read_memory_bytes, mi_cmd_list_features) (mi_cmd_list_target_features, mi_cmd_add_inferior) (mi_execute_command, mi_load_progress): Adjust. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Adjust. * python/py-auto-load.c (print_script, info_auto_load_scripts): Adjust. * python/py-breakpoint.c (bppy_get_commands): Adjust. * tui/tui-interp.c (tui_command_loop): Adjust. * tui/tui-io.c (tui_setup_io, tui_initialize_io): Adjust.
2011-07-252011-07-25 Pedro Alves <pedro@codesourcery.com>Pedro Alves1-5/+5
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-252011-07-25 Pedro Alves <pedro@codesourcery.com>Pedro Alves1-1/+2
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.
2011-07-222011-07-22 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon1-1/+1
* event-top.c (cli_command_loop): Use get_prompt, get_suffix, get_prefix. (display_gdb_prompt): Likewise. (change_annotation_level): Likewise. (push_prompt): Likewise. (pop_prompt): Likewise. (handle_stop_sig): Use get_prompt with a level. * top.c (command_loop): Use get_prompt with a level. (set_async_annotation_level): Use set_prompt with a level. (get_prefix): New function. (set_prefix): Ditto. (set_suffix): Ditto. (get_suffix): Ditto. (get_prompt): Accept a level argument. (set_prompt): Accept a level argument. Free old prompts. Set new_async_prompt if level is 0. (init_main): Use set_prompt with a level. Do not set new_async_prompt. * event-top.h (PROMPT, SUFFIX, PREFIX): Move to top.c * top.h: Declare set_suffix, get_suffix, set_prefix, get_prefix. Modify set_prompt, get_prompt to account for levels. * tui/tui-interp.c (tui_command_loop): Use get_prompt with a level * python/python.c (before_prompt_hook): Use set_prompt.