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
1a79912a
Commit
1a79912a
authored
Jul 21, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Try to use /proc/pid/mem to read process memory since it should be faster.
parent
2c35fccf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
ptrace.c
server/ptrace.c
+20
-0
No files found.
server/ptrace.c
View file @
1a79912a
...
...
@@ -19,9 +19,11 @@
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <signal.h>
#include <stdarg.h>
...
...
@@ -377,6 +379,24 @@ int read_process_memory( struct process *process, client_ptr_t ptr, data_size_t
if
(
suspend_for_ptrace
(
thread
))
{
if
(
len
>
3
)
/* /proc/pid/mem should be faster for large sizes */
{
char
procmem
[
24
];
int
fd
;
sprintf
(
procmem
,
"/proc/%u/mem"
,
process
->
unix_pid
);
if
((
fd
=
open
(
procmem
,
O_RDONLY
))
!=
-
1
)
{
ssize_t
ret
=
pread
(
fd
,
dest
,
size
,
ptr
);
close
(
fd
);
if
(
ret
==
size
)
{
len
=
0
;
goto
done
;
}
}
}
if
(
len
>
1
)
{
if
(
read_thread_long
(
thread
,
addr
++
,
&
data
)
==
-
1
)
goto
done
;
...
...
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