New regime for baseblock layout, as described in comment in
pub/libvex.h. Now the client has to go along with LibVEX's baseblock
layout decisions and is essentially powerless to make its own
decisions on the matter.
git-svn-id: svn://svn.valgrind.org/vex/trunk@426 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/main/vex_main.c b/priv/main/vex_main.c
index a986146..8f60330 100644
--- a/priv/main/vex_main.c
+++ b/priv/main/vex_main.c
@@ -7,6 +7,7 @@
/*---------------------------------------------------------------*/
#include "libvex.h"
+#include "libvex_guest_x86.h"
#include "main/vex_globals.h"
#include "main/vex_util.h"
@@ -73,6 +74,9 @@
vassert(vcon->guest_chase_thresh >= 0);
vassert(vcon->guest_chase_thresh < vcon->guest_max_insns);
+ /* All the guest state structs must have an 8-aligned size. */
+ vassert(0 == sizeof(VexGuestX86State) % 8);
+
/* Check that Vex has been built with sizes of basic types as
stated in priv/libvex_basictypes.h. Failure of any of these is
a serious configuration error and should be corrected
@@ -157,7 +161,7 @@
IRBB* irbb;
HInstrArray* vcode;
HInstrArray* rcode;
- Int i, j, k, out_used, saved_verbosity;
+ Int i, j, k, out_used, saved_verbosity, guest_sizeB;
UChar insn_bytes[32];
available_real_regs = NULL;
@@ -210,6 +214,7 @@
bbToIR = bbToIR_X86Instr;
findHelper = x86guest_findhelper;
specHelper = x86guest_spechelper;
+ guest_sizeB = sizeof(VexGuestX86State);
break;
default:
vpanic("LibVEX_Translate: unsupported guest insn set");
@@ -273,7 +278,7 @@
rcode = doRegisterAllocation ( vcode, available_real_regs,
n_available_real_regs,
isMove, getRegUsage, mapRegs,
- genSpill, genReload,
+ genSpill, genReload, guest_sizeB,
ppInstr, ppReg );
if (vex_verbosity > 0) {