Skip to content

Commit

Permalink
Merge pull request #1511 from vext01/tidy-ups
Browse files Browse the repository at this point in the history
Tidy ups
  • Loading branch information
ltratt authored Dec 13, 2024
2 parents 0db4e4d + 9c01317 commit c9611c3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 49 deletions.
14 changes: 1 addition & 13 deletions docs/src/dev/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,7 @@ This will automatically compile and run the `tests/c/simple.c` test under GDB.
This would be ideal if you have a crashing trace, as it will dump you into a
GDB shell at the time of the crash.

The tool has some other switches which are useful for other situations, e.g.:

```
bin/gdb_c_test -j -s -b10 simple.c
```

compiles and runs `tests/c/simple.c` test under GDB with [JIT state
debugging](runtime_config.md#ykd_print_jitstate)
enabled, with [compilation
serialised](runtime_config.md#ykd_serialise_compilation), setting a
breakpoint on the first 10 traces compiled.

For a list of all switches available, run:
To see what else you can do with `gdb_c_test`, run:

```
bin/gdb_c_test --help
Expand Down
35 changes: 0 additions & 35 deletions tests/src/bin/gdb_c_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,6 @@ struct Args {
/// The test to attach gdb to.
test_file: PathBuf,

/// Run the test with `YKD_LOG_IR` set to the specified value.
#[arg(short, long)]
log_ir: Option<String>,

/// Run the test with `YKD_LOG_JITSTATE=-`
#[arg(short = 'j', long)]
log_jitstate: bool,

/// Run the test with `YKD_SERIALISE_COMPILATION=1`
#[arg(short, long)]
serialise_compilation: bool,

/// Set breakpoints at the first `N` compiled traces.
#[arg(short = 'b', long)]
num_breaks: Option<usize>,

/// Don't immediately run the program.
#[arg(short = 'n', long)]
wait_at_prompt: bool,
Expand Down Expand Up @@ -76,25 +60,6 @@ fn main() {
let mut gdb = Command::new("gdb");
gdb.arg(&binpath);

if args.serialise_compilation {
gdb.env("YKD_SERIALISE_COMPILATION", "1");
}

if args.log_jitstate {
gdb.env("YKD_LOG_JITSTATE", "1");
}

if let Some(irs) = args.log_ir {
gdb.env("YKD_LOG_IR", irs);
}

if let Some(num_breaks) = args.num_breaks {
gdb.args(["-ex", "set breakpoint pending on"]); // don't prompt for pending breaks.
for i in 0..num_breaks {
gdb.args(["-ex", &format!("b __yk_compiled_trace_{i}")]);
}
}

if !args.wait_at_prompt {
gdb.args(["-ex", "run"]);
}
Expand Down
2 changes: 1 addition & 1 deletion ykrt/src/compile/jitc_yk/codegen/x64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ impl<'a> Assemble<'a> {
[
// 64-bit (or 32-bit) signed division with idiv operates on RDX:RAX
// (EDX:EAX) and stores the remainder in RDX (EDX). We ignore the
// remainder stored into RAX (EAX).
// quotient stored into RAX (EAX).
RegConstraint::InputIntoRegAndClobber(lhs, Rq::RAX),
RegConstraint::Input(rhs),
RegConstraint::OutputFromReg(Rq::RDX),
Expand Down

0 comments on commit c9611c3

Please sign in to comment.