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.
+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.
+
2020-08-17 Simon Marchi <simon.marchi@polymtl.ca>
* loc.c (class symbol_needs_eval_context): Fix indentation.
GDB_PY_HANDLE_EXCEPTION (except);
if (found)
- return PyLong_FromLong (found_addr);
+ return gdb_py_object_from_ulongest (found_addr).release ();
else
Py_RETURN_NONE;
}
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;
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;
{
linetable_entry_object *obj = (linetable_entry_object *) self;
- return gdb_py_object_from_longest (obj->pc).release ();
+ return gdb_py_object_from_ulongest (obj->pc).release ();
}
/* LineTable iterator functions. */