mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
target-i386: Introduce hw_{local,global}_breakpoint_enabled()
hw_breakpoint_enabled() returned a bit field indicating whether a local breakpoint and/or global breakpoint was enabled. Avoid this number magic by using explicit boolean helper functions hw_local_breakpoint_enabled() and hw_global_breakpoint_enabled(), to aid readability. Reuse them for the hw_breakpoint_enabled() implementation and change its return type to bool. While at it, fix Coding Style issues (missing braces). Signed-off-by: liguang <lig.fnst@cn.fujitsu.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
428065ce50
commit
5902564ac9
3 changed files with 21 additions and 6 deletions
|
@ -467,7 +467,8 @@ static void switch_tss(CPUX86State *env, int tss_selector,
|
|||
/* reset local breakpoints */
|
||||
if (env->dr[7] & DR7_LOCAL_BP_MASK) {
|
||||
for (i = 0; i < DR7_MAX_BP; i++) {
|
||||
if (hw_breakpoint_enabled(env->dr[7], i) == 0x1) {
|
||||
if (hw_local_breakpoint_enabled(env->dr[7], i) &&
|
||||
!hw_global_breakpoint_enabled(env->dr[7], i)) {
|
||||
hw_breakpoint_remove(env, i);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue