aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-infevents.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-08-17 08:50:35 -0600
committerTom Tromey <tromey@adacore.com>2020-08-17 08:50:35 -0600
commitb017825fabd0ff6f6ff2a8526d50d0b7218606d0 (patch)
treea35b73b6f6bb832682dc9b0e957fe3881b4bd96c /gdb/python/py-infevents.c
parent7635cf797e267246b858d3daa3d781135baa0ea4 (diff)
downloadgdb-b017825fabd0ff6f6ff2a8526d50d0b7218606d0.zip
gdb-b017825fabd0ff6f6ff2a8526d50d0b7218606d0.tar.gz
gdb-b017825fabd0ff6f6ff2a8526d50d0b7218606d0.tar.bz2
Convert CORE_ADDR to Python using gdb_py_object_from_ulongest
An internal test failed on a riscv64-elf cross build because Inferior.search_memory returned a negative value. I tracked this down to to use of PyLong_FromLong in infpy_search_memory. Then, I looked at other conversions of CORE_ADDR to Python and fixed these as well. I don't think there is a good way to write a test for this. gdb/ChangeLog 2020-08-17 Tom Tromey <tromey@adacore.com> * python/py-inferior.c (infpy_search_memory): Use gdb_py_object_from_ulongest. * python/py-infevents.c (create_inferior_call_event_object) (create_memory_changed_event_object): Use gdb_py_object_from_ulongest. * python/py-linetable.c (ltpy_entry_get_pc): Use gdb_py_object_from_ulongest.
Diffstat (limited to 'gdb/python/py-infevents.c')
-rw-r--r--gdb/python/py-infevents.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/python/py-infevents.c b/gdb/python/py-infevents.c
index 291cb27..3cf7461 100644
--- a/gdb/python/py-infevents.c
+++ b/gdb/python/py-infevents.c
@@ -48,7 +48,7 @@ create_inferior_call_event_object (inferior_call_kind flag, ptid_t ptid,
if (evpy_add_attribute (event.get (), "ptid", ptid_obj.get ()) < 0)
return NULL;
- gdbpy_ref<> addr_obj (PyLong_FromLongLong (addr));
+ gdbpy_ref<> addr_obj = gdb_py_object_from_ulongest (addr);
if (addr_obj == NULL)
return NULL;
@@ -97,7 +97,7 @@ create_memory_changed_event_object (CORE_ADDR addr, ssize_t len)
if (event == NULL)
return NULL;
- gdbpy_ref<> addr_obj (PyLong_FromLongLong (addr));
+ gdbpy_ref<> addr_obj = gdb_py_object_from_ulongest (addr);
if (addr_obj == NULL)
return NULL;