Remove debug output
This commit is contained in:
parent
0eb6cad1ba
commit
f25093ffce
2 changed files with 0 additions and 30 deletions
|
@ -126,18 +126,14 @@ DwarfInterpret::reg_content_t DwarfInterpret::interpret_dw_register(
|
||||||
assert(dwarf_regnum != DW_FRAME_CFA_COL3);
|
assert(dwarf_regnum != DW_FRAME_CFA_COL3);
|
||||||
|
|
||||||
reg_content_t cpu_content = 9;
|
reg_content_t cpu_content = 9;
|
||||||
cerr << "@@ Interpreting register ";
|
|
||||||
switch(dwarf_regnum) {
|
switch(dwarf_regnum) {
|
||||||
case lib::DWARF_X86_64_RIP:
|
case lib::DWARF_X86_64_RIP:
|
||||||
cerr << "RIP";
|
|
||||||
cpu_content = (reg_content_t) ctx.rip;
|
cpu_content = (reg_content_t) ctx.rip;
|
||||||
break;
|
break;
|
||||||
case lib::DWARF_X86_64_RBP:
|
case lib::DWARF_X86_64_RBP:
|
||||||
cerr << "RBP";
|
|
||||||
cpu_content = (reg_content_t) ctx.rbp;
|
cpu_content = (reg_content_t) ctx.rbp;
|
||||||
break;
|
break;
|
||||||
case lib::DWARF_X86_64_RSP:
|
case lib::DWARF_X86_64_RSP:
|
||||||
cerr << "RSP";
|
|
||||||
cpu_content = (reg_content_t) ctx.rsp;
|
cpu_content = (reg_content_t) ctx.rsp;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -146,11 +142,6 @@ DwarfInterpret::reg_content_t DwarfInterpret::interpret_dw_register(
|
||||||
reg_content_t addr =
|
reg_content_t addr =
|
||||||
cpu_content + reg.register_plus_offset_r().second;
|
cpu_content + reg.register_plus_offset_r().second;
|
||||||
|
|
||||||
cerr << " = " << hex
|
|
||||||
<< cpu_content << " + offset = " << addr //<< " -> " << *addr
|
|
||||||
<< dec << endl;
|
|
||||||
|
|
||||||
|
|
||||||
return addr;
|
return addr;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -160,11 +151,6 @@ DwarfInterpret::reg_content_t DwarfInterpret::interpret_dw_register(
|
||||||
int cfa_offset = reg.saved_at_offset_from_cfa_r();
|
int cfa_offset = reg.saved_at_offset_from_cfa_r();
|
||||||
reg_content_t addr = cfa_loc + cfa_offset;
|
reg_content_t addr = cfa_loc + cfa_offset;
|
||||||
reg_content_t value = *((reg_content_t*) addr);
|
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;
|
return value;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -194,12 +180,6 @@ DwarfInterpret::UnwindContext DwarfInterpret::get_current_unwind_context() {
|
||||||
get_cpu_register(REG_RSP, ctx.rsp);
|
get_cpu_register(REG_RSP, ctx.rsp);
|
||||||
get_cpu_register(REG_RBP, ctx.rbp);
|
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);
|
DwarfInterpret& dw = DwarfInterpret::acquire(ctx.rip);
|
||||||
|
|
||||||
return dw.unwind_context(ctx);
|
return dw.unwind_context(ctx);
|
||||||
|
@ -216,10 +196,6 @@ DwarfInterpret::UnwindContext DwarfInterpret::unwind_context(
|
||||||
DwarfRow cur_row = dwarf_row_at(ctx.rip);
|
DwarfRow cur_row = dwarf_row_at(ctx.rip);
|
||||||
const core::Cie& cie = *cie_at(ctx.rip);
|
const core::Cie& cie = *cie_at(ctx.rip);
|
||||||
UnwindContext new_context;
|
UnwindContext new_context;
|
||||||
cerr << "Obtaining previous context as reg "
|
|
||||||
<< cie.get_return_address_register_rule()
|
|
||||||
<< " at current IP = "
|
|
||||||
<< hex << ctx.rip << endl;
|
|
||||||
try {
|
try {
|
||||||
new_context.rip = interpret_dw_register(
|
new_context.rip = interpret_dw_register(
|
||||||
cur_row,
|
cur_row,
|
||||||
|
@ -229,7 +205,6 @@ DwarfInterpret::UnwindContext DwarfInterpret::unwind_context(
|
||||||
// An undefined RA means we've reached the end of the call stack
|
// An undefined RA means we've reached the end of the call stack
|
||||||
throw FirstUnwindFrame();
|
throw FirstUnwindFrame();
|
||||||
}
|
}
|
||||||
cerr << "Yielding " << hex << new_context.rip << dec << endl;
|
|
||||||
new_context.rbp = interpret_dw_register(
|
new_context.rbp = interpret_dw_register(
|
||||||
cur_row,
|
cur_row,
|
||||||
lib::DWARF_X86_64_RBP,
|
lib::DWARF_X86_64_RBP,
|
||||||
|
@ -284,9 +259,6 @@ const core::FrameSection::fde_iterator DwarfInterpret::fde_at(
|
||||||
if(responsible != nullptr)
|
if(responsible != nullptr)
|
||||||
return responsible->fde_at(pc);
|
return responsible->fde_at(pc);
|
||||||
|
|
||||||
cerr << "Extracting FDE with ";
|
|
||||||
map_entry.dump(cerr);
|
|
||||||
|
|
||||||
const core::FrameSection& fs = root_die->get_frame_section();
|
const core::FrameSection& fs = root_die->get_frame_section();
|
||||||
uintptr_t translated_pc = pc - pc_offset;
|
uintptr_t translated_pc = pc - pc_offset;
|
||||||
const auto& fde_it = fs.find_fde_for_pc(translated_pc);
|
const auto& fde_it = fs.find_fde_for_pc(translated_pc);
|
||||||
|
|
|
@ -25,7 +25,6 @@ MemoryMap::MemoryMap() {
|
||||||
|
|
||||||
string line;
|
string line;
|
||||||
while(getline(handle, line).good()) {
|
while(getline(handle, line).good()) {
|
||||||
cerr << "## " << line << endl;
|
|
||||||
istringstream lstream(line);
|
istringstream lstream(line);
|
||||||
MapEntry entry;
|
MapEntry entry;
|
||||||
uintptr_t discard;
|
uintptr_t discard;
|
||||||
|
@ -51,7 +50,6 @@ MemoryMap::MemoryMap() {
|
||||||
rev_addr_map.insert(make_pair(entry.mem_region, map_entries.size()));
|
rev_addr_map.insert(make_pair(entry.mem_region, map_entries.size()));
|
||||||
map_entries.push_back(entry);
|
map_entries.push_back(entry);
|
||||||
}
|
}
|
||||||
cerr << endl;
|
|
||||||
|
|
||||||
handle.close();
|
handle.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue