amd64-mpx: initialize BND register before performing inferior calls.
[deliverable/binutils-gdb.git] / gdb / i386-tdep.c
index c81f3e05fd43b7d94e6c89c0d83e61d60fdf6b32..ec8b5d3b1bc5e3f5781eaaa6aa5c2e76251504a7 100644 (file)
@@ -2684,6 +2684,13 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   int write_pass;
   int args_space = 0;
 
+  /* BND registers can be in arbitrary values at the moment of the
+     inferior call.  This can cause boundary violations that are not
+     due to a real bug or even desired by the user.  The best to be done
+     is set the BND registers to allow access to the whole memory, INIT
+     state, before pushing the inferior call.   */
+  i387_reset_bnd_regs (gdbarch, regcache);
+
   /* Determine the total space required for arguments and struct
      return address in a first pass (allowing for 16-byte-aligned
      arguments), then push arguments in a second pass.  */
This page took 0.026397 seconds and 4 git commands to generate.