Skip to content

Commit 24c37cb

Browse files
Fix latest rust build, 1688+ support (#102)
Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> Co-authored-by: harry <me@harryob.live>
1 parent 250893a commit 24c37cb

15 files changed

Lines changed: 346 additions & 109 deletions

File tree

Cargo.lock

Lines changed: 47 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ version = "0.1.0"
1212

1313
[workspace.dependencies]
1414
lazy_static = "1"
15-
detour = { version = "0.8", default-features = false }
16-
dmasm = { git = "https://github.com/willox/dmasm", tag = "515-support" }
15+
retour = { version = "=0.4.0-alpha.4", default-features = false }
16+
dmasm = { git = "https://github.com/willox/dmasm" }
1717

1818
[workspace.lints.rust]
1919
static_mut_refs = "allow"

auxcov/src/codecov.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ impl Tracker {
119119

120120
// returns true if we need to pause
121121
pub fn process_dbg_line(&mut self, ctx: &raw_types::procs::ExecutionContext, proc_instance: &raw_types::procs::ProcInstance) {
122-
if ctx.line == 0 || !ctx.filename.valid() {
122+
if ctx.line() == 0 || !ctx.filename().valid() {
123123
return;
124124
}
125125

126-
let filename_id = ctx.filename;
126+
let filename_id = ctx.filename();
127127
let proc_map_index = proc_instance.proc.0 as usize;
128-
let line = ctx.line as usize;
128+
let line = ctx.line() as usize;
129129

130130
let mut known_file_name: Option<String> = None;
131131
for context in &mut self.contexts {
@@ -206,7 +206,7 @@ impl InstructionHook for Tracker {
206206
let proc_instance_ref;
207207
unsafe {
208208
ctx_ref = &*ctx;
209-
proc_instance_ref = &*ctx_ref.proc_instance;
209+
proc_instance_ref = &*ctx_ref.proc_instance();
210210
}
211211

212212
self.process_dbg_line(ctx_ref, proc_instance_ref);

auxtools/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dashmap = "6"
2323
ahash = "0.8"
2424
fxhash = "0.2"
2525
ctor = "0.2"
26-
detour = { workspace = true }
26+
retour = { workspace = true }
2727

2828
[target.'cfg(windows)'.dependencies]
2929
winapi = { version = "0.3.9", features = ["winuser", "libloaderapi", "psapi", "processthreadsapi"] }

auxtools/src/bytecode_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn init() {
3333
fn get_active_bytecode_ptrs() -> HashSet<*mut u32> {
3434
fn visit(dst: &mut HashSet<*mut u32>, frames: Vec<debug::StackFrame>) {
3535
for frame in frames {
36-
let ptr = unsafe { (*frame.context).bytecode };
36+
let ptr = unsafe { (*frame.context).bytecode() };
3737

3838
dst.insert(ptr);
3939
}

auxtools/src/debug.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ pub struct CallStacks {
2525

2626
impl StackFrame {
2727
unsafe fn from_context(context: *mut procs::ExecutionContext) -> StackFrame {
28-
let instance = (*context).proc_instance;
28+
let instance = (*context).proc_instance();
2929

3030
let proc = Proc::from_id((*instance).proc).unwrap();
31-
let offset = (*context).bytecode_offset;
31+
let offset = (*context).bytecode_offset();
3232
let param_names = proc.parameter_names();
3333
let local_names = proc.local_names();
3434

3535
let usr = Value::from_raw((*instance).usr);
3636
let src = Value::from_raw((*instance).src);
37-
let dot = Value::from_raw((*context).dot);
37+
let dot = Value::from_raw((*context).dot());
3838

3939
// Make sure to handle arguments/locals with no names (when there are more
4040
// values than names)
@@ -45,21 +45,21 @@ impl StackFrame {
4545
})
4646
.collect();
4747

48-
let locals = (0..(*context).locals_count)
48+
let locals = (0..(*context).locals_count())
4949
.map(|i| {
5050
(
5151
local_names.get(i as usize).unwrap().clone(),
52-
Value::from_raw(*((*context).locals).add(i as usize))
52+
Value::from_raw(*((*context).locals()).add(i as usize))
5353
)
5454
})
5555
.collect();
5656

5757
// Only populate the line number if we've got a file-name
5858
let mut file_name = None;
5959
let mut line_number = None;
60-
if (*context).filename.valid() {
61-
file_name = Some(StringRef::from_id((*context).filename));
62-
line_number = Some((*context).line);
60+
if (*context).filename().valid() {
61+
file_name = Some(StringRef::from_id((*context).filename()));
62+
line_number = Some((*context).line());
6363
}
6464

6565
// TODO: When set this? For all sleepers?
@@ -125,7 +125,7 @@ impl CallStacks {
125125

126126
unsafe {
127127
frames.push(StackFrame::from_context(context));
128-
context = (*context).parent_context;
128+
context = (*context).parent_context();
129129
}
130130
}
131131

auxtools/src/hooks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use std::{
44
os::raw::c_char
55
};
66

7-
use detour::RawDetour;
87
use fxhash::FxHashMap;
8+
use retour::RawDetour;
99

1010
use super::{proc::Proc, raw_types, value::Value};
1111
use crate::runtime::DMResult;

0 commit comments

Comments
 (0)