aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python-internal.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-09-15 11:08:56 -0600
committerTom Tromey <tromey@adacore.com>2020-09-15 11:08:56 -0600
commitd1cab9876d72d867b2de82688f5f5a2a4b655edb (patch)
treee427c640bc2fe1ebd2e57fd16408901df0161516 /gdb/python/python-internal.h
parent4bde49dc81c5c16189af70b9a144dbb5651994f1 (diff)
downloadgdb-d1cab9876d72d867b2de82688f5f5a2a4b655edb.zip
gdb-d1cab9876d72d867b2de82688f5f5a2a4b655edb.tar.gz
gdb-d1cab9876d72d867b2de82688f5f5a2a4b655edb.tar.bz2
Don't use gdb_py_long_from_ulongest
Remove the gdb_py_long_from_ulongest defines and change the Python layer to prefer gdb_py_object_from_ulongest. While writing this I noticed that the error handling in archpy_disassemble was incorrect -- it could call PyDict_SetItemString with a NULL value. This patch also fixes this bug. gdb/ChangeLog 2020-09-15 Tom Tromey <tromey@adacore.com> * python/python-internal.h (gdb_py_long_from_ulongest): Remove defines. * python/py-value.c (valpy_long): Use gdb_py_object_from_ulongest. * python/py-symtab.c (salpy_get_pc): Use gdb_py_object_from_ulongest. (salpy_get_last): Likewise. * python/py-record-btrace.c (recpy_bt_insn_pc): Use gdb_py_object_from_ulongest. * python/py-lazy-string.c (stpy_get_address): Use gdb_py_object_from_ulongest. * python/py-frame.c (frapy_pc): Use gdb_py_object_from_ulongest. * python/py-arch.c (archpy_disassemble): Use gdb_py_object_from_ulongest and gdb_py_object_from_longest. Fix error handling.
Diffstat (limited to 'gdb/python/python-internal.h')
-rw-r--r--gdb/python/python-internal.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index b93c78f..2c4195f 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -126,7 +126,6 @@
#define GDB_PY_LLU_ARG "K"
typedef PY_LONG_LONG gdb_py_longest;
typedef unsigned PY_LONG_LONG gdb_py_ulongest;
-#define gdb_py_long_from_ulongest PyLong_FromUnsignedLongLong
#define gdb_py_long_as_ulongest PyLong_AsUnsignedLongLong
#else /* HAVE_LONG_LONG */
@@ -135,7 +134,6 @@ typedef unsigned PY_LONG_LONG gdb_py_ulongest;
#define GDB_PY_LLU_ARG "K"
typedef long gdb_py_longest;
typedef unsigned long gdb_py_ulongest;
-#define gdb_py_long_from_ulongest PyLong_FromUnsignedLong
#define gdb_py_long_as_ulongest PyLong_AsUnsignedLong
#endif /* HAVE_LONG_LONG */