Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • opensrc/SMPStaticAnalyzer
1 result
Show changes
Commits on Source (2)
[submodule "libehp"]
path = libehp
url = http://git.zephyr-software.com/opensrc/libehp
......@@ -62,8 +62,7 @@ class STARS_IRDB_Instruction_t : public STARS_Instruction_t
// see .cpp
virtual uint16_t GetIDAOpcode(void);
virtual STARS_InstructionID_t GetNextInstructionID(void) const
{ return STARS_InstructionID_t(irdb_insn->GetFallthrough()->GetBaseID()); }
virtual STARS_InstructionID_t GetNextInstructionID(void) const;
virtual STARS_InstructionID_t GetTargetInstructionID(void) const
{ return STARS_InstructionID_t(irdb_insn->GetTarget()->GetBaseID()); }
......
libehp @ f1a844b0
Subproject commit f1a844b025aae92d6b32f174fa246b621be32982
......@@ -22,6 +22,8 @@
#include <xref.hpp>
#endif
#include <funcs.hpp>
#if (IDA_SDK_VERSION < 700)
#include <area.hpp>
#else
......@@ -455,24 +457,24 @@ bool STARS_IDA_Interface_t::AuditEHFunctionBoundaries(void) const {
// Use the FDEs (Frame Descriptor Entries) from the eh_frame section
// to perform the same algorithm as above: an FDE should contain only one func.
const auto & EHParser = EHFrameParser_t::factory(global_STARS_program->GetRootFileName());
for (auto &FDEvecptr : EHParser->getFDEs()) {
for (auto &FDEveciter = FDEvecptr->begin(); FDEveciter != FDEvecptr->end(); ++FDEveciter) {
uint64_t startAddr = (*FDEveciter)->getStartAddress();
uint64_t endAddr = (*FDEveciter)->getEndAddress();
// See if start and end of FDE landing pad are in the same func.
STARS_ea_t CurrStartEA = (STARS_ea_t) startAddr;
STARS_ea_t CurrEndEA = (STARS_ea_t) endAddr;
STARS_Function_t *StartFunc = SMP_get_func(CurrStartEA);
STARS_Function_t *EndFunc = SMP_get_func(CurrEndEA - 1);
if (StartFunc != EndFunc) {
ProblemFound = true;
SMP_msg("ERROR: FUNCBOUNDS: FDE range from %llx to %llx spans functions\n",
(uint64_t) CurrStartEA, (uint64_t) (CurrEndEA - 1));
}
const auto FDEvecptr = EHParser->getFDEs();
for (const auto FDEveciter : *FDEvecptr) {
uint64_t startAddr = FDEveciter->getStartAddress();
uint64_t endAddr = FDEveciter->getEndAddress();
// See if start and end of FDE landing pad are in the same IDA Pro func.
STARS_ea_t CurrStartEA = (STARS_ea_t) startAddr;
STARS_ea_t CurrEndEA = (STARS_ea_t) endAddr;
func_t *StartFunc = ::get_func(CurrStartEA);
func_t *EndFunc = ::get_func(CurrEndEA - 1);
if (StartFunc != EndFunc) {
ProblemFound = true;
SMP_msg("ERROR: FUNCBOUNDS: FDE range from %llx to %llx spans functions\n",
(uint64_t) CurrStartEA, (uint64_t) (CurrEndEA - 1));
}
}
} // end for (const auto FDEveciter : *FDEvecptr)
#endif
return ProblemFound;
......
......@@ -17,6 +17,18 @@ static uint32_t UseMacros[STARS_UA_MAXOP] = {STARS_CF_USE1, STARS_CF_USE2, STARS
static uint32_t DefMacros[STARS_UA_MAXOP] = {STARS_CF_CHG1, STARS_CF_CHG2, STARS_CF_CHG3, STARS_CF_CHG4, STARS_CF_CHG5, STARS_CF_CHG6};
STARS_InstructionID_t STARS_IRDB_Instruction_t::GetNextInstructionID(void) const
{
Instruction_t *FallthroughID = irdb_insn->GetFallthrough();
if (nullptr == FallthroughID) {
// For robustness, permit a no-op to have no fall through inst.
cerr << "ERROR: No fallthrough inst in GetNextInstructionID()" << endl;
return STARS_InstructionID_t(STARS_BADADDR);
}
else {
return STARS_InstructionID_t(FallthroughID->GetBaseID());
}
}
uint16_t STARS_IRDB_Instruction_t::GetIDAOpcode(void)
{
......