diff --git a/src/base/SMPFunction.cpp b/src/base/SMPFunction.cpp index b9d9e40579268f9fb50580e7b6fe17f2632d3c07..54488ec69f6dd1babc091ab3b57067abe02910d6 100644 --- a/src/base/SMPFunction.cpp +++ b/src/base/SMPFunction.cpp @@ -14152,6 +14152,13 @@ void SMPFunction::EmitAnnotations(FILE *AnnotFile, FILE *InfoAnnotFile) { DeallocTrigger = false; } CurrInst->EmitAnnotations(this->UseFP, AllocSeen, this->NeedsStackReferent, AnnotFile, InfoAnnotFile); + + // Emit annotations for IDA Pro switch table analyses. + SMPitype CurrDataFlow = CurrInst->GetDataFlowType(); + if (CurrDataFlow == INDIR_JUMP) { + global_STARS_program->PrintAllCodeToCodeXrefs(addr, CurrInst->GetSize(), false, false); + } + } // end for all instructions // Free memory for the memory-constrained reduced analysis case. diff --git a/src/base/SMPInstr.cpp b/src/base/SMPInstr.cpp index 3ad82c934c602fb9624b4ee90cb1ddad5b74693c..94a3f7662a92c52400f895918ec6ea54e65b8c3f 100644 --- a/src/base/SMPInstr.cpp +++ b/src/base/SMPInstr.cpp @@ -1228,7 +1228,11 @@ SMPRegTransfer::~SMPRegTransfer() { // Get the left operand, and normalize it if it is a stack operand. STARSOpndTypePtr SMPRegTransfer::GetLeftOperand(void) const { STARSOpndTypePtr TempOp = this->LeftOperand; +#if 0 if (this->ParentInst->AreDefsNormalized() && (0 != this->ParentInst->GetStackPtrOffset())) { +#else + if (this->ParentInst->AreDefsNormalized()) { +#endif STARS_ea_t InstAddr = this->ParentInst->GetAddr(); TempOp = this->ParentInst->GetBlock()->GetFunc()->GetNormalizedOperand(InstAddr, TempOp); } @@ -1238,7 +1242,11 @@ STARSOpndTypePtr SMPRegTransfer::GetLeftOperand(void) const { // Get the right operand, and normalize it if it is a stack operand. STARSOpndTypePtr SMPRegTransfer::GetRightOperand(void) const { STARSOpndTypePtr TempOp = this->RightOperand; +#if 0 if (this->ParentInst->AreDefsNormalized() && (0 != this->ParentInst->GetStackPtrOffset())) { +#else + if (this->ParentInst->AreDefsNormalized()) { +#endif STARS_ea_t InstAddr = this->ParentInst->GetAddr(); TempOp = this->ParentInst->GetBlock()->GetFunc()->GetNormalizedOperand(InstAddr, TempOp); } diff --git a/src/drivers/idapro/SMPStaticAnalyzer.cpp b/src/drivers/idapro/SMPStaticAnalyzer.cpp index 2d621b5c3d5718706db540121931e59f6dafbd09..40d7e473c6a5bc4f9a849eff31416cab16e6d646 100644 --- a/src/drivers/idapro/SMPStaticAnalyzer.cpp +++ b/src/drivers/idapro/SMPStaticAnalyzer.cpp @@ -63,7 +63,7 @@ using namespace std; -#define SMP_DEBUG_DELAY 0 // for setting an early breakpoint to attach gdb +#define SMP_DEBUG_DELAY 0 // for setting an early breakpoint // Set to 1 for debugging output #define SMP_DEBUG 1 @@ -87,7 +87,7 @@ int FuncsProcessed = 0; #define SMP_IDAP_RUN_DELAY 0 // Delay in IDAP_run() so we can attach debugger to process. -#define STARS_GENERATE_ASM_FILE 1 // Generate ASM file at end of processing? +#define STARS_GENERATE_ASM_FILE 0 // Generate ASM file at end of processing? #define STARS_GENERATE_DIF_FILE STARS_SCCP_CONVERT_UNREACHABLE_BLOCKS // If we optimize, generate DIF file typedef op_t STARSOpndType; @@ -352,7 +352,7 @@ bool IDAP_run(size_t arg) { time_t current; time(&start); - SMP_msg("debug delay for 15 seconds.\n"); + SMP_msg("delay for 15 seconds.\n"); printf("delay for 15 seconds.\n"); do { time(¤t);