python_on_normal_stop (struct bpstats *bs, int print_frame)
{
struct cleanup *cleanup;
- enum target_signal stop_signal;
+ enum gdb_signal stop_signal;
if (!find_thread_ptid (inferior_ptid))
return;
{
struct cleanup *cleanup;
- cleanup = ensure_python_env (target_gdbarch, current_language);
+ cleanup = ensure_python_env (target_gdbarch (), current_language);
if (emit_continue_event (ptid) < 0)
gdbpy_print_stack ();
struct cleanup *cleanup;
const LONGEST *exit_code = NULL;
- cleanup = ensure_python_env (target_gdbarch, current_language);
+ cleanup = ensure_python_env (target_gdbarch (), current_language);
if (inf->has_exit_code)
exit_code = &inf->exit_code;
PyObject *
find_inferior_object (int pid)
{
- struct inflist_entry *p;
struct inferior *inf = find_inferior_pid (pid);
if (inf)
{
struct cleanup *cleanup;
inferior_object *inf_obj;
- thread_object *thread_obj;
struct threadlist_entry **entry, *tmp;
cleanup = ensure_python_env (python_gdbarch, python_language);
struct threadlist_entry *entry;
inferior_object *inf_obj = (inferior_object *) self;
PyObject *tuple;
+ volatile struct gdb_exception except;
INFPY_REQUIRE_VALID (inf_obj);
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ update_thread_list ();
+ GDB_PY_HANDLE_EXCEPTION (except);
+
tuple = PyTuple_New (inf_obj->nthreads);
if (!tuple)
return NULL;
/* Membuf and memory manipulation. */
-/* Implementation of gdb.read_memory (address, length).
+/* Implementation of Inferior.read_memory (address, length).
Returns a Python buffer object with LENGTH bytes of the inferior's
memory at ADDRESS. Both arguments are integers. Returns NULL on error,
with a python exception set. */
return result;
}
-/* Implementation of gdb.write_memory (address, buffer [, length]).
+/* Implementation of Inferior.write_memory (address, buffer [, length]).
Writes the contents of BUFFER (a Python object supporting the read
buffer protocol) at ADDRESS in the inferior's memory. Write LENGTH
bytes from BUFFER, or its entire contents if the argument is not
error = 1;
break;
}
- write_memory (addr, buffer, length);
+ write_memory_with_notification (addr, buffer, length);
}
GDB_PY_HANDLE_EXCEPTION (except);
(PyObject *) &inferior_object_type);
infpy_inf_data_key =
- register_inferior_data_with_cleanup (py_free_inferior);
+ register_inferior_data_with_cleanup (NULL, py_free_inferior);
observer_attach_new_thread (add_thread_object);
observer_attach_thread_exit (delete_thread_object);