#include <dwarfFrameParser.h>
Public Types | |
typedef boost::shared_ptr < DwarfFrameParser > | Ptr |
Public Member Functions | |
DwarfFrameParser (Dwarf_Debug dbg_, Architecture arch) | |
~DwarfFrameParser () | |
bool | hasFrameDebugInfo () |
bool | getRegRepAtFrame (Address pc, MachRegister reg, VariableLocation &loc, FrameErrors_t &err_result) |
bool | getRegValueAtFrame (Address pc, MachRegister reg, MachRegisterVal ®_result, ProcessReader *reader, FrameErrors_t &err_result) |
bool | getRegAtFrame (Address pc, MachRegister reg, DwarfResult &cons, FrameErrors_t &err_result) |
bool | getRegsForFunction (Address entryPC, MachRegister reg, std::vector< VariableLocation > &locs, FrameErrors_t &err_result) |
Static Public Member Functions | |
static Ptr | create (Dwarf_Debug dbg, Architecture arch) |
Private Types | |
enum | dwarf_status_t { dwarf_status_uninitialized, dwarf_status_error, dwarf_status_ok } |
Private Member Functions | |
bool | getRegAtFrame_aux (Address pc, Dwarf_Fde fde, Dwarf_Half dwarf_reg, MachRegister orig_reg, DwarfResult &cons, Address &lowpc, FrameErrors_t &err_result) |
bool | getFDE (Address pc, Dwarf_Fde &fde, Address &low, Address &high, FrameErrors_t &err_result) |
bool | getDwarfReg (MachRegister reg, Dwarf_Fde &fde, Dwarf_Half &dwarf_reg, FrameErrors_t &err_result) |
bool | handleExpression (Address pc, Dwarf_Signed registerNum, MachRegister origReg, Architecture arch, DwarfResult &cons, bool &done, FrameErrors_t &err_result) |
void | setupFdeData () |
Private Attributes | |
Dwarf_Debug | dbg |
Architecture | arch |
dwarf_status_t | fde_dwarf_status |
std::vector< fde_cie_data > | fde_data |
Static Private Attributes | |
static std::map< Dwarf_Debug, Ptr > | frameParsers |
Definition at line 63 of file dwarfFrameParser.h.
typedef boost::shared_ptr<DwarfFrameParser> Dyninst::Dwarf::DwarfFrameParser::Ptr |
Definition at line 66 of file dwarfFrameParser.h.
enum Dyninst::Dwarf::DwarfFrameParser::dwarf_status_t [private] |
Definition at line 132 of file dwarfFrameParser.h.
DwarfFrameParser::DwarfFrameParser | ( | Dwarf_Debug | dbg_, | |
Architecture | arch | |||
) |
Definition at line 61 of file dwarfFrameParser.C.
Referenced by create().
DwarfFrameParser::~DwarfFrameParser | ( | ) |
Definition at line 68 of file dwarfFrameParser.C.
References dbg, dwarf_status_ok, fde_data, and fde_dwarf_status.
DwarfFrameParser::Ptr DwarfFrameParser::create | ( | Dwarf_Debug | dbg, | |
Architecture | arch | |||
) | [static] |
Definition at line 47 of file dwarfFrameParser.C.
References DwarfFrameParser(), and frameParsers.
Referenced by Dyninst::SymtabAPI::Function::expandLocation(), Dyninst::Dwarf::DwarfHandle::init_dbg(), and Dyninst::Dwarf::ConcreteDwarfResult::pushCFA().
bool DwarfFrameParser::getDwarfReg | ( | Dyninst::MachRegister | reg, | |
Dwarf_Fde & | fde, | |||
Dwarf_Half & | dwarf_reg, | |||
FrameErrors_t & | err_result | |||
) | [private] |
We should be getting the return address for the stack frame. This is treated as a virtual register in the FDE. We can look up the virtual register in the CIE.
Definition at line 453 of file dwarfFrameParser.C.
References DW_FRAME_CFA_COL3, Dyninst::Dwarf::FE_Bad_Frame_Data, and Dyninst::MachRegister::getDwarfEnc().
Referenced by getRegAtFrame(), and getRegsForFunction().
bool DwarfFrameParser::getFDE | ( | Address | pc, | |
Dwarf_Fde & | fde, | |||
Address & | low, | |||
Address & | high, | |||
FrameErrors_t & | err_result | |||
) | [private] |
Definition at line 416 of file dwarfFrameParser.C.
References dwarf_printf, fde_data, Dyninst::Dwarf::FE_Bad_Frame_Data, and Dyninst::Dwarf::FE_No_Frame_Entry.
Referenced by getRegAtFrame(), and getRegsForFunction().
bool DwarfFrameParser::getRegAtFrame | ( | Address | pc, | |
Dyninst::MachRegister | reg, | |||
DwarfResult & | cons, | |||
FrameErrors_t & | err_result | |||
) |
Initialize the FDE and CIE data. This is only really done once, after which setupFdeData will immediately return.
Get the FDE at this PC. The FDE contains the rules for getting registers at the given PC in this frame.
Definition at line 203 of file dwarfFrameParser.C.
References dwarf_printf, fde_data, Dyninst::Dwarf::FE_Bad_Frame_Data, Dyninst::Dwarf::FE_No_Error, getDwarfReg(), getFDE(), getRegAtFrame_aux(), Dyninst::MachRegister::name(), and setupFdeData().
Referenced by getRegRepAtFrame(), getRegValueAtFrame(), and handleExpression().
bool DwarfFrameParser::getRegAtFrame_aux | ( | Address | pc, | |
Dwarf_Fde | fde, | |||
Dwarf_Half | dwarf_reg, | |||
MachRegister | orig_reg, | |||
DwarfResult & | cons, | |||
Address & | lowpc, | |||
FrameErrors_t & | err_result | |||
) | [private] |
Decode the rule that describes how to get dwarf_reg at pc.
Interpret the rule and turn it into a real value.
Definition at line 246 of file dwarfFrameParser.C.
References Dyninst::Dwarf::DwarfResult::Add, arch, dbg, Dyninst::Dwarf::decodeDwarfExpression(), Dyninst::Dwarf::DwarfResult::Deref, DW_FRAME_CFA_COL3, dwarf_get_fde_info_for_cfa_reg3(), dwarf_printf, Dyninst::Dwarf::FE_Bad_Frame_Data, Dyninst::Dwarf::FE_Frame_Eval_Error, Dyninst::Dwarf::FE_Frame_Read_Error, Dyninst::Dwarf::FE_No_Error, Dyninst::getArchAddressWidth(), handleExpression(), Dyninst::Dwarf::DwarfResult::pushOp(), and Dyninst::Dwarf::DwarfResult::pushSignedVal().
Referenced by getRegAtFrame(), and getRegsForFunction().
bool DwarfFrameParser::getRegRepAtFrame | ( | Address | pc, | |
Dyninst::MachRegister | reg, | |||
VariableLocation & | loc, | |||
FrameErrors_t & | err_result | |||
) |
Definition at line 113 of file dwarfFrameParser.C.
References arch, dwarf_printf, Dyninst::Dwarf::DwarfResult::err(), Dyninst::Dwarf::FE_Frame_Eval_Error, Dyninst::Dwarf::FE_No_Error, getRegAtFrame(), Dyninst::MachRegister::name(), and Dyninst::Dwarf::SymbolicDwarfResult::val().
bool DwarfFrameParser::getRegsForFunction | ( | Address | entryPC, | |
Dyninst::MachRegister | reg, | |||
std::vector< VariableLocation > & | locs, | |||
FrameErrors_t & | err_result | |||
) |
Initialize the FDE and CIE data. This is only really done once, after which setupFdeData will immediately return.
Get the FDE at this PC. The FDE contains the rules for getting registers at the given PC in this frame.
Definition at line 141 of file dwarfFrameParser.C.
References arch, dwarf_printf, fde_data, Dyninst::Dwarf::FE_Bad_Frame_Data, Dyninst::Dwarf::FE_No_Error, getDwarfReg(), getFDE(), getRegAtFrame_aux(), Dyninst::MachRegister::name(), setupFdeData(), and Dyninst::Dwarf::SymbolicDwarfResult::val().
bool DwarfFrameParser::getRegValueAtFrame | ( | Address | pc, | |
Dyninst::MachRegister | reg, | |||
Dyninst::MachRegisterVal & | reg_result, | |||
ProcessReader * | reader, | |||
FrameErrors_t & | err_result | |||
) |
Definition at line 86 of file dwarfFrameParser.C.
References arch, dbg, dwarf_printf, Dyninst::Dwarf::DwarfResult::err(), Dyninst::Dwarf::FE_Frame_Eval_Error, Dyninst::Dwarf::FE_No_Error, getRegAtFrame(), Dyninst::MachRegister::name(), and Dyninst::Dwarf::ConcreteDwarfResult::val().
bool DwarfFrameParser::handleExpression | ( | Address | pc, | |
Dwarf_Signed | registerNum, | |||
Dyninst::MachRegister | origReg, | |||
Dyninst::Architecture | arch, | |||
DwarfResult & | cons, | |||
bool & | done, | |||
FrameErrors_t & | err_result | |||
) | [private] |
Definition at line 488 of file dwarfFrameParser.C.
References DW_FRAME_CFA_COL3, dwarf_printf, Dyninst::MachRegister::DwarfEncToReg(), Dyninst::Dwarf::FE_No_Error, getRegAtFrame(), Dyninst::MachRegister::name(), and Dyninst::Dwarf::DwarfResult::readReg().
Referenced by getRegAtFrame_aux().
bool DwarfFrameParser::hasFrameDebugInfo | ( | ) |
Definition at line 80 of file dwarfFrameParser.C.
References dwarf_status_ok, fde_dwarf_status, and setupFdeData().
void DwarfFrameParser::setupFdeData | ( | ) | [private] |
Definition at line 374 of file dwarfFrameParser.C.
References Dyninst::Dwarf::fde_cie_data::cie_count, Dyninst::Dwarf::fde_cie_data::cie_data, dbg, DW_FRAME_CFA_COL3, dwarf_status_error, dwarf_status_ok, Dyninst::Dwarf::fde_cie_data::fde_count, fde_data, Dyninst::Dwarf::fde_cie_data::fde_data, and fde_dwarf_status.
Referenced by getRegAtFrame(), getRegsForFunction(), and hasFrameDebugInfo().
Definition at line 138 of file dwarfFrameParser.h.
Referenced by getRegAtFrame_aux(), getRegRepAtFrame(), getRegsForFunction(), and getRegValueAtFrame().
Dwarf_Debug Dyninst::Dwarf::DwarfFrameParser::dbg [private] |
Definition at line 137 of file dwarfFrameParser.h.
Referenced by getRegAtFrame_aux(), getRegValueAtFrame(), setupFdeData(), and ~DwarfFrameParser().
std::vector<fde_cie_data> Dyninst::Dwarf::DwarfFrameParser::fde_data [private] |
Definition at line 141 of file dwarfFrameParser.h.
Referenced by getFDE(), getRegAtFrame(), getRegsForFunction(), setupFdeData(), and ~DwarfFrameParser().
Definition at line 139 of file dwarfFrameParser.h.
Referenced by hasFrameDebugInfo(), setupFdeData(), and ~DwarfFrameParser().
std::map< Dwarf_Debug, DwarfFrameParser::Ptr > DwarfFrameParser::frameParsers [static, private] |
Definition at line 130 of file dwarfFrameParser.h.
Referenced by create().