diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile | 2 | ||||
-rw-r--r-- | tests/testsig.c | 33 |
2 files changed, 24 insertions, 11 deletions
diff --git a/tests/Makefile b/tests/Makefile index 495dbf3f4c..0d0fb9b956 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -28,7 +28,7 @@ testthread: testthread.c # i386 emulation test (test various opcodes) */ test-i386: test-i386.c test-i386-code16.S \ test-i386.h test-i386-shift.h test-i386-muldiv.h - $(CC) $(CFLAGS) $(LDFLAGS) -static -o $@ test-i386.c test-i386-code16.S -lm + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ test-i386.c test-i386-code16.S -lm test: test-i386 ifeq ($(ARCH),i386) diff --git a/tests/testsig.c b/tests/testsig.c index d93f42806a..27ea78c6a9 100644 --- a/tests/testsig.c +++ b/tests/testsig.c @@ -15,21 +15,34 @@ void alarm_handler(int sig) alarm(1); } +#ifndef REG_EAX +#define REG_EAX EAX +#define REG_EBX EBX +#define REG_ECX ECX +#define REG_EDX EDX +#define REG_ESI ESI +#define REG_EDI EDI +#define REG_EBP EBP +#define REG_ESP ESP +#define REG_EIP EIP +#define REG_EFL EFL +#endif + void dump_regs(struct ucontext *uc) { printf("EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n" "ESI=%08x EDI=%08x EBP=%08x ESP=%08x\n" "EFL=%08x EIP=%08x\n", - uc->uc_mcontext.gregs[EAX], - uc->uc_mcontext.gregs[EBX], - uc->uc_mcontext.gregs[ECX], - uc->uc_mcontext.gregs[EDX], - uc->uc_mcontext.gregs[ESI], - uc->uc_mcontext.gregs[EDI], - uc->uc_mcontext.gregs[EBP], - uc->uc_mcontext.gregs[ESP], - uc->uc_mcontext.gregs[EFL], - uc->uc_mcontext.gregs[EIP]); + uc->uc_mcontext.gregs[REG_EAX], + uc->uc_mcontext.gregs[REG_EBX], + uc->uc_mcontext.gregs[REG_ECX], + uc->uc_mcontext.gregs[REG_EDX], + uc->uc_mcontext.gregs[REG_ESI], + uc->uc_mcontext.gregs[REG_EDI], + uc->uc_mcontext.gregs[REG_EBP], + uc->uc_mcontext.gregs[REG_ESP], + uc->uc_mcontext.gregs[REG_EFL], + uc->uc_mcontext.gregs[REG_EIP]); } void sig_handler(int sig, siginfo_t *info, void *puc) |