Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 47 additions & 63 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ version = "0.1.0"

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

[workspace.lints.rust]
static_mut_refs = "allow"
Expand Down
8 changes: 4 additions & 4 deletions auxcov/src/codecov.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ impl Tracker {

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

let filename_id = ctx.filename;
let filename_id = ctx.filename();
let proc_map_index = proc_instance.proc.0 as usize;
let line = ctx.line as usize;
let line = ctx.line() as usize;

let mut known_file_name: Option<String> = None;
for context in &mut self.contexts {
Expand Down Expand Up @@ -206,7 +206,7 @@ impl InstructionHook for Tracker {
let proc_instance_ref;
unsafe {
ctx_ref = &*ctx;
proc_instance_ref = &*ctx_ref.proc_instance;
proc_instance_ref = &*ctx_ref.proc_instance();
}

self.process_dbg_line(ctx_ref, proc_instance_ref);
Expand Down
2 changes: 1 addition & 1 deletion auxtools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dashmap = "6"
ahash = "0.8"
fxhash = "0.2"
ctor = "0.2"
detour = { workspace = true }
retour = { workspace = true }

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = ["winuser", "libloaderapi", "psapi", "processthreadsapi"] }
Expand Down
2 changes: 1 addition & 1 deletion auxtools/src/bytecode_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub fn init() {
fn get_active_bytecode_ptrs() -> HashSet<*mut u32> {
fn visit(dst: &mut HashSet<*mut u32>, frames: Vec<debug::StackFrame>) {
for frame in frames {
let ptr = unsafe { (*frame.context).bytecode };
let ptr = unsafe { (*frame.context).bytecode() };

dst.insert(ptr);
}
Expand Down
18 changes: 9 additions & 9 deletions auxtools/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ pub struct CallStacks {

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

let proc = Proc::from_id((*instance).proc).unwrap();
let offset = (*context).bytecode_offset;
let offset = (*context).bytecode_offset();
let param_names = proc.parameter_names();
let local_names = proc.local_names();

let usr = Value::from_raw((*instance).usr);
let src = Value::from_raw((*instance).src);
let dot = Value::from_raw((*context).dot);
let dot = Value::from_raw((*context).dot());

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

let locals = (0..(*context).locals_count)
let locals = (0..(*context).locals_count())
.map(|i| {
(
local_names.get(i as usize).unwrap().clone(),
Value::from_raw(*((*context).locals).add(i as usize))
Value::from_raw(*((*context).locals()).add(i as usize))
)
})
.collect();

// Only populate the line number if we've got a file-name
let mut file_name = None;
let mut line_number = None;
if (*context).filename.valid() {
file_name = Some(StringRef::from_id((*context).filename));
line_number = Some((*context).line);
if (*context).filename().valid() {
file_name = Some(StringRef::from_id((*context).filename()));
line_number = Some((*context).line());
}

// TODO: When set this? For all sleepers?
Expand Down Expand Up @@ -125,7 +125,7 @@ impl CallStacks {

unsafe {
frames.push(StackFrame::from_context(context));
context = (*context).parent_context;
context = (*context).parent_context();
}
}

Expand Down
2 changes: 1 addition & 1 deletion auxtools/src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::{
os::raw::c_char
};

use detour::RawDetour;
use fxhash::FxHashMap;
use retour::RawDetour;

use super::{proc::Proc, raw_types, value::Value};
use crate::runtime::DMResult;
Expand Down
Loading
Loading