Skip to content

Show local values - #84

Merged
nbaksalyar merged 15 commits into
headcrab-rs:masterfrom
bjorn3:dwarf_locals
Aug 15, 2020
Merged

Show local values#84
nbaksalyar merged 15 commits into
headcrab-rs:masterfrom
bjorn3:dwarf_locals

Conversation

@bjorn3

@bjorn3 bjorn3 commented Aug 14, 2020

Copy link
Copy Markdown
Contributor
Starting program: tests/testees/hello
Stopped(Pid(4471), SIGTRAP)
> _patch_breakpoint_function
> cont
Stopped(Pid(4471), SIGTRAP)
> si
Stopped(Pid(4471), SIGTRAP)
> si
Stopped(Pid(4471), SIGTRAP)
> si
Stopped(Pid(4471), SIGTRAP)
> bt
00005555555592db hello::main /home/bjorn/Documenten/headcrab/tests/testees/hello.rs:24
0000555555559396 std::rt::lang_start::{{closure}} /home/bjorn/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/rt.rs:67
0000555555562d68 std::panicking::try /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/panicking.rs:275
                 std::panic::catch_unwind /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/panic.rs:394
                 std::rt::lang_start_internal /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/rt.rs:51
> locals
00000000000052db hello::main /home/bjorn/Documenten/headcrab/tests/testees/hello.rs:24
     var = 42
     reg_var = const 43
_ZN5hello4main17hd078db076938ab99E:
DW_TAG_subprogram
  DW_AT_low_pc
  DW_AT_high_pc
  DW_AT_frame_base
  DW_AT_linkage_name
  DW_AT_name
  DW_AT_decl_file
  DW_AT_decl_line
  DW_AT_main_subprogram
  DW_TAG_lexical_block
[...]

@bjorn3
bjorn3 requested a review from nbaksalyar August 14, 2020 17:39

@nbaksalyar nbaksalyar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, thank you! The repl example is starting to feel like a real thing 馃帀

I left one minor comment about Frame::print_debuginfo, but since this PR is already huge, I think it's better to merge it sooner and address details afterwards.

Comment thread src/symbol/frame.rs
}

pub fn print_debuginfo(&self) {
println!(

@nbaksalyar nbaksalyar Aug 15, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later, we probably can replace this with impl<'a> fmt::Display for Frame<'a>, then it can be printed/formatted into a string.

@nbaksalyar
nbaksalyar merged commit 4eab929 into headcrab-rs:master Aug 15, 2020
@bjorn3
bjorn3 deleted the dwarf_locals branch August 16, 2020 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants