Commit Graph

20 Commits

Author SHA1 Message Date
Joel Brobecker b811d2c292 Update copyright year range in all GDB files.
gdb/ChangeLog:

        Update copyright year range in all GDB files.
2020-01-01 10:20:53 +04:00
Tom de Vries 30baf67b65 [gdb] Fix more typos in comments (2)
Fix typos in comments.  NFC.

Tested on x86_64-linux.

gdb/ChangeLog:

2019-10-26  Tom de Vries  <tdevries@suse.de>

	* aarch64-linux-tdep.c: Fix typos in comments.
	* aarch64-tdep.c: Same.
	* ada-lang.c: Same.
	* amd64-nat.c: Same.
	* arc-tdep.c: Same.
	* arch/aarch64-insn.c: Same.
	* block.c: Same.
	* breakpoint.h: Same.
	* btrace.h: Same.
	* c-varobj.c: Same.
	* cli/cli-decode.c: Same.
	* cli/cli-script.c: Same.
	* cli/cli-utils.h: Same.
	* coff-pe-read.c: Same.
	* coffread.c: Same.
	* compile/compile-cplus-symbols.c: Same.
	* compile/compile-object-run.c: Same.
	* completer.c: Same.
	* corelow.c: Same.
	* cp-support.c: Same.
	* demangle.c: Same.
	* dwarf-index-write.c: Same.
	* dwarf2-frame.c: Same.
	* dwarf2-frame.h: Same.
	* eval.c: Same.
	* frame-base.h: Same.
	* frame.h: Same.
	* gdbcmd.h: Same.
	* gdbtypes.h: Same.
	* gnu-nat.c: Same.
	* guile/scm-objfile.c: Same.
	* i386-tdep.c: Same.
	* i386-tdep.h: Same.
	* infcall.c: Same.
	* infcall.h: Same.
	* linux-nat.c: Same.
	* m68k-tdep.c: Same.
	* macroexp.c: Same.
	* memattr.c: Same.
	* mi/mi-cmd-disas.c: Same.
	* mi/mi-getopt.h: Same.
	* mi/mi-main.c: Same.
	* minsyms.c: Same.
	* nat/aarch64-sve-linux-sigcontext.h: Same.
	* objfiles.h: Same.
	* ppc-linux-nat.c: Same.
	* ppc-linux-tdep.c: Same.
	* ppc-tdep.h: Same.
	* progspace.h: Same.
	* prologue-value.h: Same.
	* python/py-evtregistry.c: Same.
	* python/py-instruction.h: Same.
	* record-btrace.c: Same.
	* record-full.c: Same.
	* remote.c: Same.
	* rs6000-tdep.c: Same.
	* ser-tcp.c: Same.
	* sol-thread.c: Same.
	* sparc-sol2-tdep.c: Same.
	* sparc64-tdep.c: Same.
	* stabsread.c: Same.
	* symfile.c: Same.
	* symtab.h: Same.
	* target.c: Same.
	* tracepoint.c: Same.
	* tui/tui-data.h: Same.
	* tui/tui-io.c: Same.
	* tui/tui-win.c: Same.
	* tui/tui.c: Same.
	* unittests/rsp-low-selftests.c: Same.
	* user-regs.h: Same.
	* utils.c: Same.
	* utils.h: Same.
	* valarith.c: Same.
	* valops.c: Same.
	* valprint.c: Same.
	* valprint.h: Same.
	* value.c: Same.
	* value.h: Same.
	* varobj.c: Same.
	* x86-nat.h: Same.
	* xtensa-tdep.c: Same.

gdb/gdbserver/ChangeLog:

2019-10-26  Tom de Vries  <tdevries@suse.de>

	* linux-aarch64-low.c: Fix typos in comments.
	* linux-arm-low.c: Same.
	* linux-low.c: Same.
	* linux-ppc-low.c: Same.
	* proc-service.c: Same.
	* regcache.h: Same.
	* server.c: Same.
	* tracepoint.c: Same.
	* win32-low.c: Same.

