Skip to content

Commit

Permalink
Merge pull request #10 from godzie44/godzie44/rustc_1.78
Browse files Browse the repository at this point in the history
Add support for rustc 1.78
  • Loading branch information
godzie44 authored May 3, 2024
2 parents 1b8593c + ed05957 commit bb549f7
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
on: [push, pull_request]
on: [ push, pull_request ]

name: CI

jobs:
test:
strategy:
matrix:
rustc_version: [ 1.75.0, 1.76.0, 1.77.0 ]
rustc_version: [ 1.75.0, 1.76.0, 1.77.0, 1.78.0 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
24 changes: 21 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,31 @@ All notable changes to this project will be documented in this file.

---

# [0.1.5] May 3 2024

### Added

- debugger: added support for rustc 1.78

### Fixed

- debugger: now tracer doesn't add new tracee to tracee_ctl if first
tracee.wait() return exited status instead of ptrace event status

---

# [0.1.4] April 3 2024

### Changed

- console: history hints now have better highlighting (grey instead of bolt)

### Fixed
- console: now sub commands (like break remove or break info) don't clash with operation + argument
- debugger: updated `unwind` crate to 0.4.2, now it must support rcX releases of libunwind
- console: fix expression parser. Now field op, index op and slice op have the same priority and can be combined in any order

- console: now sub commands (like break remove or break info) don't clash with
operation + argument
- debugger: updated `unwind` crate to 0.4.2, now it must support rcX releases of
libunwind
- console: fix expression parser. Now field op, index op and slice op have the
same priority and can be combined in any order
- console: now command parser considers spaces when finding subcommands
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ The former is completely okay to be asked via an issue.

The main purpose of the BugStalker development model is to provide two things:

1) all updates related to the release of new versions of `rustc` must
be released as quickly as possible
2) the development and addition of new features
shouldn't interfere with the first point
1) All updates related to the release of new `rustc` versions must
be released as quickly as possible.
2) Implementing of new features shouldn't interfere with the first point.

That is why BugStalker using a developing model similar to GitFlow.
There is a stable `master` branch and a `develop` branch with development
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bugstalker"
version = "0.1.4"
version = "0.1.5"
edition = "2021"
license = "MIT"
authors = ["Derevtsov Konstantin <[email protected]>"]
Expand All @@ -18,7 +18,7 @@ path = "src/main.rs"
name = "bs"

[dependencies]
nix = {version = "0.27.1", features = ["process", "signal", "uio", "personality", "ptrace"]}
nix = { version = "0.27.1", features = ["process", "signal", "uio", "personality", "ptrace"] }
once_cell = "1.13.1"
anyhow = "1.0"
rustyline = "14.0.0"
Expand All @@ -37,8 +37,8 @@ bytes = "1.2.1"
log = "0.4.17"
env_logger = "0.11.2"
crossterm = "0.27.0"
clap = { version = "4.0", features = ["derive"] }
uuid = {version = "1.2.2", features = ["v4", "fast-rng", "macro-diagnostics"]}
clap = { version = "4.0", features = ["derive"] }
uuid = { version = "1.2.2", features = ["v4", "fast-rng", "macro-diagnostics"] }
os_pipe = "1.1.2"
proc-maps = "0.3.0"
thread_db = "0.1.4"
Expand All @@ -53,8 +53,8 @@ trie-rs = "0.2.0"
regex = "1.8.4"
walkdir = "2.3.3"
timeout-readwrite = "0.3.3"
tuirealm = {version = "1.9.1", default-features = false, features = ["ratatui", "derive", "crossterm"]}
tui-realm-stdlib = { version = "^1.3.0", default-features = false, features = [ "ratatui", "crossterm" ] }
tuirealm = { version = "1.9.1", default-features = false, features = ["ratatui", "derive", "crossterm"] }
tui-realm-stdlib = { version = "^1.3.0", default-features = false, features = ["ratatui", "crossterm"] }
syntect = "5.1.0"
unicode-width = "0.1.11"
tui-realm-treeview = "^1.1.0"
Expand All @@ -63,7 +63,7 @@ lru = "0.12.1"
chrono = "0.4.31"
sysinfo = "0.30.0"
indexmap = "2.1.0"
chumsky = {version = "1.0.0-alpha.6", features = ["default", "label"]}
chumsky = { version = "1.0.0-alpha.6", features = ["default", "label"] }
ariadne = "0.4.0"

[dev-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- 1.75
- 1.76
- 1.77
- 1.78

---

Expand Down Expand Up @@ -345,4 +346,5 @@ Currently, there is only one builtin oracle - tokio oracle.

Feel free to suggest changes, ask a question or implement a new feature.
Any contributions are very welcome.

[How to contribute](https://github.com/godzie44/BugStalker/blob/master/CONTRIBUTING.md).
23 changes: 13 additions & 10 deletions src/debugger/debugee/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl Tracer {
let status = match waitpid(Pid::from_raw(-1), None) {
Ok(status) => status,
Err(Errno::ECHILD) => {
return Ok(StopReason::NoSuchProcess(self.tracee_ctl.proc_pid()))
return Ok(StopReason::NoSuchProcess(self.tracee_ctl.proc_pid()));
}
Err(e) => return Err(Waitpid(e)),
};
Expand Down Expand Up @@ -315,15 +315,18 @@ impl Tracer {
if self.tracee_ctl.tracee_mut(new_thread_id).is_none() {
let new_tracee = self.tracee_ctl.add(new_thread_id);
let new_trace_status = new_tracee.wait_one()?;

let _new_thread_id = new_thread_id;
debug_assert!(
matches!(
new_trace_status,
WaitStatus::PtraceEvent(_new_thread_id, _, libc::PTRACE_EVENT_STOP)
),
"the newly cloned thread must start with PTRACE_EVENT_STOP (cause PTRACE_SEIZE was used)"
)
if matches!(new_trace_status, WaitStatus::Exited(_, _)) {
// this situation can occur if the process has already completed
self.tracee_ctl.remove(new_thread_id);
} else {
debug_assert!(
matches!(
new_trace_status,
WaitStatus::PtraceEvent(tid, _, libc::PTRACE_EVENT_STOP) if tid == new_thread_id
),
"the newly cloned thread must start with PTRACE_EVENT_STOP (cause PTRACE_SEIZE was used)"
)
}
}
}
libc::PTRACE_EVENT_STOP => {
Expand Down
3 changes: 2 additions & 1 deletion src/debugger/variable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,8 @@ impl<'a> VariableParser<'a> {
let is_tls_type = version_switch!(
rust_version,
(1, 0, 0) ..= (1, 76, u32::MAX) => type_ns_h.contains(&["std", "sys", "common", "thread_local", "fast_local"]),
(1, 77, 0) ..= (1, u32::MAX, u32::MAX) => type_ns_h.contains(&["std", "sys", "pal", "common", "thread_local", "fast_local"])
(1, 77, 0) ..= (1, 77, u32::MAX) => type_ns_h.contains(&["std", "sys", "pal", "common", "thread_local", "fast_local"]),
(1, 78, 0) ..= (1, u32::MAX, u32::MAX) => type_ns_h.contains(&["std", "sys", "thread_local", "fast_local"]),
);
if is_tls_type == Some(true) {
return VariableIR::Specialized(parser_ext.parse_tls(struct_var, type_params));
Expand Down

0 comments on commit bb549f7

Please sign in to comment.