Skip to content

Commit

Permalink
[benfred#112] FreeBSD support
Browse files Browse the repository at this point in the history
FreeBSD is a somewhat popular system among developers and it would be
nice to have it supported.
In order to support it, we have to patch the remoteprocess subcrate a
bit, as well as bump `proc-maps` and `read-process-memory`
crates version.

This change

[remoteprocess crate]

Adds FreeBSD support for

* process and thread locking (via ptrace)
* getting thread registers (via ptrace)
* getting process' executable and cwd (via libprocstat)
* read_process_memory contract has changed in the latest version, so
  OSX / Linux / Windows code has been adjusted accordingly.

The only thing that is left to be implemented is unwinder /
symbolificator. Therefore `py-spy` on FreeBSD does not support native
stack traces, yet.

[py-spy]

* Adds FreeBSD-specific versions of platform-dependent functions.
* Adds Cirrus CI configuration to run tests against FreeBSD
  platform. In order to set CI up, please refer to
  https://cirrus-ci.org/guide/quick-start/
  • Loading branch information
akhramov committed Jul 10, 2019
1 parent 1717b91 commit d23d55b
Show file tree
Hide file tree
Showing 17 changed files with 2,937 additions and 258 deletions.
18 changes: 18 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
freebsd_instance:
image: freebsd-12-0-release-amd64

freebsd_task:
name: $TOOLCHAIN x86_64-unknown-freebsd
env:
matrix:
- TOOLCHAIN: stable
- TOOLCHAIN: beta
- TOOLCHAIN: nightly
setup_script:
- pkg install -y curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh -y --default-toolchain $TOOLCHAIN
build_script:
- $HOME/.cargo/bin/rustup run $TOOLCHAIN cargo build --verbose
test_script:
- $HOME/.cargo/bin/rustup run $TOOLCHAIN cargo test --verbose
525 changes: 322 additions & 203 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ libc = "0.2.34"
log = "0.4"
regex = "1"
tempfile = "3.0.3"
proc-maps = "0.1"
proc-maps = { git = "https://github.com/akhramov/proc-maps", branch = "feature/freebsd-support" }
memmap = "0.7.0"
cpp_demangle = "0.2.12"
rand = "0.6"
Expand Down
Loading

0 comments on commit d23d55b

Please sign in to comment.