gdb/stubs/ChangeLog:

2019-10-26  Tom de Vries  <tdevries@suse.de>

	* ia64vms-stub.c: Fix typos in comments.
	* m32r-stub.c: Same.
	* m68k-stub.c: Same.
	* sh-stub.c: Same.

gdb/testsuite/ChangeLog:

2019-10-26  Tom de Vries  <tdevries@suse.de>

	* gdb.base/bigcore.c: Fix typos in comments.
	* gdb.base/ctf-ptype.c: Same.
	* gdb.base/long_long.c: Same.
	* gdb.dwarf2/dw2-op-out-param.S: Same.
	* gdb.python/py-evthreads.c: Same.
	* gdb.reverse/i387-stack-reverse.c: Same.
	* gdb.trace/tfile.c: Same.
	* lib/compiler.c: Same.
	* lib/compiler.cc: Same.

Change-Id: I8573d84a577894270179ae30f46c48d806fc1beb
2019-10-26 09:55:32 +02:00
Tom Tromey 3fabc0163a Do not include py-ref.h in most files
py-ref.h can really only be included from a specific spot in
python-internal.h.  The other includes are not useful, and cause
compilation errors if the includes are ever sorted.  So, remove these
includes.

Arguably, py-ref.h should simply not be a separate header.

gdb/ChangeLog
2019-01-22  Tom Tromey  <tom@tromey.com>

	* python/py-arch.c: Do not include py-ref.h.
	* python/py-bpevent.c: Do not include py-ref.h.
	* python/py-cmd.c: Do not include py-ref.h.
	* python/py-continueevent.c: Do not include py-ref.h.
	* python/py-event.h: Do not include py-ref.h.
	* python/py-evtregistry.c: Do not include py-ref.h.
	* python/py-finishbreakpoint.c: Do not include py-ref.h.
	* python/py-frame.c: Do not include py-ref.h.
	* python/py-framefilter.c: Do not include py-ref.h.
	* python/py-function.c: Do not include py-ref.h.
	* python/py-infevents.c: Do not include py-ref.h.
	* python/py-linetable.c: Do not include py-ref.h.
	* python/py-objfile.c: Do not include py-ref.h.
	* python/py-param.c: Do not include py-ref.h.
	* python/py-prettyprint.c: Do not include py-ref.h.
	* python/py-progspace.c: Do not include py-ref.h.
	* python/py-symbol.c: Do not include py-ref.h.
	* python/py-symtab.c: Do not include py-ref.h.
	* python/py-type.c: Do not include py-ref.h.
	* python/py-unwind.c: Do not include py-ref.h.
	* python/py-utils.c: Do not include py-ref.h.
	* python/py-value.c: Do not include py-ref.h.
	* python/py-varobj.c: Do not include py-ref.h.
	* python/py-xmethods.c: Do not include py-ref.h.
	* python/python.c: Do not include py-ref.h.
	* varobj.c: Do not include py-ref.h.
2019-01-22 20:35:21 -07:00
Joel Brobecker 42a4f53d2b Update copyright year range in all GDB files.
This commit applies all changes made after running the gdb/copyright.py
script.

Note that one file was flagged by the script, due to an invalid
copyright header
(gdb/unittests/basic_string_view/element_access/char/empty.cc).
As the file was copied from GCC's libstdc++-v3 testsuite, this commit
leaves this file untouched for the time being; a patch to fix the header
was sent to gcc-patches first.

gdb/ChangeLog:

	Update copyright year range in all GDB files.
2019-01-01 10:01:51 +04:00
Joel Brobecker e2882c8578 Update copyright year range in all GDB files
gdb/ChangeLog:

        Update copyright year range in all GDB files
2018-01-02 07:38:06 +04:00
Tom Tromey 88b6faea99 Use gdbpy_ref to simplify some logic
This uses the new gdbpy_ref template to simplify logic in various
parts of the Python layer; for example removing repeated error code or
removing gotos.

