binutils-gdb/gdb/python
Andrew Burgess 8b9c48b287 gdb/python: move PyLong_From* calls into py-utils.c
We already have two helper functions in py-utils.c:

  gdb_py_object_from_longest (LONGEST l)
  gdb_py_object_from_ulongest (ULONGEST l)

these wrap around calls to either PyLong_FromLongLong,
PyLong_FromLong, or PyInt_From_Long (if Python 2 is being used).

There is one place in gdb/python/* where a call to PyLong_FromLong was
added outside of the above utility functions, this was done in the
recent commit:

  commit 55789354fc
  Date:   Fri May 14 11:56:31 2021 +0200

      gdb/python: add a 'connection_num' attribute to Inferior objects

In this commit I replace the direct use of PyLong_FromLong with a call
to gdb_py_object_from_longest.  The only real change with this commit,
is that, for Python 2, we will now end up calling PyInt_FromLong
instead of PyLong_FromLong, but this should be invisible to the user.
For Python 3 there should be absolutely no change.

gdb/ChangeLog:

	* python/py-inferior.c (infpy_get_connection_num): Call
	gdb_py_object_from_longest instead of PyLong_FromLong directly.
2021-06-21 16:09:06 +01:00
..
lib/gdb Use is/is not to check for None in python code. 2021-06-08 23:49:05 +01:00
py-all-events.def
py-arch.c gdb: delay python initialisation until gdbpy_finish_initialization 2021-04-28 09:56:20 +01:00
py-auto-load.c gdb: remove unnecessary lookup_cmd when deprecating commands 2021-05-27 14:00:07 -04:00
py-block.c gdb: delay python initialisation until gdbpy_finish_initialization 2021-04-28 09:56:20 +01:00
py-bpevent.c
py-breakpoint.c gdb: remove iterate_over_breakpoints function 2021-05-27 14:58:37 -04:00
py-cmd.c gdb: add cmd_list_element::is_prefix 2021-05-17 14:01:26 -04:00
py-continueevent.c
py-event-types.def
py-event.c
py-event.h
py-events.h
py-evtregistry.c
py-evts.c
py-exitedevent.c
py-finishbreakpoint.c gdb: remove iterate_over_breakpoints function 2021-05-27 14:58:37 -04:00
py-frame.c gdb: replace fprint_frame_id 2021-05-09 16:50:15 +01:00
py-framefilter.c gdb: fix some indentation issues 2021-05-27 15:01:28 -04:00
py-function.c
py-gdb-readline.c
py-inferior.c gdb/python: move PyLong_From* calls into py-utils.c 2021-06-21 16:09:06 +01:00
py-infevents.c
py-infthread.c
py-instruction.c
py-instruction.h
py-lazy-string.c
py-linetable.c
py-newobjfileevent.c
py-objfile.c gdb: delay python initialisation until gdbpy_finish_initialization 2021-04-28 09:56:20 +01:00
py-param.c gdb/python: use return values of add_setshow functions in add_setshow_generic 2021-05-27 14:00:07 -04:00
py-prettyprint.c gdb: fix some indentation issues 2021-05-27 15:01:28 -04:00
py-progspace.c gdb: delay python initialisation until gdbpy_finish_initialization 2021-04-28 09:56:20 +01:00
py-record-btrace.c
py-record-btrace.h
py-record-full.c
py-record-full.h
py-record.c
py-record.h
py-ref.h
py-registers.c gdb: delay python initialisation until gdbpy_finish_initialization 2021-04-28 09:56:20 +01:00
py-signalevent.c
py-stopevent.c
py-stopevent.h
py-symbol.c Restore gdb.SYMBOL_LABEL_DOMAIN constant 2021-06-03 14:56:55 +02:00
py-symtab.c gdb: delay python initialisation until gdbpy_finish_initialization 2021-04-28 09:56:20 +01:00
py-threadevent.c
py-tui.c Forward mouse click to python TUI window 2021-06-04 16:18:10 +02:00
py-type.c gdb: delay python initialisation until gdbpy_finish_initialization 2021-04-28 09:56:20 +01:00
py-unwind.c gdb/python: handle saving user registers in a frame unwinder 2021-06-21 16:09:05 +01:00
py-utils.c
py-value.c
py-varobj.c
py-xmethods.c
python-config.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
python-internal.h gdb: make gdbpy_parse_command_name return a unique_xmalloc_ptr 2021-05-12 13:50:09 -04:00
python.c gdb: make add_com_alias accept target as a cmd_list_element 2021-05-27 14:00:07 -04:00
python.h