Skip to content

Commit 41944d5

Browse files
committed
Auto merge of #1091 - xd009642:ptrace-arch-specific, r=alexcrichton
Arch specific ptrace commands for BSDs This PR is to add architecture specific ptrace requests etc. Don't merge this yet if it passes I want to go over the other BSDs and architectures to see if I've missed anything I'm just creating the PR to get that initial CI approval that it's right as I expect this bit to be more fiddly.
2 parents dd8f56e + f6e6be1 commit 41944d5

File tree

8 files changed

+48
-0
lines changed

8 files changed

+48
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
use PT_FIRSTMACH;
2+
13
pub type c_long = i64;
24
pub type c_ulong = u64;
35
pub type c_char = u8;
6+
7+
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
8+
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
9+
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
10+
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;

src/unix/bsd/netbsdlike/netbsd/arm.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
use PT_FIRSTMACH;
2+
13
pub type c_long = i32;
24
pub type c_ulong = u32;
35
pub type c_char = u8;
6+
7+
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
8+
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
9+
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
10+
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
use PT_FIRSTMACH;
2+
13
pub type c_long = i32;
24
pub type c_ulong = u32;
35
pub type c_char = u8;
6+
7+
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
8+
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
9+
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
use PT_FIRSTMACH;
2+
13
pub type c_long = i64;
24
pub type c_ulong = u64;
35
pub type c_char = i8;
6+
7+
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
8+
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
9+
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
10+
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
11+
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;

src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
8585

8686
pub const SIGSTKSZ : ::size_t = 40960;
8787

88+
pub const PT_FIRSTMACH: ::c_int = 32;
89+
8890
extern {
8991
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
9092
pub fn duplocale(base: ::locale_t) -> ::locale_t;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
use PT_FIRSTMACH;
2+
13
pub type c_long = i64;
24
pub type c_ulong = u64;
5+
6+
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
7+
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
8+
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
9+
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
10+
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;

src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
248248

249249
pub const SIGSTKSZ : ::size_t = 28672;
250250

251+
pub const PT_FIRSTMACH: ::c_int = 32;
252+
251253
extern {
252254
pub fn accept4(s: ::c_int, addr: *mut ::sockaddr,
253255
addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
use PT_FIRSTMACH;
2+
13
pub type c_long = i64;
24
pub type c_ulong = u64;
35
pub type c_char = i8;
6+
7+
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
8+
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
9+
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
10+
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
11+
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;

0 commit comments

Comments
 (0)