gdb/ChangeLog
2017-02-10  Tom Tromey  <tom@tromey.com>

	* python/py-cmd.c (cmdpy_destroyer): Use gdbpy_ref.
	* python/py-breakpoint.c (gdbpy_breakpoint_deleted): Use
	gdbpy_ref.
	* python/py-type.c (field_new): Use gdbpy_ref.
	* python/py-symtab.c (symtab_and_line_to_sal_object): Use
	gdbpy_ref.
	* python/py-progspace.c (pspy_new): Use gdbpy_ref.
	(py_free_pspace): Likewise.
	(pspace_to_pspace_object): Likewise.
	* python/py-objfile.c (objfpy_new): Use gdbpy_ref.
	(py_free_objfile): Likewise.
	(objfile_to_objfile_object): Likewise.
	* python/py-inferior.c (delete_thread_object): Use
	gdbpy_ref.
	(infpy_read_memory): Likewise.
	(py_free_inferior): Likewise.
	* python/py-evtregistry.c (create_eventregistry_object): Use
	gdbpy_ref.
	* python/py-event.c (create_event_object): Use gdbpy_ref.
2017-02-10 12:24:32 -07:00
Joel Brobecker 61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Tom Tromey e36122e9d7 Fix redefinition errors in C++ mode
In C, we can forward declare static structure instances.  That doesn't
work in C++ though.  C++ treats these as definitions.  So then the
compiler complains about symbol redefinition, like:

 src/gdb/elfread.c:1569:29: error: redefinition of ‘const sym_fns elf_sym_fns_lazy_psyms’
 src/gdb/elfread.c:53:29: error: ‘const sym_fns elf_sym_fns_lazy_psyms’ previously declared here

The intent of static here is naturally to avoid making these objects
visible outside the compilation unit.  The equivalent in C++ would be
to instead define the objects in the anonymous namespace.  But given
that it's desirable to leave the codebase compiling as both C and C++
for a while, this just makes the objects extern.

(base_breakpoint_ops is already declared in breakpoint.h, so we can
just remove the forward declare from breakpoint.c)

gdb/ChangeLog:
2015-02-11  Tom Tromey  <tromey@redhat.com>
	    Pedro Alves <palves@redhat.com>

	* breakpoint.c (base_breakpoint_ops): Delete.
	* dwarf2loc.c (dwarf_expr_ctx_funcs): Make extern.
	* elfread.c (elf_sym_fns_gdb_index, elf_sym_fns_lazy_psyms): Make extern.
	* guile/guile.c (guile_extension_script_ops, guile_extension_ops): Make extern.
	* ppcnbsd-tdep.c (ppcnbsd2_sigtramp): Make extern.
	* python/py-arch.c (arch_object_type): Make extern.
	* python/py-block.c (block_syms_iterator_object_type): Make extern.
	* python/py-bpevent.c (breakpoint_event_object_type): Make extern.
	* python/py-cmd.c (cmdpy_object_type): Make extern.
	* python/py-continueevent.c (continue_event_object_type)
	* python/py-event.h (GDBPY_NEW_EVENT_TYPE): Remove 'qual'
	parameter.  Update all callers.
	* python/py-evtregistry.c (eventregistry_object_type): Make extern.
	* python/py-exitedevent.c (exited_event_object_type): Make extern.
	* python/py-finishbreakpoint.c (finish_breakpoint_object_type): Make extern.
	* python/py-function.c (fnpy_object_type): Make extern.
	* python/py-inferior.c (inferior_object_type, membuf_object_type): Make extern.
	* python/py-infevents.c (call_pre_event_object_type)
	(inferior_call_post_event_object_type).
	(memory_changed_event_object_type): Make extern.
	* python/py-infthread.c (thread_object_type): Make extern.
	* python/py-lazy-string.c (lazy_string_object_type): Make extern.
	* python/py-linetable.c (linetable_entry_object_type)
	(linetable_object_type, ltpy_iterator_object_type): Make extern.
	* python/py-newobjfileevent.c (new_objfile_event_object_type)
	(clear_objfiles_event_object_type): Make extern.
	* python/py-objfile.c (objfile_object_type): Make extern.
	* python/py-param.c (parmpy_object_type): Make extern.
	* python/py-progspace.c (pspace_object_type): Make extern.
	* python/py-signalevent.c (signal_event_object_type): Make extern.
	* python/py-symtab.c (symtab_object_type, sal_object_type): Make extern.
	* python/py-type.c (type_object_type, field_object_type)
	(type_iterator_object_type): Make extern.
	* python/python.c (python_extension_script_ops)
	(python_extension_ops): Make extern.
	* stap-probe.c (stap_probe_ops): Make extern.
