mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-10 13:40:25 +00:00
As part of the build process, generate pub/libvex_guest_offsets.h holding
guest state offsets. git-svn-id: svn://svn.valgrind.org/vex/trunk@1008
This commit is contained in:
11
VEX/Makefile
11
VEX/Makefile
@@ -7,7 +7,8 @@ PUB_HEADERS = pub/libvex_basictypes.h \
|
||||
pub/libvex_guest_x86.h \
|
||||
pub/libvex_guest_amd64.h \
|
||||
pub/libvex_guest_arm.h \
|
||||
pub/libvex_guest_ppc32.h
|
||||
pub/libvex_guest_ppc32.h \
|
||||
pub/libvex_guest_offsets.h
|
||||
|
||||
PRIV_HEADERS = priv/host-x86/hdefs.h \
|
||||
priv/host-amd64/hdefs.h \
|
||||
@@ -87,7 +88,9 @@ libvex.a: $(LIB_OBJS)
|
||||
ar clq libvex.a $(LIB_OBJS)
|
||||
|
||||
clean:
|
||||
rm -f $(LIB_OBJS) libvex.a vex test_main.o priv/main/vex_svnversion.h
|
||||
rm -f $(LIB_OBJS) libvex.a vex test_main.o \
|
||||
priv/main/vex_svnversion.h \
|
||||
pub/libvex_guest_offsets.h
|
||||
|
||||
version:
|
||||
rm -f priv/main/vex_svnversion.h
|
||||
@@ -108,6 +111,10 @@ minidist: version
|
||||
@cat priv/main/vex_svnversion.h
|
||||
@echo
|
||||
|
||||
pub/libvex_guest_offsets.h:
|
||||
gcc -Wall -g -o auxprogs/genoffsets auxprogs/genoffsets.c
|
||||
./auxprogs/genoffsets > pub/libvex_guest_offsets.h
|
||||
|
||||
|
||||
ALL_HEADERS = $(PUB_HEADERS) $(PRIV_HEADERS)
|
||||
ALL_INCLUDES = $(PUB_INCLUDES) $(PRIV_INCLUDES)
|
||||
|
||||
36
VEX/auxprogs/genoffsets.c
Normal file
36
VEX/auxprogs/genoffsets.c
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* A program which generates various guest state offsets. */
|
||||
|
||||
#include "../pub/libvex_basictypes.h"
|
||||
#include "../pub/libvex_guest_x86.h"
|
||||
|
||||
Int main ( void )
|
||||
{
|
||||
printf("#define OFFSET_x86_EAX %d\n",
|
||||
offsetof(VexGuestX86State,guest_EAX));
|
||||
|
||||
printf("#define OFFSET_x86_EBX %d\n",
|
||||
offsetof(VexGuestX86State,guest_EBX));
|
||||
|
||||
printf("#define OFFSET_x86_ECX %d\n",
|
||||
offsetof(VexGuestX86State,guest_ECX));
|
||||
|
||||
printf("#define OFFSET_x86_EDX %d\n",
|
||||
offsetof(VexGuestX86State,guest_EDX));
|
||||
|
||||
printf("#define OFFSET_x86_ESI %d\n",
|
||||
offsetof(VexGuestX86State,guest_ESI));
|
||||
|
||||
printf("#define OFFSET_x86_EDI %d\n",
|
||||
offsetof(VexGuestX86State,guest_EDI));
|
||||
|
||||
printf("#define OFFSET_x86_EBP %d\n",
|
||||
offsetof(VexGuestX86State,guest_EBP));
|
||||
|
||||
printf("#define OFFSET_x86_ESP %d\n",
|
||||
offsetof(VexGuestX86State,guest_ESP));
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user