summaryrefslogtreecommitdiff
path: root/gdb/python
Commit message (Collapse)AuthorAgeFilesLines
* 2013-10-03 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-10-032-7/+21
| | | | | | | | * python/py-value.c (convert_value_from_python): Move PyInt_Check conversion logic to occur after PyLong_Check. Comment on order change significance. * python/py-arch.c (archpy_disassemble): Comment on order of conversion for integers and longs.
* 2013-10-02 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-10-021-1/+4
| | | | | | PR python/15579 * python/python.c: Document gdb.execute command in Python help.
* 2013-10-02 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-10-021-2/+6
| | | | | * python/py-frame.c (frame_info_to_frame_object): Use gdbpy_convert_exception. Clean up Python object on failure.
* 2013-10-02 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-10-021-2/+5
| | | | | | * python/lib/gdb/command/frame_filters.py (InfoFrameFilter.list_frame_filters): Retrieve exception manually. (ShowFrameFilterPriority.invoke): Ditto.
* * aarch64-linux-nat.c: Replace PIDGET with ptid_get_pid.Luis Machado2013-09-302-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace TIDGET with ptid_get_lwp. Replace GET_LWP with ptid_get_lwp. * aix-thread.c (BUILD_THREAD, BUILD_LWP): Remove. Replace BUILD_THREAD with ptid_build. Replace BUILD_LWP with ptid_build. Replace PIDGET with ptid_get_pid. Replace TIDGET with ptid_get_lwp. * alphabsd-nat.c: Replace PIDGET with ptid_get_pid. * amd64-linux-nat.c: Replace PIDGET with ptid_get_pid. Replace TIDGET with ptid_get_lwp. * amd64bsd-nat.c: Replace PIDGET with ptid_get_pid. * arm-linux-nat.c: Replace PIDGET with ptid_get_pid. Replace TIDGET with ptid_get_lwp. Replace GET_LWP with ptid_get_lwp. * armnbsd-nat.c: Replace PIDGET with ptid_get_pid. * auxv.c: Likewise. * breakpoint.c: Likewise. * common/ptid.c (ptid_is_pid): Condense check for null_ptid and minus_one_ptid. (ptid_lwp_p): New function. (ptid_tid_p): New function. * common/ptid.h: Update comments for accessors. (ptid_lwp_p): New prototype. (ptid_tid_p): New prototype. * defs.h (PIDGET, TIDGET, MERGEPID): Do not define. * gcore.c: Replace PIDGET with ptid_get_pid. * gdbthread.h: Likewise. * gnu-nat.c: Likewise. * hppa-linux-nat.c: Replace PIDGET with ptid_get_pid. Replace TIDGET with ptid_get_lwp. * hppabsd-nat.c: Replace PIDGET with ptid_get_pid. * hppanbsd-nat.c: Likewise. * i386-linux-nat.c: Replace PIDGET with ptid_get_pid. Replace TIDGET with ptid_get_lwp. * i386bsd-nat.c: Replace PIDGET with ptid_get_pid. * ia64-linux-nat.c: Replace PIDGET with ptid_get_pid. * infcmd.c: Likewise. * inferior.h: Likewise. * inflow.c: Likewise. * infrun.c: Likewise. * linux-fork.c: Likewise. * linux-nat.c: Replace PIDGET with ptid_get_pid. Replace GET_PID with ptid_get_pid. Replace is_lwp with ptid_lwp_p. Replace GET_LWP with ptid_get_lwp. Replace BUILD_LWP with ptid_build.
* Code cleanup: Add objfile_name accessorJan Kratochvil2013-09-243-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdb/ 2013-09-24 Jan Kratochvil <jan.kratochvil@redhat.com> Code cleanup: Add objfile_name accessor function. * ada-lang.c (is_known_support_routine): Use objfile_name. * auto-load.c (source_gdb_script_for_objfile) (auto_load_objfile_script): Likewise. * coffread.c (coff_symtab_read, read_one_sym): Likewise. * dbxread.c (dbx_symfile_read): Likewise. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. * dwarf2loc.c (locexpr_describe_location_piece): Likewise. * dwarf2read.c (dwarf2_get_dwz_file, dwarf2_read_index) (dw2_symtab_iter_next, dw2_expand_symtabs_matching) (lookup_dwp_signatured_type, lookup_dwo_unit) (dwarf2_build_psymtabs_hard, scan_partial_symbols, process_queue) (fixup_go_packaging, process_imported_unit_die, dwarf2_physname) (read_import_statement, create_dwo_cu, open_and_init_dwp_file) (lookup_dwo_cutu, read_call_site_scope, dwarf2_ranges_read) (dwarf2_record_block_ranges, read_common_block, read_typedef) (read_subrange_type, load_partial_dies, read_partial_die) (read_addr_index_1, read_str_index, dwarf_decode_lines_1) (die_containing_type, build_error_marker_type, lookup_die_type) (follow_die_ref_or_sig, follow_die_ref, dwarf2_fetch_die_loc_sect_off) (dwarf2_fetch_constant_bytes, follow_die_sig, get_signatured_type) (get_DW_AT_signature_type, write_psymtabs_to_index) (save_gdb_index_command): Likewise. * elfread.c (find_separate_debug_file_by_buildid, elf_symfile_read): Likewise. * expprint.c (dump_subexp_body_standard): Likewise. * gdbtypes.c (type_name_no_tag_or_error): Likewise. * jit.c (jit_object_close_impl): Use the objfile field name renamed to original_name. * linux-thread-db.c (try_thread_db_load_from_pdir_1): New variable obj_name, use objfile_name for it, use the variable. (try_thread_db_load_from_pdir, has_libpthread, thread_db_new_objfile): Use objfile_name. * machoread.c (macho_symtab_read, macho_check_dsym) (macho_symfile_relocate): Likewise. * maint.c (maintenance_translate_address): Likewise. * minidebug.c (find_separate_debug_file_in_section): Likewise. * minsyms.c (install_minimal_symbols): Likewise. * objfiles.c (allocate_objfile): Use the objfile field name renamed to original_name. (filter_overlapping_sections): Use objfile_name. (objfile_name): New function. * objfiles.h (struct objfile): Rename field name to original_name. (objfile_name): New prototype. * printcmd.c (sym_info, address_info): Use objfile_name. * probe.c (parse_probes, collect_probes, compare_probes) (info_probes_for_ops): Likewise. * progspace.c (clone_program_space): Likewise. * psymtab.c (require_partial_symbols, dump_psymtab, allocate_psymtab) (maintenance_info_psymtabs): Likewise. * python/py-auto-load.c (gdbpy_load_auto_script_for_objfile) (source_section_scripts): Likewise. * python/py-objfile.c (objfpy_get_filename): Likewise. * python/py-progspace.c (pspy_get_filename): Likewise. * solib-aix.c (solib_aix_get_toc_value): Likewise. * solib-som.c (match_main, som_solib_section_offsets): Likewise. * solib.c (solib_read_symbols): Likewise. * stabsread.c (scan_file_globals): Likewise. * stap-probe.c (handle_stap_probe): Likewise. * symfile.c (symbol_file_clear, separate_debug_file_exists) (find_separate_debug_file_by_debuglink): Likewise. (reread_symbols): Likewise. Use the objfile field name renamed to original_name. (allocate_symtab): Use objfile_name. * symmisc.c (print_symbol_bcache_statistics, print_objfile_statistics) (dump_objfile, dump_msymbols, dump_symtab_1) (maintenance_print_msymbols, maintenance_print_objfiles) (maintenance_info_symtabs, maintenance_check_symtabs): Likewise. * target.c (target_translate_tls_address, target_info): Likewise. * xcoffread.c (xcoff_initial_scan): Make variable name const. Use objfile_name.
* 2013-08-30 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-08-301-4/+23
| | | | | | | | | | | | | PR python/15461 * python/py-arch.c (ARCHPY_REQUIRE_VALID): New macro. (archpy_name): Check for valid architecture. (archpy_disassemble): Ditto. 2013-08-30 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/py-arch.exp: Tests for invalid architecture.
* 2013-08-29 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-08-295-20/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * python/py-framefilter.c (py_print_frame): Remove usage of PyString_AsString. Use python_string_to_host_string instead. Refactor function to work with a string as a new allocation instead of a pointer. (py_print_frame): Ditto. * python/lib/gdb/frames.py (return_list): Cain iterators together instead of adding them as a list. (_sort_list): Call return_list, and remove duplicate code. (execute_frame_filters): Convert iterator to a list with list(). * python/lib/gdb/command/frame_filters.py (SetFrameFilterPriority._set_filter_priority): Convert priority attribute to an integer. * python/lib/gdb/FrameIterator.py (FrameIterator.next): Define wrapper function __next__. * python/lib/gdb/FrameDecorator.py: If basestring not defined, define as "str". 2013-08-29 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/py-framefilter.py (FrameFilter.filter): Check itertools for imap attribute. Otherwise use map(). (ElidingIterator): Define wrapper function __next__. * gdb.python/py-framefilter-mi.exp: Do not use execfile, use exec (open (read ())) instead. * gdb.python/py-framefilter.exp: Ditto. * gdb.python/py-arch.exp: Update print based test to Python 3.x compliance. * gdb.python/py-frame.exp: Ditto. * gdb.python/py-type.exp: Ditto.
* 2013-08-29 Phil Muldoon <pmuldoon@redhat.com>pmuldoon2013-08-291-1/+23
| | | | | | | | PR python/15752 * python/py-framefilter.c (apply_frame_filter): Check gdb_python_initialized. Exit if the Python frame-filter code cannot be initialized.
* * defs.h (enum val_prettyformat): Renamed from val_prettyprint.Doug Evans2013-07-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | Enum values rename as well. All uses updated. * valprint.h (value_print_options): Rename member pretty to pretty format. Rename member prettyprint_arrays to prettyformat_arrays. Rename member prettyprint_structs to prettyformat_structs. All uses updated. (get_no_prettyformat_print_options): Renamed from get_raw_print_options. * valprint.c (get_no_prettyformat_print_options): Renamed from get_raw_print_options. All callers updated. (show_prettyformat_structs): Renamed from show_prettyprint_structs. All callers updated. (show_prettyformat_arrays): Renamed from show_prettyprint_arrays. All callers updated. (_initialize_valprint): Improve help text for "set print pretty" and "set print arrays". testsuite/ * gdb.base/default.exp: Update expected output of "show print array" and "show print pretty".
* * python/py-inferior.c (gdbpy_selected_inferior): Don't incref.Tom Tromey2013-06-181-6/+1
|
* * python/python.c (finish_python_initialization): DecrefTom Tromey2013-06-181-2/+1
| | | | 'pythondir' on failure path as well.
* * python/py-utils.c (gdb_pymodule_addobject): Cast away const.Tom Tromey2013-06-051-1/+2
|
* use explicit returns to avoid checker confusionTom Tromey2013-05-303-3/+6
| | | | | | | | | | | | | | | | | | | The checker does not understand the idiom if (except.reason < 0) { do_cleanups (whatever); GDB_PY_HANDLE_EXCEPTION (except); } because it doesn't realize that the nested 'if' actually has the same condition. This fixes instances of this to be more explicit. * python/py-breakpoint.c (bppy_get_commands): Use explicit, unconditional return. * python/py-frame.c (frapy_read_var): Likewise. * python/python.c (gdbpy_decode_line): Likewise.
* fix py-value.cTom Tromey2013-05-301-2/+8
| | | | | | | | Some code in py-value.c could exit a loop without running some cleanups made in the loop. * python/py-value.c (valpy_binop): Call do_cleanups before exiting loop.
* fix py-prettyprint.cTom Tromey2013-05-301-2/+0
| | | | | | | | print_children, in py-prettyprint.c, could call do_cleanups twice on the same cleanup. * python/py-prettyprint.c (print_children): Remove extra do_cleanups call.
* fix py-frame.cTom Tromey2013-05-301-1/+6
| | | | | | | A couple return paths in frapy_read_var were missing do_cleanups calls. * python/py-frame.c (frapy_read_var): Call do_cleanups along all return paths.
* fix py-breakpoint.cTom Tromey2013-05-301-1/+5
| | | | | | | One return path in bppy_get_commands was missing a do_cleanups call. * python/py-breakpoint.c (bppy_get_commands): Call do_cleanups along all return paths.
* Fix build breakage with Python 2.4.Pedro Alves2013-05-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With Python 2.4, we see this build failure: ./python/python-internal.h: In function 'gdb_Py_DECREF': ./python/python-internal.h:179: warning: dereferencing 'void *' pointer ./python/python-internal.h:179: error: request for member 'ob_refcnt' in something not a structure or union Python 2.4 forgets to cast 'op' to PyObject pointer on the ob_refcnt accesses: #define Py_DECREF(op) \ if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \ --(op)->ob_refcnt != 0) \ _Py_CHECK_REFCNT(op) \ else \ _Py_Dealloc((PyObject *)(op)) ... #define _Py_CHECK_REFCNT(OP) \ { if ((OP)->ob_refcnt < 0) \ _Py_NegativeRefcount(__FILE__, __LINE__, \ (PyObject *)(OP)); \ } Python 2.7: #define Py_DECREF(op) \ do { \ if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \ --((PyObject*)(op))->ob_refcnt != 0) \ _Py_CHECK_REFCNT(op) \ else \ _Py_Dealloc((PyObject *)(op)); \ } while (0) ... #define _Py_CHECK_REFCNT(OP) \ { if (((PyObject*)OP)->ob_refcnt < 0) \ _Py_NegativeRefcount(__FILE__, __LINE__, \ (PyObject *)(OP)); \ } gdb/ 2013-05-30 Pedro Alves <palves@redhat.com> * python/python-internal.h (gdb_Py_DECREF): Cast OP to PyObject pointer.
* * ada-lang.c (is_known_support_routine): Add explicit free ofKeith Seitz2013-05-221-2/+9
| | | | | | | | | | | | | | | 'func_name' from find_frame_funname. (ada_unhandled_exception_name_addr_from_raise): Add cleanups for func_name from find_frame_funname. * python/py-frame.c (frapy_name): Add explicit free of 'name' from find_frame_funname. * stack.c (find_frame_funname): Add comment explaining that funcp must be freed by the caller. Return copy of symbol names instead of pointers. (print_frame): Add a cleanup for 'funname' from find_frame_funname. * stack.h (find_frame_funname): Remove "const" from 'funname' parameter.
* Let the ARI know gdb_Py_DECREF is OK.Pedro Alves2013-05-221-1/+1
| | | | | | | | | | | | | | | The ARI complains with: > gdb/python/python-internal.h:177: code: editCase function: Function name starts lower case but has uppercased letters. gdb/python/python-internal.h:177:gdb_Py_DECREF (void *op) gdb_Py_DECREF is just wrapping a python macro that happens to be mixed case. gdb/ 2013-05-22 Pedro Alves <palves@redhat.com> * python/python-internal.h (gdb_Py_DECREF): Tag with "ARI: editCase function".
* py_decref: Don't check for NULL before calling Py_DECREF.Pedro Alves2013-05-212-3/+6
| | | | | | | | | | | | | | The only difference between Py_DECREF and Py_XDECREF is that the latter allows passing in a NULL object, while the former prohibits it. Given that, it's natural to expect the same from py_decref vs py_xdecref. gdb/ 2013-05-21 Pedro Alves <palves@redhat.com> * python/py-prettyprint.c (apply_val_pretty_printer): Check whether PRINTER is NULL before installing a Py_DECREF cleanup. * python/py-utils.c (py_decref): Don't check for NULL before calling Py_DECREF.
* Centralize workaround for Python 2.6's Py_DECREF.Pedro Alves2013-05-212-9/+14
| | | | | | | | | | | | | | Wrap/redefine Py_DECREF ourselves, avoiding the need for uses to care about extra braces due to the fact that Python only started wrapping Py_DECREF in 'do {} while (0)' after 2.6. gdb/ 2013-05-21 Pedro Alves <palves@redhat.com> * python/py-utils.c (py_decref): Remove extra braces. (gdb_pymodule_addobject): Remove extra braces. * python-internal.h (gdb_Py_DECREF): New static inline function. (Py_DECREF): Redefine as calling gdb_Py_DECREF.
* gdb/Jan Kratochvil2013-05-211-1/+4
| | | | | | Workaround Python 2.6. * python/py-utils.c (gdb_pymodule_addobject): Wrap Py_DECREF into a block.
* * python/py-prettyprint.c (search_pp_list): Decref 'attr'.Tom Tromey2013-05-201-0/+1
|
* * python/py-value.c (valpy_get_dynamic_type): SimplifyTom Tromey2013-05-201-9/+2
| | | | dynamic_type assignment. Use Py_XINCREF.
* * python/py-type.c (typy_fields): Unconditionally decref 'r'.Tom Tromey2013-05-201-4/+1
|
* * python/py-frame.c (frapy_older, frapy_newer, gdbpy_newest_frame)Tom Tromey2013-05-201-24/+22
| | | | | (gdbpy_selected_frame): Move object-construction code out of TRY_CATCH.
* * python/py-arch.c (gdbpy_initialize_arch): UseTom Tromey2013-05-2022-94/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gdb_pymodule_addobject. * python/py-block.c (gdbpy_initialize_blocks): Use gdb_pymodule_addobject. * python/py-breakpoint.c (gdbpy_initialize_breakpoints): Use gdb_pymodule_addobject. * python/py-cmd.c (gdbpy_initialize_breakpoints): Use gdb_pymodule_addobject. * python/py-event.c (gdbpy_initialize_event_generic): Use gdb_pymodule_addobject. * python/py-evtregistry.c (gdbpy_initialize_eventregistry): Use gdb_pymodule_addobject. * python/py-evts.c (add_new_registry): Use gdb_pymodule_addobject. (gdbpy_initialize_py_events): Likewise. * python/py-finishbreakpoint.c (gdbpy_initialize_finishbreakpoints): Use gdb_pymodule_addobject. * python/py-frame.c (gdbpy_initialize_frames): Use gdb_pymodule_addobject. * python/py-function.c (gdbpy_initialize_functions): Use gdb_pymodule_addobject. * python/py-inferior.c (gdbpy_initialize_inferior): Use gdb_pymodule_addobject. * python/py-infthread.c (gdbpy_initialize_thread): Use gdb_pymodule_addobject. * python/py-objfile.c (gdbpy_initialize_objfile): Use gdb_pymodule_addobject. * python/py-param.c (gdbpy_initialize_parameters): Use gdb_pymodule_addobject. * python/py-progspace.c (gdbpy_initialize_pspace): Use gdb_pymodule_addobject. * python/py-symbol.c (gdbpy_initialize_symbols): Use gdb_pymodule_addobject. * python/py-symtab.c (gdbpy_initialize_symtabs): Use gdb_pymodule_addobject. * python/py-type.c (gdbpy_initialize_types): Use gdb_pymodule_addobject. * python/py-utils.c (gdb_pymodule_addobject): New function. * python/py-value.c (gdbpy_initialize_values): Use gdb_pymodule_addobject. * python/python-internal.h (gdb_pymodule_addobject): Declare. * python/python.c (_initialize_python): Use gdb_pymodule_addobject.
* * python/py-cmd.c (cmdpy_completer): Use explicit decref.Tom Tromey2013-05-203-15/+15
| | | | | | | * python/py-param.c (get_set_value, get_show_value): Use explicit decrefs. * python/python.c (start_type_printers, apply_type_printers): Use explicit decrefs.
* * python/py-evts.c (gdbpy_initialize_py_events): Don'tTom Tromey2013-05-201-3/+0
| | | | incref the module.
* * python/python.c (gdbpy_run_events): Decref the resultTom Tromey2013-05-201-1/+5
| | | | of PyObject_CallObject.
* * python/py-symtab.c (set_sal): UseTom Tromey2013-05-201-8/+5
| | | | | CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION. Return -1 on error. (symtab_and_line_to_sal_object): Update.
* * python/py-param.c (compute_enum_values): Decref 'item'.Tom Tromey2013-05-201-0/+2
|
* * mi/mi-main.c: Include python-internal.h.Tom Tromey2013-05-205-0/+48
| | | | | | | | | | | | | | | | | | | | | | (mi_cmd_list_features): Check gdb_python_initialized. * python/py-inferior.c (python_on_normal_stop, python_on_resume) (python_inferior_exit, python_new_objfile, add_thread_object) (delete_thread_object, py_free_inferior): Check gdb_python_initialized. * python/py-prettyprint.c (apply_val_pretty_printer): Check gdb_python_initialized. * python/py-type.c (save_objfile_types): Check gdb_python_initialized. * python/python-internal.h (gdb_python_initialized): Declare. * python/python.c (ensure_python_env): Throw exception if Python not initialized. (before_prompt_hook, source_python_script_for_objfile) (start_type_printers, apply_type_printers, free_type_printers): Check gdb_python_initialized. * varobj.c (varobj_get_display_hint) (dynamic_varobj_has_child_method, update_dynamic_varobj_children) (install_new_value_visualizer, varobj_set_visualizer) (value_get_print_value): Check gdb_python_initialized.
* * python/py-arch.c (gdbpy_initialize_arch): Return 'int'.Tom Tromey2013-05-2025-217/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check errors. * python/py-auto-load.c (gdbpy_initialize_auto_load): Return 'int'. * python/py-block.c (gdbpy_initialize_blocks): Return 'int'. Check errors. * python/py-breakpoint.c (gdbpy_initialize_breakpoints): Return 'int'. Check errors. * python/py-cmd.c (gdbpy_initialize_commands): Return 'int'. Check errors. * python/py-event.c (gdbpy_initialize_event): Return 'int'. Check errors. * python/py-event.h (GDBPY_NEW_EVENT_TYPE): Change generated init function to return 'int'. * python/py-evtregistry.c (gdbpy_initialize_eventregistry): Return 'int'. Check errors. * python/py-evts.c (gdbpy_initialize_py_events): Return 'int'. Check errors. * python/py-finishbreakpoint.c (gdbpy_initialize_finishbreakpoints): Return 'int'. Check errors. * python/py-frame.c (gdbpy_initialize_frames): Return 'int'. Check errors. * python/py-function.c (gdbpy_initialize_functions): Return 'int'. Check errors. * python/py-gdb-readline.c (gdbpy_initialize_gdb_readline): Check errors. * python/py-inferior.c (gdbpy_initialize_inferior): Return 'int'. Check errors. * python/py-infthread.c (gdbpy_initialize_thread): Return 'int'. Check errors. * python/py-lazy-string.c (gdbpy_initialize_lazy_string): Return 'int'. Check errors. * python/py-objfile.c (gdbpy_initialize_objfile): Return 'int'. Check errors. * python/py-param.c (gdbpy_initialize_parameters): Return 'int'. Check errors. * python/py-progspace.c (gdbpy_initialize_pspace): Return 'int'. Check errors. * python/py-symbol.c (gdbpy_initialize_symbols): Return 'int'. Check errors. * python/py-symtab.c (gdbpy_initialize_symtabs): Return 'int'. Check errors. * python/py-type.c (gdbpy_initialize_types): Return 'int'. Check errors. * python/py-value.c (gdbpy_initialize_values): Return 'int'. Check errors. * python/python-internal.h (gdbpy_initialize_auto_load, gdbpy_initialize_values, gdbpy_initialize_frames, gdbpy_initialize_symtabs, gdbpy_initialize_commands, gdbpy_initialize_symbols, gdbpy_initialize_symtabs, gdbpy_initialize_blocks, gdbpy_initialize_types, gdbpy_initialize_functions, gdbpy_initialize_pspace, gdbpy_initialize_objfile, gdbpy_initialize_breakpoints, gdbpy_initialize_finishbreakpoints, gdbpy_initialize_lazy_string, gdbpy_initialize_parameters, gdbpy_initialize_thread, gdbpy_initialize_inferior, gdbpy_initialize_eventregistry, gdbpy_initialize_event, gdbpy_initialize_py_events, gdbpy_initialize_stop_event, gdbpy_initialize_signal_event, gdbpy_initialize_breakpoint_event, gdbpy_initialize_continue_event, gdbpy_initialize_exited_event, gdbpy_initialize_thread_event, gdbpy_initialize_new_objfile_event, gdbpy_initialize_arch): Update. Use CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION. * python/python.c (gdb_python_initialized): New global. (gdbpy_initialize_events): Return 'int'. Check errors. (_initialize_python): Check errors. Set gdb_python_initialized.
* * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope):Tom Tromey2013-05-201-2/+6
| | | | Decref the reslut of PyObject_CallMethod.
* * python/py-event.c (gdbpy_initialize_event_generic): ReturnTom Tromey2013-05-201-1/+1
| | | | early if PyType_Ready fails.
* * python/py-type.c (make_fielditem): Add gdb_assert_not_reachedTom Tromey2013-05-201-0/+2
| | | | as 'default' in the switch.
* * python/py-inferior.c (gdbpy_inferiors): Update. HoistTom Tromey2013-05-203-68/+59
| | | | | | | | | get_addr_from_python calls out of TRY_CATCH. (infpy_write_memory, infpy_search_memory): Likewise. * python/py-utils.c (get_addr_from_python): Return negative value on error. Use TRY_CATCH. * python/python-internal.h (get_addr_from_python): Use CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION.
* * python/py-event.c (evpy_emit_event): Decref theTom Tromey2013-05-201-1/+8
| | | | result of PyObject_CallFunctionObjArgs.
* * python/py-cmd.c (cmdpy_completer): Use iterator protocol.Tom Tromey2013-05-201-21/+28
| | | | Correctly decref.
* * python/py-cmd.c (cmdpy_init): Decref 'ds_obj'.Tom Tromey2013-05-201-0/+3
|
* * python/py-event.h (gdbpy_initialize_event_generic): UseTom Tromey2013-05-203-4/+12
| | | | | | | | CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION. * python/py-evts.c (add_new_registry): Use CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION. * python/python-internal.h (CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION): New macro.
* * python/py-arch.c (archpy_disassemble): Update.Tom Tromey2013-05-204-27/+24
| | | | | | | | | | * python/py-type.c (typy_get_composite, typy_lookup_typename) (typy_lookup_type): Use GDB_PY_HANDLE_EXCEPTION. * python/py-utils.c (gdbpy_convert_exception): Return 'void'. * python/python-internal.h (CPYCHECKER_SETS_EXCEPTION): New macro. (GDB_PY_HANDLE_EXCEPTION): Update. (gdbpy_convert_exception): Update. Use CPYCHECKER_SETS_EXCEPTION.
* * python/python-internal.h (events_object_type): Remove.Tom Tromey2013-05-201-1/+0
|
* * python/py-event.h (evpy_emit_event): UseTom Tromey2013-05-202-1/+9
| | | | | | CPYCHECKER_STEALS_REFERENCE_TO_ARG. * python/python-internal.h (CPYCHECKER_STEALS_REFERENCE_TO_ARG): New macro.
* * py-evtregistry.c (create_event_object): DecrefTom Tromey2013-05-201-1/+4
| | | | eventregistry_object if PyList_New fails.
* * py-cmd.c (gdbpy_string_to_argv): Check result ofTom Tromey2013-05-201-0/+2
| | | | PyList_New.
* * python/python.c (before_prompt_hook): Add cleanup toTom Tromey2013-05-201-0/+2
| | | | decref 'hook'.