From f25093ffce3c562c509cca07df3a58980228e5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Wed, 11 Apr 2018 17:07:50 +0200 Subject: [PATCH] Remove debug output --- src/DwarfInterpret.cpp | 28 ---------------------------- src/MemoryMap.cpp | 2 -- 2 files changed, 30 deletions(-) diff --git a/src/DwarfInterpret.cpp b/src/DwarfInterpret.cpp index 796b9ee..e58398c 100644 --- a/src/DwarfInterpret.cpp +++ b/src/DwarfInterpret.cpp @@ -126,18 +126,14 @@ DwarfInterpret::reg_content_t DwarfInterpret::interpret_dw_register( assert(dwarf_regnum != DW_FRAME_CFA_COL3); reg_content_t cpu_content = 9; - cerr << "@@ Interpreting register "; switch(dwarf_regnum) { case lib::DWARF_X86_64_RIP: - cerr << "RIP"; cpu_content = (reg_content_t) ctx.rip; break; case lib::DWARF_X86_64_RBP: - cerr << "RBP"; cpu_content = (reg_content_t) ctx.rbp; break; case lib::DWARF_X86_64_RSP: - cerr << "RSP"; cpu_content = (reg_content_t) ctx.rsp; break; default: @@ -146,11 +142,6 @@ DwarfInterpret::reg_content_t DwarfInterpret::interpret_dw_register( reg_content_t addr = cpu_content + reg.register_plus_offset_r().second; - cerr << " = " << hex - << cpu_content << " + offset = " << addr //<< " -> " << *addr - << dec << endl; - - return addr; } break; @@ -160,11 +151,6 @@ DwarfInterpret::reg_content_t DwarfInterpret::interpret_dw_register( int cfa_offset = reg.saved_at_offset_from_cfa_r(); reg_content_t addr = cfa_loc + cfa_offset; reg_content_t value = *((reg_content_t*) addr); - cerr << "@@ Interpreting CFA offset: CFA is " << hex - << cfa_loc << " + offset " << dec << cfa_offset << hex - << " = " << addr - << " -> " << value - << dec << endl; return value; } break; @@ -194,12 +180,6 @@ DwarfInterpret::UnwindContext DwarfInterpret::get_current_unwind_context() { get_cpu_register(REG_RSP, ctx.rsp); get_cpu_register(REG_RBP, ctx.rbp); - cerr << "CREATING CONTEXT. %rsp=0x" << hex - << ctx.rsp - << ", %rbp=0x" << ctx.rbp - << ", %rip=0x" << ctx.rip - << dec << endl; - DwarfInterpret& dw = DwarfInterpret::acquire(ctx.rip); return dw.unwind_context(ctx); @@ -216,10 +196,6 @@ DwarfInterpret::UnwindContext DwarfInterpret::unwind_context( DwarfRow cur_row = dwarf_row_at(ctx.rip); const core::Cie& cie = *cie_at(ctx.rip); UnwindContext new_context; - cerr << "Obtaining previous context as reg " - << cie.get_return_address_register_rule() - << " at current IP = " - << hex << ctx.rip << endl; try { new_context.rip = interpret_dw_register( cur_row, @@ -229,7 +205,6 @@ DwarfInterpret::UnwindContext DwarfInterpret::unwind_context( // An undefined RA means we've reached the end of the call stack throw FirstUnwindFrame(); } - cerr << "Yielding " << hex << new_context.rip << dec << endl; new_context.rbp = interpret_dw_register( cur_row, lib::DWARF_X86_64_RBP, @@ -284,9 +259,6 @@ const core::FrameSection::fde_iterator DwarfInterpret::fde_at( if(responsible != nullptr) return responsible->fde_at(pc); - cerr << "Extracting FDE with "; - map_entry.dump(cerr); - const core::FrameSection& fs = root_die->get_frame_section(); uintptr_t translated_pc = pc - pc_offset; const auto& fde_it = fs.find_fde_for_pc(translated_pc); diff --git a/src/MemoryMap.cpp b/src/MemoryMap.cpp index d688192..140c18f 100644 --- a/src/MemoryMap.cpp +++ b/src/MemoryMap.cpp @@ -25,7 +25,6 @@ MemoryMap::MemoryMap() { string line; while(getline(handle, line).good()) { - cerr << "## " << line << endl; istringstream lstream(line); MapEntry entry; uintptr_t discard; @@ -51,7 +50,6 @@ MemoryMap::MemoryMap() { rev_addr_map.insert(make_pair(entry.mem_region, map_entries.size())); map_entries.push_back(entry); } - cerr << endl; handle.close(); }