2015-02-11 11:20:21 +00:00
Joel Brobecker 32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Tom Tromey aa36459a92 * python/py-arch.c (gdbpy_initialize_arch): Use
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.
2013-05-20 20:36:19 +00:00
Tom Tromey 999633ede7 * python/py-arch.c (gdbpy_initialize_arch): Return 'int'.
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.
2013-05-20 20:28:52 +00:00
Tom Tromey f04010ffab * py-evtregistry.c (create_event_object): Decref
eventregistry_object if PyList_New fails.
2013-05-20 20:16:24 +00:00
Tom Tromey 62eec1a534 * python/py-arch.c (arch_object_type): Use
CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-block.c (block_syms_iterator_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-bpevent.c (breakpoint_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-cmd.c (cmdpy_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-continueevent.c (continue_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-event.h (GDBPY_NEW_EVENT_TYPE):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-events.h (thread_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-evtregistry.c (eventregistry_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-exitedevent.c (exited_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-finishbreakpoint.c (finish_breakpoint_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-function.c (fnpy_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-inferior.c (inferior_object_type, membuf_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-infthread.c (thread_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-lazy-string.c (lazy_string_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-newobjfileevent.c (new_objfile_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-objfile.c (objfile_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-param.c (parmpy_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-progspace.c (pspace_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-signalevent.c (signal_event_object_type):
	Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-symtab.c (symtab_object_type, sal_object_type): Use
	CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-type.c (type_object_type, field_object_type)
	(type_iterator_object_type): Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
	* python/py-internal.h (CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF): New
	define.
	(value_object_type, block_object_type, symbol_object_type)
	(event_object_type, stop_event_object_type, breakpoint_object_type)
	(frame_object_type): Use CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF.
2013-05-20 20:09:01 +00:00
Joel Brobecker 28e7fd6234 Update years in copyright notice for the GDB files.
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.
2013-01-01 06:33:28 +00:00
Paul Koning 9a27f2c60d Add support for Python 3.
* NEWS: Mention Python 3 support.
* varobj.c (value_get_print_value): Use
python_string_to_target_string.
* python/py-block.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
* python/py-breakpoint.c: Ditto.
* python/py-cmd.c:  Ditto.
* python/py-event.c: Ditto.
* python/py-event.h: Ditto.
* python/py-evtregistry.c: Ditto.
* python/py-finishbreakpoint.c: Ditto.
* python/py-frame.c: Ditto.
* python/py-function.c: Ditto.
* python/py-infthread.c: Ditto.
* python/py-lazy-string.c: Ditto.
* python/py-progspace.c: Ditto.
* /python/py-symbol.c: Ditto.
* python/py-evts.c:  (gdbpy_initialize_py_events): Add module
initialization for Python 3.
* python/py-inferior.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(infpy_read_memory): Return memoryview object if Python 3.
(infpy_write_memory): Use "s*" operand parsing code for Python 3.
(infpy_search_memory): Ditto.
(get_buffer): New function for Python 3.
* python/py-objfile.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(objfpy_dealloc): Use Py_TYPE to call tp_free.
* python/py-param.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(get_attr): Use PyUnicode_CompareWithASCIIString if Python 3.
(set_attr): Ditto.
* python/py-prettyprint.c (print_string_repr): use PyBytes methods
instead of PyString methods if Python 3.
(print_children): Skip push_dummy_python_frame call if Python 3.
* python/py-symtab.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(salpy_dealloc): Use Py_TYPE to call tp_free.
* python/py-type.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(field_dealloc): Use Py_TYPE to call tp_free.
(typy_dealloc): Ditto.
(type_object_as_number): Adjust struct initializations for
differences in layout for Python 2 vs. Python 3.
* python/py-utils.c (python_string_to_unicode): Omit non-Unicode
string case for Python 3.
(unicode_to_encoded_python_string): Shorten code (no functional
change).
(python_string_to_target_python_string): Comment that in Python 3
returned value is a Python "bytes" type.
(gdbpy_is_string): Omit non-Unicode string check in Python 3.
(gdb_py_object_from_longest): Omit non-long integer case in Python
3.
(gdb_py_object_from_ulongest): Ditto.
* python/py-value.c: Use PyVarObject_HEAD_INIT in initialization
of type objects.
(valpy_dealloc): Use Py_TYPE to call tp_free.
(valpy_int): Omit function if Python 3.
(convert_value_from_python): Use "%S" format (Python object as a
string) if Python 3.
(value_object_as_number): Adjust struct initializations for
differences in layout for Python 2 vs. Python 3.
* python/python-config.py: Adjust syntax for Python 3
compatibility.
Include "sys.abiflags" string as part of python library name, if
that attribute exists (Python 3).
* python/python-internal.h (IS_PY3): Define if Python 3.
(Py_TPFLAGS_HAVE_ITER, Py_TPFLAGS_CHECKTYPES): Define with
placeholder value if Python 3.
(PyInt_Check, PyInt_FromLong, PyInt_AsLong, PyString_FromString,
PyString_Decode, PyString_FromFormat, PyString_Check): Define as
analogous Python 3 API function if Python 3.
(PyVarObject_HEAD_INIT): Define if not already defined.
(Py_TYPE): Ditto.
* python/python.c (eval_python_command): Omit Py_FlushLine call if
Python 3.
Check return values of all Python API calls for error.
Supply dummy "python" and "python-interactive" commands if Python
initialization failed.
(_initialize_python): Convert argc to wchar_t** if Python 3.
Add module initialization for Python 3.
(finish_python_initialization): Pass wchar_t * argument to
PySys_SetPath if Python 3.
* python/lib/gdb/__init__.py: Define "reload" if Python 3.
(_GdbFile): New class for common output file behavior.
(GdbOutFile): Subclass from _GdbFile.
(GdbOutputErrorFile): Ditto.
(auto_load_packages): Adjust syntax for Python 3 compatibility.
* python/lib/gdb/printing.py: Define basestr and int if Python 3.
* python/lib/gdb/prompt.py: Use sorted() function rather than
sort() method.
* python/lib/gdb/command/explore.py: Define raw_input if Python 3.
Adjust syntax for Python 3 compatibility.
* python/lib/gdb/command/pretty_printers.py: Use sorted() function
rather than sort() method.
Adjust syntax for Python 3 compatibility.
* python/lib/gdb/command/type_printers.py: Ditto.
* doc/gdb.texinfo (Inferior.read_memory): Mention that the return
value is a memoryview object if Python 3.
2012-12-12 16:47:30 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
Tristan Gingold eed8f803b1 2011-06-16 Tristan Gingold <gingold@adacore.com>
* python/py-events.h (gdb_py_events): Make it extern.
	* python/py-evtregistry.c (gdb_py_events): Declare.
2011-06-16 05:54:09 +00:00
Hui Zhu c17a9e4688 Add the file that prev commit forget. 2011-02-05 05:27:23 +00:00