target-i386: fix crash on x86 32bit linux host with hw breakpoint exceptions
authorJason Wessel <jason.wessel@windriver.com>
Tue, 26 Jan 2010 22:29:50 +0000 (16:29 -0600)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 28 Feb 2010 18:20:02 +0000 (19:20 +0100)
commit1545c7432ee1514988a18db2dde628637e15ce75
tree230a6acdea201b38b7b3373c34d4ac2acd8c3e5d
parent0df457dc0f08be59f9d73ac7081fa9392032e04b
target-i386: fix crash on x86 32bit linux host with hw breakpoint exceptions

If you make use of hw breakpoints on a 32bit x86 linux host, qemu
will segmentation fault when processing the exception.

The problem is that the value of env is stored in $ebp in the op_helper
raise_exception() function, and it can have the wrong value when
calling it from non generated code.

It is possible to work around the problem by restoring the value of
env before calling raise_exception() using a new helper function that
takes (CPUState *) as one of the arguments.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-i386/exec.h
target-i386/helper.c
target-i386/op_helper.c