Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
db28edc7
Commit
db28edc7
authored
Nov 09, 2007
by
Peter Beutner
Committed by
Alexandre Julliard
Nov 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Better trap exception handling.
parent
fc531676
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
signal_i386.c
dlls/ntdll/signal_i386.c
+10
-5
exception.c
dlls/ntdll/tests/exception.c
+3
-3
No files found.
dlls/ntdll/signal_i386.c
View file @
db28edc7
...
...
@@ -1040,16 +1040,21 @@ static void WINAPI raise_trap_exception( EXCEPTION_RECORD *rec, CONTEXT *context
{
if
(
rec
->
ExceptionCode
==
EXCEPTION_SINGLE_STEP
)
{
if
(
context
->
EFlags
&
0x100
)
{
context
->
EFlags
&=
~
0x100
;
/* clear single-step flag */
}
else
/* hardware breakpoint, fetch the debug registers */
struct
ntdll_thread_regs
*
const
regs
=
ntdll_get_thread_regs
();
/* when single stepping can't tell whether this is a hw bp or a
* single step interrupt. try to avoid as much overhead as possible
* and only do a server call if there is any hw bp enabled. */
if
(
!
(
context
->
EFlags
&
0x100
)
||
(
regs
->
dr7
&
0xff
)
)
{
/* (possible) hardware breakpoint, fetch the debug registers */
context
->
ContextFlags
=
CONTEXT_DEBUG_REGISTERS
;
NtGetContextThread
(
GetCurrentThread
(),
context
);
context
->
ContextFlags
|=
CONTEXT_FULL
;
/* restore flags */
}
context
->
EFlags
&=
~
0x100
;
/* clear single-step flag */
}
__regs_RtlRaiseException
(
rec
,
context
);
...
...
dlls/ntdll/tests/exception.c
View file @
db28edc7
...
...
@@ -489,7 +489,7 @@ static DWORD bpx_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *
/* single step exception on second nop */
ok
(
context
->
Eip
==
(
DWORD
)
code_mem
+
1
,
"eip is wrong: %x instead of %x
\n
"
,
context
->
Eip
,
(
DWORD
)
code_mem
+
1
);
todo_wine
{
ok
(
(
context
->
Dr6
&
0x4000
),
"BS flag is not set in Dr6
\n
"
);
}
;
ok
(
(
context
->
Dr6
&
0x4000
),
"BS flag is not set in Dr6
\n
"
)
;
/* depending on the win version the B0 bit is already set here as well
ok( (context->Dr6 & 0xf) == 0, "B0...3 flags in Dr6 shouldn't be set\n"); */
context
->
EFlags
|=
0x100
;
...
...
@@ -497,7 +497,7 @@ static DWORD bpx_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *
/* hw bp exception on second nop */
ok
(
context
->
Eip
==
(
DWORD
)
code_mem
+
1
,
"eip is wrong: %x instead of %x
\n
"
,
context
->
Eip
,
(
DWORD
)
code_mem
+
1
);
todo_wine
{
ok
(
(
context
->
Dr6
&
0xf
)
==
1
,
"B0 flag is not set in Dr6
\n
"
);
}
;
ok
(
(
context
->
Dr6
&
0xf
)
==
1
,
"B0 flag is not set in Dr6
\n
"
)
;
ok
(
!
(
context
->
Dr6
&
0x4000
),
"BS flag is set in Dr6
\n
"
);
context
->
Dr0
=
0
;
/* clear breakpoint */
context
->
EFlags
|=
0x100
;
...
...
@@ -506,7 +506,7 @@ static DWORD bpx_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *
ok
(
context
->
Eip
==
(
DWORD
)
code_mem
+
2
,
"eip is wrong: %x instead of %x
\n
"
,
context
->
Eip
,
(
DWORD
)
code_mem
+
2
);
ok
(
(
context
->
Dr6
&
0xf
)
==
0
,
"B0...3 flags in Dr6 shouldn't be set
\n
"
);
todo_wine
{
ok
(
(
context
->
Dr6
&
0x4000
),
"BS flag is not set in Dr6
\n
"
);
}
;
ok
(
(
context
->
Dr6
&
0x4000
),
"BS flag is not set in Dr6
\n
"
)
;
}
context
->
Dr6
=
0
;
/* clear status register */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment