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
2075a78e
Commit
2075a78e
authored
Sep 12, 2022
by
Brendan Shanks
Committed by
Alexandre Julliard
Sep 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Report errors on macOS when getting/setting debug registers.
parent
28ec3090
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
mach.c
server/mach.c
+9
-2
No files found.
server/mach.c
View file @
2075a78e
...
@@ -159,6 +159,7 @@ void get_thread_context( struct thread *thread, context_t *context, unsigned int
...
@@ -159,6 +159,7 @@ void get_thread_context( struct thread *thread, context_t *context, unsigned int
mach_msg_type_number_t
count
=
sizeof
(
state
)
/
sizeof
(
int
);
mach_msg_type_number_t
count
=
sizeof
(
state
)
/
sizeof
(
int
);
mach_msg_type_name_t
type
;
mach_msg_type_name_t
type
;
mach_port_t
port
,
process_port
=
get_process_port
(
thread
->
process
);
mach_port_t
port
,
process_port
=
get_process_port
(
thread
->
process
);
kern_return_t
ret
;
/* all other regs are handled on the client side */
/* all other regs are handled on the client side */
assert
(
flags
==
SERVER_CTX_DEBUG_REGISTERS
);
assert
(
flags
==
SERVER_CTX_DEBUG_REGISTERS
);
...
@@ -171,7 +172,8 @@ void get_thread_context( struct thread *thread, context_t *context, unsigned int
...
@@ -171,7 +172,8 @@ void get_thread_context( struct thread *thread, context_t *context, unsigned int
return
;
return
;
}
}
if
(
!
thread_get_state
(
port
,
x86_DEBUG_STATE
,
(
thread_state_t
)
&
state
,
&
count
))
ret
=
thread_get_state
(
port
,
x86_DEBUG_STATE
,
(
thread_state_t
)
&
state
,
&
count
);
if
(
!
ret
)
{
{
assert
(
state
.
dsh
.
flavor
==
x86_DEBUG_STATE32
||
assert
(
state
.
dsh
.
flavor
==
x86_DEBUG_STATE32
||
state
.
dsh
.
flavor
==
x86_DEBUG_STATE64
);
state
.
dsh
.
flavor
==
x86_DEBUG_STATE64
);
...
@@ -196,6 +198,8 @@ void get_thread_context( struct thread *thread, context_t *context, unsigned int
...
@@ -196,6 +198,8 @@ void get_thread_context( struct thread *thread, context_t *context, unsigned int
}
}
context
->
flags
|=
SERVER_CTX_DEBUG_REGISTERS
;
context
->
flags
|=
SERVER_CTX_DEBUG_REGISTERS
;
}
}
else
mach_set_error
(
ret
);
mach_port_deallocate
(
mach_task_self
(),
port
);
mach_port_deallocate
(
mach_task_self
(),
port
);
#endif
#endif
}
}
...
@@ -209,6 +213,7 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign
...
@@ -209,6 +213,7 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign
mach_msg_type_name_t
type
;
mach_msg_type_name_t
type
;
mach_port_t
port
,
process_port
=
get_process_port
(
thread
->
process
);
mach_port_t
port
,
process_port
=
get_process_port
(
thread
->
process
);
unsigned
int
dr7
;
unsigned
int
dr7
;
kern_return_t
ret
;
/* all other regs are handled on the client side */
/* all other regs are handled on the client side */
assert
(
flags
==
SERVER_CTX_DEBUG_REGISTERS
);
assert
(
flags
==
SERVER_CTX_DEBUG_REGISTERS
);
...
@@ -252,7 +257,9 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign
...
@@ -252,7 +257,9 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign
state
.
uds
.
ds32
.
__dr6
=
context
->
debug
.
i386_regs
.
dr6
;
state
.
uds
.
ds32
.
__dr6
=
context
->
debug
.
i386_regs
.
dr6
;
state
.
uds
.
ds32
.
__dr7
=
dr7
;
state
.
uds
.
ds32
.
__dr7
=
dr7
;
}
}
thread_set_state
(
port
,
x86_DEBUG_STATE
,
(
thread_state_t
)
&
state
,
count
);
ret
=
thread_set_state
(
port
,
x86_DEBUG_STATE
,
(
thread_state_t
)
&
state
,
count
);
if
(
ret
)
mach_set_error
(
ret
);
mach_port_deallocate
(
mach_task_self
(),
port
);
mach_port_deallocate
(
mach_task_self
(),
port
);
#endif
#endif
}
}
...
...
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