Don't use PyLong_FromLongLong
authorTom Tromey <tromey@adacore.com>
Tue, 15 Sep 2020 17:08:56 +0000 (11:08 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 15 Sep 2020 17:08:57 +0000 (11:08 -0600)
This changes gdb to avoid PyLong_FromLongLong, preferring to use
gdb_py_object_from_longest instead.

gdb/ChangeLog
2020-09-15  Tom Tromey  <tromey@adacore.com>

* python/py-infevents.c (create_register_changed_event_object):
Use gdb_py_object_from_longest.
* python/py-exitedevent.c (create_exited_event_object): Use
gdb_py_object_from_longest.

gdb/ChangeLog
gdb/python/py-exitedevent.c
gdb/python/py-infevents.c

index eed367a49acba97ca126345c7b6dc8f6e2074c43..468bbc6cdad8803bece8c472978416ed69dc6fc5 100644 (file)
@@ -1,3 +1,10 @@
+2020-09-15  Tom Tromey  <tromey@adacore.com>
+
+       * python/py-infevents.c (create_register_changed_event_object):
+       Use gdb_py_object_from_longest.
+       * python/py-exitedevent.c (create_exited_event_object): Use
+       gdb_py_object_from_longest.
+
 2020-09-15  Tom Tromey  <tromey@adacore.com>
 
        * python/python.c (gdbpy_parameter_value): Use
index 9912b26e9096bbe18da2347eda4df22807588d21..b19cc9598842a85d458ea21e2a0c79217a039594 100644 (file)
@@ -30,7 +30,7 @@ create_exited_event_object (const LONGEST *exit_code, struct inferior *inf)
 
   if (exit_code)
     {
-      gdbpy_ref<> exit_code_obj (PyLong_FromLongLong (*exit_code));
+      gdbpy_ref<> exit_code_obj = gdb_py_object_from_longest (*exit_code);
 
       if (exit_code_obj == NULL)
        return NULL;
index f303c395c133319ce9091e6efbc5b498a6bba8a0..b653e4a32298d2ac67cb852814b2d1cb7063fa4e 100644 (file)
@@ -76,7 +76,7 @@ create_register_changed_event_object (struct frame_info *frame,
   if (evpy_add_attribute (event.get (), "frame", frame_obj.get ()) < 0)
     return NULL;
 
-  gdbpy_ref<> regnum_obj (PyLong_FromLongLong (regnum));
+  gdbpy_ref<> regnum_obj = gdb_py_object_from_longest (regnum);
   if (regnum_obj == NULL)
     return NULL;