Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
3c4538c8
Commit
3c4538c8
authored
Feb 27, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reimplemented DebugBreakProcess.
parent
8bc7f16c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
11 deletions
+74
-11
debugger.c
dlls/kernel/debugger.c
+7
-10
server_protocol.h
include/wine/server_protocol.h
+17
-1
debugger.c
server/debugger.c
+27
-0
protocol.def
server/protocol.def
+8
-0
request.h
server/request.h
+2
-0
trace.c
server/trace.c
+13
-0
No files found.
dlls/kernel/debugger.c
View file @
3c4538c8
...
...
@@ -268,22 +268,19 @@ void WINAPI DebugBreak(void)
*/
BOOL
WINAPI
DebugBreakProcess
(
HANDLE
hProc
)
{
#if 0 /* FIXME: not correct */
int res;
int pid;
BOOL
ret
,
self
;
TRACE("(%08
lx)\n", (DWORD)
hProc);
TRACE
(
"(%08
x)
\n
"
,
hProc
);
SERVER_START_REQ(
get_process_info
)
SERVER_START_REQ
(
debug_break
)
{
req
->
handle
=
hProc
;
re
s =
wine_server_call_err( req );
pid = (int)reply->pid
;
re
t
=
!
wine_server_call_err
(
req
);
self
=
ret
&&
reply
->
self
;
}
SERVER_END_REQ
;
return !res && kill(pid, SIGINT) == 0;
#endif
return
FALSE
;
if
(
self
)
DbgBreakPoint
();
return
ret
;
}
...
...
include/wine/server_protocol.h
View file @
3c4538c8
...
...
@@ -1563,6 +1563,19 @@ struct debug_process_reply
struct
debug_break_request
{
struct
request_header
__header
;
handle_t
handle
;
};
struct
debug_break_reply
{
struct
reply_header
__header
;
int
self
;
};
struct
set_debugger_kill_on_exit_request
{
struct
request_header
__header
;
...
...
@@ -2681,6 +2694,7 @@ enum request
REQ_output_debug_string
,
REQ_continue_debug_event
,
REQ_debug_process
,
REQ_debug_break
,
REQ_set_debugger_kill_on_exit
,
REQ_read_process_memory
,
REQ_write_process_memory
,
...
...
@@ -2837,6 +2851,7 @@ union generic_request
struct
output_debug_string_request
output_debug_string_request
;
struct
continue_debug_event_request
continue_debug_event_request
;
struct
debug_process_request
debug_process_request
;
struct
debug_break_request
debug_break_request
;
struct
set_debugger_kill_on_exit_request
set_debugger_kill_on_exit_request
;
struct
read_process_memory_request
read_process_memory_request
;
struct
write_process_memory_request
write_process_memory_request
;
...
...
@@ -2991,6 +3006,7 @@ union generic_reply
struct
output_debug_string_reply
output_debug_string_reply
;
struct
continue_debug_event_reply
continue_debug_event_reply
;
struct
debug_process_reply
debug_process_reply
;
struct
debug_break_reply
debug_break_reply
;
struct
set_debugger_kill_on_exit_reply
set_debugger_kill_on_exit_reply
;
struct
read_process_memory_reply
read_process_memory_reply
;
struct
write_process_memory_reply
write_process_memory_reply
;
...
...
@@ -3059,6 +3075,6 @@ union generic_reply
struct
get_window_properties_reply
get_window_properties_reply
;
};
#define SERVER_PROTOCOL_VERSION 7
1
#define SERVER_PROTOCOL_VERSION 7
2
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
server/debugger.c
View file @
3c4538c8
...
...
@@ -5,6 +5,7 @@
*/
#include <assert.h>
#include <signal.h>
#include <string.h>
#include <stdio.h>
...
...
@@ -698,6 +699,32 @@ DECL_HANDLER(output_debug_string)
generate_debug_event
(
current
,
OUTPUT_DEBUG_STRING_EVENT
,
&
data
);
}
/* simulate a breakpoint in a process */
DECL_HANDLER
(
debug_break
)
{
struct
process
*
process
;
reply
->
self
=
0
;
if
(
!
(
process
=
get_process_from_handle
(
req
->
handle
,
PROCESS_SET_INFORMATION
/*FIXME*/
)))
return
;
if
(
process
!=
current
->
process
)
{
/* find a suitable thread to signal */
struct
thread
*
thread
;
for
(
thread
=
process
->
thread_list
;
thread
;
thread
=
thread
->
proc_next
)
{
if
(
thread
->
unix_pid
)
{
kill
(
thread
->
unix_pid
,
SIGTRAP
);
break
;
}
}
if
(
!
thread
)
set_error
(
STATUS_ACCESS_DENIED
);
}
else
reply
->
self
=
1
;
release_object
(
process
);
}
/* set debugger kill on exit flag */
DECL_HANDLER
(
set_debugger_kill_on_exit
)
{
...
...
server/protocol.def
View file @
3c4538c8
...
...
@@ -1124,6 +1124,14 @@ enum char_info_mode
@END
/* Simulate a breakpoint in a process */
@REQ(debug_break)
handle_t handle; /* process handle */
@REPLY
int self; /* was it the caller itself? */
@END
/* Set debugger kill on exit flag */
@REQ(set_debugger_kill_on_exit)
int kill_on_exit; /* 0=detach/1=kill debuggee when debugger dies */
...
...
server/request.h
View file @
3c4538c8
...
...
@@ -170,6 +170,7 @@ DECL_HANDLER(get_exception_status);
DECL_HANDLER
(
output_debug_string
);
DECL_HANDLER
(
continue_debug_event
);
DECL_HANDLER
(
debug_process
);
DECL_HANDLER
(
debug_break
);
DECL_HANDLER
(
set_debugger_kill_on_exit
);
DECL_HANDLER
(
read_process_memory
);
DECL_HANDLER
(
write_process_memory
);
...
...
@@ -325,6 +326,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(
req_handler
)
req_output_debug_string
,
(
req_handler
)
req_continue_debug_event
,
(
req_handler
)
req_debug_process
,
(
req_handler
)
req_debug_break
,
(
req_handler
)
req_set_debugger_kill_on_exit
,
(
req_handler
)
req_read_process_memory
,
(
req_handler
)
req_write_process_memory
,
...
...
server/trace.c
View file @
3c4538c8
...
...
@@ -1288,6 +1288,16 @@ static void dump_debug_process_request( const struct debug_process_request *req
fprintf
(
stderr
,
" attach=%d"
,
req
->
attach
);
}
static
void
dump_debug_break_request
(
const
struct
debug_break_request
*
req
)
{
fprintf
(
stderr
,
" handle=%d"
,
req
->
handle
);
}
static
void
dump_debug_break_reply
(
const
struct
debug_break_reply
*
req
)
{
fprintf
(
stderr
,
" self=%d"
,
req
->
self
);
}
static
void
dump_set_debugger_kill_on_exit_request
(
const
struct
set_debugger_kill_on_exit_request
*
req
)
{
fprintf
(
stderr
,
" kill_on_exit=%d"
,
req
->
kill_on_exit
);
...
...
@@ -2121,6 +2131,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(
dump_func
)
dump_output_debug_string_request
,
(
dump_func
)
dump_continue_debug_event_request
,
(
dump_func
)
dump_debug_process_request
,
(
dump_func
)
dump_debug_break_request
,
(
dump_func
)
dump_set_debugger_kill_on_exit_request
,
(
dump_func
)
dump_read_process_memory_request
,
(
dump_func
)
dump_write_process_memory_request
,
...
...
@@ -2273,6 +2284,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
(
dump_func
)
0
,
(
dump_func
)
0
,
(
dump_func
)
0
,
(
dump_func
)
dump_debug_break_reply
,
(
dump_func
)
0
,
(
dump_func
)
dump_read_process_memory_reply
,
(
dump_func
)
0
,
...
...
@@ -2425,6 +2437,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"output_debug_string"
,
"continue_debug_event"
,
"debug_process"
,
"debug_break"
,
"set_debugger_kill_on_exit"
,
"read_process_memory"
,
"write_process_memory"
,
...
...
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