- /* Figure out where the displaced step buffer is. */
- CORE_ADDR disp_step_buffer_addr = linux_displaced_step_location (arch);
-
- per_inf = amd64_linux_per_inferior_data.emplace (inf, disp_step_buffer_addr);
+ std::vector<CORE_ADDR> buffers;
+#if 0
+ /* Alternative implementation that maps some pages in the inferior,
+ allowing to have many buffers. */
+ CORE_ADDR displaced_step_mmap = gdbarch_infcall_mmap (arch, 16384, GDB_MMAP_PROT_READ | GDB_MMAP_PROT_EXEC);
+ gdb_assert (displaced_step_mmap != 0);
+
+ for (int i = 0; i < 1024; i++)
+ buffers.push_back (displaced_step_mmap + 16 * i);
+
+#else
+ /* Figure out where the displaced step buffers are. */
+ CORE_ADDR addr = linux_displaced_step_location (arch);
+ buffers.push_back (addr);
+ buffers.push_back (addr + gdbarch_max_insn_length (arch));
+#endif
+ per_inf = amd64_linux_per_inferior_data.emplace (inf, buffers);