]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/python/py-inferior.c
Fix gdb.Inferior.read_memory without execution (PR dap/30644)
[thirdparty/binutils-gdb.git] / gdb / python / py-inferior.c
index f6000b944da3c7e995518bf959840d8515710e13..792f05b118e46c011179aef8d0f510a48e92659d 100644 (file)
@@ -550,7 +550,7 @@ infpy_read_memory (PyObject *self, PyObject *args, PyObject *kw)
       /* Use this scoped-restore because we want to be able to read
         memory from an unwinder.  */
       scoped_restore_current_inferior_for_memory restore_inferior
-       (inf->inferior, any_thread_of_inferior (inf->inferior)->ptid);
+       (inf->inferior);
 
       buffer.reset ((gdb_byte *) xmalloc (length));
 
@@ -608,7 +608,7 @@ infpy_write_memory (PyObject *self, PyObject *args, PyObject *kw)
         still used here, just to keep the code similar to other code
         in this file.  */
       scoped_restore_current_inferior_for_memory restore_inferior
-       (inf->inferior, any_thread_of_inferior (inf->inferior)->ptid);
+       (inf->inferior);
 
       write_memory_with_notification (addr, buffer, length);
     }
@@ -683,7 +683,7 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
         still used here, just to keep the code similar to other code
         in this file.  */
       scoped_restore_current_inferior_for_memory restore_inferior
-       (inf->inferior, any_thread_of_inferior (inf->inferior)->ptid);
+       (inf->inferior);
 
       found = target_search_memory (start_addr, length,
                                    buffer, pattern_size,
@@ -944,7 +944,7 @@ infpy_get_main_name (PyObject *self, void *closure)
         still used, just to keep the code similar to other code in
         this file.  */
       scoped_restore_current_inferior_for_memory restore_inferior
-       (inf->inferior, any_thread_of_inferior (inf->inferior)->ptid);
+       (inf->inferior);
 
       name = main_name ();
     }