8000 Add Thread-ID to output by marpie · Pull Request #9 · gamozolabs/mesos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Thread-ID to output #9

New issue
8000

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions libs/debugger/src/debugger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ pub struct Debugger<'a> {

/// List of all PCs we hit during execution
/// Keyed by PC
/// Tuple is (module, offset, symbol+offset, frequency)
coverage: HashMap<usize, (Arc<String>, usize, String, u64)>,
/// Tuple is (module, offset, symbol+offset, frequency, threadid)
coverage: HashMap<usize, (Arc<String>, usize, String, u64, u32)>,

/// Set of DLL names and the corresponding DLL base
modules: HashSet<(String, usize)>,
Expand Down Expand Up @@ -679,7 +679,7 @@ impl<'a> Debugger<'a> {
let funcoff = format!("{}+0x{:x}", bp.funcname, bp.funcoff);

self.coverage.insert(addr,
(bp.modname.clone(), bp.offset, funcoff.clone(), 0));
(bp.modname.clone(), bp.offset, funcoff.clone(), 0, tid));
}

// Update coverage frequencies
Expand All @@ -693,10 +693,10 @@ impl<'a> Debugger<'a> {
if self.bp_print {
let funcoff = format!("{}+0x{:x}", bp.funcname, bp.funcoff);
mprint!(self, "{:8} of {:8} hit | {:10} freq | 0x{:x} | \
{:>20}+0x{:08x} | {}\n",
{:>20}+0x{:08x} | {} | {}\n",
self.coverage.len(), self.breakpoints.len(),
freq,
addr, bp.modname, bp.offset, funcoff);
addr, bp.modname, bp.offset, funcoff, tid);
}

self.get_context(tid);
Expand Down Expand Up @@ -841,11 +841,11 @@ impl<'a> Debugger<'a> {
File::create("coverage.txt")
.expect("Failed to open freq coverage file"));

for (pc, (module, offset, symoff, freq)) in self.coverage.iter() {
for (pc, (module, offset, symoff, freq, tid)) in self.coverage.iter() {
write!(fd,
"{:016x} | Freq: {:10} | \
{:>20}+0x{:08x} | {}\n",
pc, freq, module, offset, symoff)
{:>20}+0x{:08x} | {} | {}\n",
pc, freq, module, offset, symoff, tid)
.expect("Failed to write coverage info");
}

Expand Down Expand Up @@ -989,7 +989,7 @@ impl<'a> Debugger<'a> {
let filename = self.get_crash_filename(
&self.context, &mut exception.ExceptionRecord);

mprint!(self, "Got crash: {}\n", filename);
mprint!(self, "Got crash (ThreadID: {}): {}\n", tid, filename);

if !Path::new(&filename).is_file() {
// Remove all breakpoints in the program
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn main() {
if args.len() > 2 {
for (i, arg) in args[1..].iter().enumerate() {
if arg == "-p" {
pid = Some(arg.parse().unwrap());
pid = Some(args[i+2].parse().unwrap());
}
else if arg == "--verbose" {
verbose_mode_enabled = true;
Expand Down
0