@@ -5,11 +5,14 @@ use ::unistd::Pid;
5
5
6
6
//------------------ First part: a low-level wrapper for ptrace -----------------//
7
7
8
+ <<<<<<< HEAD
8
9
#[ cfg ( all( target_os = "linux" ,
9
10
any( target_arch = "x86" ,
10
11
target_arch = "x86_64" ,
11
12
target_arch = "arm" ) ) ,
12
13
) ]
14
+ =======
15
+ >>>>>>> 067 f937f087c4fe00b7281d9829f33a3dae4a9bd
13
16
pub mod ptrace {
14
17
use libc:: c_int ;
15
18
@@ -151,7 +154,11 @@ pub fn ptrace_setsiginfo(pid: Pid, sig: &siginfo_t) -> Result<()> {
151
154
}
152
155
}
153
156
157
+ <<<<<<< HEAD
154
158
//-------------------------- Second part: a high-level wrapper for ptrace ----------------------//
159
+ =======
160
+ //-------------------------- Second part: a low-level wrapper for ptrace ----------------------//
161
+ >>>>>>> 067 f937f087c4fe00b7281d9829f33a3dae4a9bd
155
162
156
163
#[ cfg( target_arch = "x86_64") ]
157
164
// We're going to export it anyway
@@ -187,15 +194,22 @@ pub enum Register {
187
194
GS = 26 * 8 ,
188
195
}
189
196
197
+ <<<<<<< HEAD
190
198
type Word = usize ;
191
199
200
+ =======
201
+ >>>>>>> 067 f937f087c4fe00b7281d9829f33a3dae4a9bd
192
202
/// Makes the `PTRACE_SYSCALL` request to ptrace
193
203
pub fn syscall( pid: Pid ) -> Result <( ) > {
194
204
ptrace( ptrace:: PTRACE_SYSCALL , pid, ptr:: null_mut( ) , ptr:: null_mut( ) ) . map( |_| ( ) ) // ignore the useless return value
195
205
}
196
206
197
207
/// Makes the `PTRACE_PEEKUSER` request to ptrace
208
+ <<<<<<< HEAD
198
209
pub fn peekuser( pid: Pid , reg: Register ) -> Result <Word > {
210
+ =======
211
+ pub fn peekuser( pid: Pid , reg: Register ) -> Result <c_long> {
212
+ >>>>>>> 067 f937f087c4fe00b7281d9829f33a3dae4a9bd
199
213
let reg_arg = ( reg as i32 ) as * mut c_void ;
200
214
ptrace ( ptrace:: PTRACE_PEEKUSER , pid , reg_arg , ptr:: null_mut ( ) )
201
215
}
@@ -214,7 +228,11 @@ pub fn traceme() -> Result<()> {
214
228
///
215
229
/// This function allows to access arbitrary data in the traced process
216
230
/// and may crash the inferior if used incorrectly and is thus marked `unsafe `.
231
+ <<<<<<< HEAD
217
232
pub unsafe fn peekdata ( pid : Pid , addr : usize ) -> Result < Word > {
233
+ =======
234
+ pub unsafe fn peekdata ( pid : Pid , addr : c_long ) -> Result < c_long > {
235
+ >>>>>>> 067 f937f087c4fe00b7281d9829f33a3dae4a9bd
218
236
ptrace ( ptrace:: PTRACE_PEEKDATA , pid , addr as * mut c_void , ptr:: null_mut ( ) )
219
237
}
220
238
@@ -223,13 +241,18 @@ pub unsafe fn peekdata(pid: Pid, addr: usize) -> Result<Word> {
223
241
/// This function allows to access arbitrary data in the traced process
224
242
/// and may crash the inferior or introduce race conditions if used
225
243
/// incorrectly and is thus marked `unsafe`.
244
+ <<<<<<< HEAD
226
245
pub unsafe fn pokedata ( pid : Pid , addr : usize , val : Word ) -> Result < ( ) > {
246
+ =======
247
+ pub unsafe fn pokedata ( pid : Pid , addr : c_long , val : c_long ) -> Result < ( ) > {
248
+ >>>>>>> 067 f937f087c4fe00b7281d9829f33a3dae4a9bd
227
249
ptrace(
228
250
ptrace:: PTRACE_POKEDATA ,
229
251
pid ,
230
252
addr as * mut c_void ,
231
253
val as * mut c_void ,
232
254
) . map( |_| ( ) ) // ignore the useless return value
255
+ <<<<<<< HEAD
233
256
}
234
257
235
258
@@ -255,3 +278,6 @@ mod tests {
255
278
assert_eq ! ( len, 0 ) ;
256
279
}
257
280
}
281
+ =======
282
+ }
283
+ >>>>>>> 067 f937f087c4fe00b7281d9829f33a3dae4a9bd
0 commit comments