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
7f9eb22a
Commit
7f9eb22a
authored
Apr 15, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use server_select to pass context to server in send_debug_event.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
137fd7d3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
6 additions
and
53 deletions
+6
-53
exception.c
dlls/ntdll/exception.c
+3
-7
server_protocol.h
include/wine/server_protocol.h
+1
-3
debugger.c
server/debugger.c
+1
-25
protocol.def
server/protocol.def
+0
-3
request.h
server/request.h
+0
-1
thread.c
server/thread.c
+0
-6
thread.h
server/thread.h
+0
-1
trace.c
server/trace.c
+1
-7
No files found.
dlls/ntdll/exception.c
View file @
7f9eb22a
...
@@ -131,7 +131,7 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *con
...
@@ -131,7 +131,7 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *con
DWORD
i
;
DWORD
i
;
obj_handle_t
handle
=
0
;
obj_handle_t
handle
=
0
;
client_ptr_t
params
[
EXCEPTION_MAXIMUM_PARAMETERS
];
client_ptr_t
params
[
EXCEPTION_MAXIMUM_PARAMETERS
];
context_t
server_
context
;
CONTEXT
exception_context
=
*
context
;
select_op_t
select_op
;
select_op_t
select_op
;
sigset_t
old_set
;
sigset_t
old_set
;
...
@@ -142,8 +142,6 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *con
...
@@ -142,8 +142,6 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *con
for
(
i
=
0
;
i
<
min
(
rec
->
NumberParameters
,
EXCEPTION_MAXIMUM_PARAMETERS
);
i
++
)
for
(
i
=
0
;
i
<
min
(
rec
->
NumberParameters
,
EXCEPTION_MAXIMUM_PARAMETERS
);
i
++
)
params
[
i
]
=
rec
->
ExceptionInformation
[
i
];
params
[
i
]
=
rec
->
ExceptionInformation
[
i
];
context_to_server
(
&
server_context
,
context
);
SERVER_START_REQ
(
queue_exception_event
)
SERVER_START_REQ
(
queue_exception_event
)
{
{
req
->
first
=
first_chance
;
req
->
first
=
first_chance
;
...
@@ -153,7 +151,6 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *con
...
@@ -153,7 +151,6 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *con
req
->
address
=
wine_server_client_ptr
(
rec
->
ExceptionAddress
);
req
->
address
=
wine_server_client_ptr
(
rec
->
ExceptionAddress
);
req
->
len
=
i
*
sizeof
(
params
[
0
]);
req
->
len
=
i
*
sizeof
(
params
[
0
]);
wine_server_add_data
(
req
,
params
,
req
->
len
);
wine_server_add_data
(
req
,
params
,
req
->
len
);
wine_server_add_data
(
req
,
&
server_context
,
sizeof
(
server_context
)
);
if
(
!
(
ret
=
wine_server_call
(
req
)))
handle
=
reply
->
handle
;
if
(
!
(
ret
=
wine_server_call
(
req
)))
handle
=
reply
->
handle
;
}
}
SERVER_END_REQ
;
SERVER_END_REQ
;
...
@@ -162,16 +159,15 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *con
...
@@ -162,16 +159,15 @@ NTSTATUS send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *con
{
{
select_op
.
wait
.
op
=
SELECT_WAIT
;
select_op
.
wait
.
op
=
SELECT_WAIT
;
select_op
.
wait
.
handles
[
0
]
=
handle
;
select_op
.
wait
.
handles
[
0
]
=
handle
;
server_select
(
&
select_op
,
offsetof
(
select_op_t
,
wait
.
handles
[
1
]
),
SELECT_INTERRUPTIBLE
,
TIMEOUT_INFINITE
,
NULL
,
NULL
);
server_select
(
&
select_op
,
offsetof
(
select_op_t
,
wait
.
handles
[
1
]
),
SELECT_INTERRUPTIBLE
,
TIMEOUT_INFINITE
,
&
exception_context
,
NULL
);
SERVER_START_REQ
(
get_exception_status
)
SERVER_START_REQ
(
get_exception_status
)
{
{
req
->
handle
=
handle
;
req
->
handle
=
handle
;
wine_server_set_reply
(
req
,
&
server_context
,
sizeof
(
server_context
)
);
ret
=
wine_server_call
(
req
);
ret
=
wine_server_call
(
req
);
}
}
SERVER_END_REQ
;
SERVER_END_REQ
;
if
(
ret
>=
0
)
context_from_server
(
context
,
&
server_context
)
;
if
(
ret
>=
0
)
*
context
=
exception_context
;
}
}
pthread_sigmask
(
SIG_SETMASK
,
&
old_set
,
NULL
);
pthread_sigmask
(
SIG_SETMASK
,
&
old_set
,
NULL
);
...
...
include/wine/server_protocol.h
View file @
7f9eb22a
...
@@ -2522,7 +2522,6 @@ struct queue_exception_event_request
...
@@ -2522,7 +2522,6 @@ struct queue_exception_event_request
client_ptr_t
address
;
client_ptr_t
address
;
data_size_t
len
;
data_size_t
len
;
/* VARARG(params,uints64,len); */
/* VARARG(params,uints64,len); */
/* VARARG(context,context); */
char
__pad_44
[
4
];
char
__pad_44
[
4
];
};
};
struct
queue_exception_event_reply
struct
queue_exception_event_reply
...
@@ -2542,7 +2541,6 @@ struct get_exception_status_request
...
@@ -2542,7 +2541,6 @@ struct get_exception_status_request
struct
get_exception_status_reply
struct
get_exception_status_reply
{
{
struct
reply_header
__header
;
struct
reply_header
__header
;
/* VARARG(context,context); */
};
};
...
@@ -6686,7 +6684,7 @@ union generic_reply
...
@@ -6686,7 +6684,7 @@ union generic_reply
/* ### protocol_version begin ### */
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 60
0
#define SERVER_PROTOCOL_VERSION 60
1
/* ### protocol_version end ### */
/* ### protocol_version end ### */
...
...
server/debugger.c
View file @
7f9eb22a
...
@@ -50,7 +50,6 @@ struct debug_event
...
@@ -50,7 +50,6 @@ struct debug_event
enum
debug_event_state
state
;
/* event state */
enum
debug_event_state
state
;
/* event state */
int
status
;
/* continuation status */
int
status
;
/* continuation status */
debug_event_t
data
;
/* event data */
debug_event_t
data
;
/* event data */
context_t
context
;
/* register context */
};
};
/* debug context */
/* debug context */
...
@@ -347,11 +346,6 @@ static void debug_event_destroy( struct object *obj )
...
@@ -347,11 +346,6 @@ static void debug_event_destroy( struct object *obj )
break
;
break
;
}
}
}
}
if
(
event
->
sender
->
context
==
&
event
->
context
)
{
event
->
sender
->
context
=
NULL
;
stop_thread_if_suspended
(
event
->
sender
);
}
release_object
(
event
->
sender
);
release_object
(
event
->
sender
);
release_object
(
event
->
debugger
);
release_object
(
event
->
debugger
);
}
}
...
@@ -746,13 +740,6 @@ DECL_HANDLER(queue_exception_event)
...
@@ -746,13 +740,6 @@ DECL_HANDLER(queue_exception_event)
if
((
event
=
alloc_debug_event
(
thread
,
EXCEPTION_DEBUG_EVENT
,
&
data
)))
if
((
event
=
alloc_debug_event
(
thread
,
EXCEPTION_DEBUG_EVENT
,
&
data
)))
{
{
const
context_t
*
context
=
(
const
context_t
*
)((
const
char
*
)
get_req_data
()
+
req
->
len
);
data_size_t
size
=
get_req_data_size
()
-
req
->
len
;
memset
(
&
event
->
context
,
0
,
sizeof
(
event
->
context
)
);
memcpy
(
&
event
->
context
,
context
,
min
(
sizeof
(
event
->
context
),
size
)
);
thread
->
context
=
&
event
->
context
;
if
((
reply
->
handle
=
alloc_handle
(
thread
->
process
,
event
,
SYNCHRONIZE
,
0
)))
if
((
reply
->
handle
=
alloc_handle
(
thread
->
process
,
event
,
SYNCHRONIZE
,
0
)))
{
{
link_event
(
event
);
link_event
(
event
);
...
@@ -772,18 +759,7 @@ DECL_HANDLER(get_exception_status)
...
@@ -772,18 +759,7 @@ DECL_HANDLER(get_exception_status)
0
,
&
debug_event_ops
)))
0
,
&
debug_event_ops
)))
{
{
close_handle
(
current
->
process
,
req
->
handle
);
close_handle
(
current
->
process
,
req
->
handle
);
if
(
event
->
state
==
EVENT_CONTINUED
)
set_error
(
event
->
state
==
EVENT_CONTINUED
?
event
->
status
:
STATUS_PENDING
);
{
if
(
current
->
context
==
&
event
->
context
)
{
data_size_t
size
=
min
(
sizeof
(
context_t
),
get_reply_max_size
()
);
set_reply_data
(
&
event
->
context
,
size
);
current
->
context
=
NULL
;
stop_thread_if_suspended
(
current
);
}
set_error
(
event
->
status
);
}
else
set_error
(
STATUS_PENDING
);
release_object
(
event
);
release_object
(
event
);
}
}
}
}
...
...
server/protocol.def
View file @
7f9eb22a
...
@@ -1934,7 +1934,6 @@ enum char_info_mode
...
@@ -1934,7 +1934,6 @@ enum char_info_mode
client_ptr_t address; /* exception address */
client_ptr_t address; /* exception address */
data_size_t len; /* size of parameters */
data_size_t len; /* size of parameters */
VARARG(params,uints64,len);/* exception parameters */
VARARG(params,uints64,len);/* exception parameters */
VARARG(context,context); /* thread context */
@REPLY
@REPLY
obj_handle_t handle; /* handle to the queued event */
obj_handle_t handle; /* handle to the queued event */
@END
@END
...
@@ -1943,8 +1942,6 @@ enum char_info_mode
...
@@ -1943,8 +1942,6 @@ enum char_info_mode
/* Retrieve the status of an exception event */
/* Retrieve the status of an exception event */
@REQ(get_exception_status)
@REQ(get_exception_status)
obj_handle_t handle; /* handle to the queued event */
obj_handle_t handle; /* handle to the queued event */
@REPLY
VARARG(context,context); /* modified thread context */
@END
@END
...
...
server/request.h
View file @
7f9eb22a
...
@@ -1377,7 +1377,6 @@ C_ASSERT( FIELD_OFFSET(struct queue_exception_event_reply, handle) == 8 );
...
@@ -1377,7 +1377,6 @@ C_ASSERT( FIELD_OFFSET(struct queue_exception_event_reply, handle) == 8 );
C_ASSERT
(
sizeof
(
struct
queue_exception_event_reply
)
==
16
);
C_ASSERT
(
sizeof
(
struct
queue_exception_event_reply
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_exception_status_request
,
handle
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_exception_status_request
,
handle
)
==
12
);
C_ASSERT
(
sizeof
(
struct
get_exception_status_request
)
==
16
);
C_ASSERT
(
sizeof
(
struct
get_exception_status_request
)
==
16
);
C_ASSERT
(
sizeof
(
struct
get_exception_status_reply
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
continue_debug_event_request
,
pid
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
continue_debug_event_request
,
pid
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
continue_debug_event_request
,
tid
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
continue_debug_event_request
,
tid
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
continue_debug_event_request
,
status
)
==
20
);
C_ASSERT
(
FIELD_OFFSET
(
struct
continue_debug_event_request
,
status
)
==
20
);
...
...
server/thread.c
View file @
7f9eb22a
...
@@ -588,12 +588,6 @@ void stop_thread( struct thread *thread )
...
@@ -588,12 +588,6 @@ void stop_thread( struct thread *thread )
if
(
is_process_init_done
(
thread
->
process
))
send_thread_signal
(
thread
,
SIGUSR1
);
if
(
is_process_init_done
(
thread
->
process
))
send_thread_signal
(
thread
,
SIGUSR1
);
}
}
/* stop a thread if it's supposed to be suspended */
void
stop_thread_if_suspended
(
struct
thread
*
thread
)
{
if
(
thread
->
suspend
+
thread
->
process
->
suspend
>
0
)
stop_thread
(
thread
);
}
/* suspend a thread */
/* suspend a thread */
int
suspend_thread
(
struct
thread
*
thread
)
int
suspend_thread
(
struct
thread
*
thread
)
{
{
...
...
server/thread.h
View file @
7f9eb22a
...
@@ -115,7 +115,6 @@ extern enum select_op get_wait_queue_select_op( struct wait_queue_entry *entry )
...
@@ -115,7 +115,6 @@ extern enum select_op get_wait_queue_select_op( struct wait_queue_entry *entry )
extern
client_ptr_t
get_wait_queue_key
(
struct
wait_queue_entry
*
entry
);
extern
client_ptr_t
get_wait_queue_key
(
struct
wait_queue_entry
*
entry
);
extern
void
make_wait_abandoned
(
struct
wait_queue_entry
*
entry
);
extern
void
make_wait_abandoned
(
struct
wait_queue_entry
*
entry
);
extern
void
stop_thread
(
struct
thread
*
thread
);
extern
void
stop_thread
(
struct
thread
*
thread
);
extern
void
stop_thread_if_suspended
(
struct
thread
*
thread
);
extern
int
wake_thread
(
struct
thread
*
thread
);
extern
int
wake_thread
(
struct
thread
*
thread
);
extern
int
wake_thread_queue_entry
(
struct
wait_queue_entry
*
entry
);
extern
int
wake_thread_queue_entry
(
struct
wait_queue_entry
*
entry
);
extern
int
add_queue
(
struct
object
*
obj
,
struct
wait_queue_entry
*
entry
);
extern
int
add_queue
(
struct
object
*
obj
,
struct
wait_queue_entry
*
entry
);
...
...
server/trace.c
View file @
7f9eb22a
...
@@ -2435,7 +2435,6 @@ static void dump_queue_exception_event_request( const struct queue_exception_eve
...
@@ -2435,7 +2435,6 @@ static void dump_queue_exception_event_request( const struct queue_exception_eve
dump_uint64
(
", address="
,
&
req
->
address
);
dump_uint64
(
", address="
,
&
req
->
address
);
fprintf
(
stderr
,
", len=%u"
,
req
->
len
);
fprintf
(
stderr
,
", len=%u"
,
req
->
len
);
dump_varargs_uints64
(
", params="
,
min
(
cur_size
,
req
->
len
)
);
dump_varargs_uints64
(
", params="
,
min
(
cur_size
,
req
->
len
)
);
dump_varargs_context
(
", context="
,
cur_size
);
}
}
static
void
dump_queue_exception_event_reply
(
const
struct
queue_exception_event_reply
*
req
)
static
void
dump_queue_exception_event_reply
(
const
struct
queue_exception_event_reply
*
req
)
...
@@ -2448,11 +2447,6 @@ static void dump_get_exception_status_request( const struct get_exception_status
...
@@ -2448,11 +2447,6 @@ static void dump_get_exception_status_request( const struct get_exception_status
fprintf
(
stderr
,
" handle=%04x"
,
req
->
handle
);
fprintf
(
stderr
,
" handle=%04x"
,
req
->
handle
);
}
}
static
void
dump_get_exception_status_reply
(
const
struct
get_exception_status_reply
*
req
)
{
dump_varargs_context
(
" context="
,
cur_size
);
}
static
void
dump_continue_debug_event_request
(
const
struct
continue_debug_event_request
*
req
)
static
void
dump_continue_debug_event_request
(
const
struct
continue_debug_event_request
*
req
)
{
{
fprintf
(
stderr
,
" pid=%04x"
,
req
->
pid
);
fprintf
(
stderr
,
" pid=%04x"
,
req
->
pid
);
...
@@ -4999,7 +4993,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
...
@@ -4999,7 +4993,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
(
dump_func
)
dump_next_thread_reply
,
(
dump_func
)
dump_next_thread_reply
,
(
dump_func
)
dump_wait_debug_event_reply
,
(
dump_func
)
dump_wait_debug_event_reply
,
(
dump_func
)
dump_queue_exception_event_reply
,
(
dump_func
)
dump_queue_exception_event_reply
,
(
dump_func
)
dump_get_exception_status_reply
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
...
...
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