Replace tabs with spaces

This commit is contained in:
nemerle 2016-04-22 11:45:23 +02:00
parent b509d0fcf0
commit 5c85c92d1a
7 changed files with 28 additions and 27 deletions

View File

@ -5,18 +5,18 @@
#include <stdlib.h> #include <stdlib.h>
#include <vector> #include <vector>
#define SYMLEN 16 /* Number of chars in the symbol name, incl null */ #define SYMLEN 16 /* Number of chars in the symbol name, incl null */
#define PATLEN 23 /* Number of bytes in the pattern part */ #define PATLEN 23 /* Number of bytes in the pattern part */
struct HASHENTRY struct HASHENTRY
{ {
char name[SYMLEN]; /* The symbol name */ char name[SYMLEN]; /* The symbol name */
uint8_t pat [PATLEN]; /* The pattern */ uint8_t pat [PATLEN]; /* The pattern */
uint16_t offset; /* Offset (needed temporarily) */ uint16_t offset; /* Offset (needed temporarily) */
}; };
struct PatternCollector { struct PatternCollector {
uint8_t buf[100], bufSave[7]; /* Temp buffer for reading the file */ uint8_t buf[100], bufSave[7]; /* Temp buffer for reading the file */
uint16_t readShort(FILE *f) uint16_t readShort(FILE *f)
{ {
uint8_t b1, b2; uint8_t b1, b2;

View File

@ -59,10 +59,10 @@ public:
ICODE &front(); ICODE &front();
ICODE &back(); ICODE &back();
size_t size(); size_t size();
uint8_t nodeType; /* Type of node */ uint8_t nodeType; /* Type of node */
eDFS traversed; /* last traversal id is held here traversed yet? */ eDFS traversed; /* last traversal id is held here traversed yet? */
int numHlIcodes; /* No. of high-level icodes */ int numHlIcodes; /* No. of high-level icodes */
uint32_t flg; /* BB flags */ uint32_t flg; /* BB flags */
/* In edges and out edges */ /* In edges and out edges */
std::vector<BB *> inEdges; // does not own held pointers std::vector<BB *> inEdges; // does not own held pointers
@ -80,10 +80,10 @@ public:
interval *correspInt; //!< Corresponding interval in derived graph Gi-1 interval *correspInt; //!< Corresponding interval in derived graph Gi-1
// For live register analysis // For live register analysis
// LiveIn(b) = LiveUse(b) U (LiveOut(b) - Def(b)) // LiveIn(b) = LiveUse(b) U (LiveOut(b) - Def(b))
LivenessSet liveUse; /* LiveUse(b) */ LivenessSet liveUse; /* LiveUse(b) */
LivenessSet def; /* Def(b) */ LivenessSet def; /* Def(b) */
LivenessSet liveIn; /* LiveIn(b) */ LivenessSet liveIn; /* LiveIn(b) */
LivenessSet liveOut; /* LiveOut(b) */ LivenessSet liveOut; /* LiveOut(b) */
/* For structuring analysis */ /* For structuring analysis */
int dfsFirstNum; /* DFS #: first visit of node */ int dfsFirstNum; /* DFS #: first visit of node */

View File

@ -14,7 +14,7 @@ struct PROG /* Loaded program image parameters */
int cProcs; /* Number of procedures so far */ int cProcs; /* Number of procedures so far */
int offMain; /* The offset of the main() proc */ int offMain; /* The offset of the main() proc */
uint16_t segMain; /* The segment of the main() proc */ uint16_t segMain; /* The segment of the main() proc */
bool bSigs; /* True if signatures loaded */ bool bSigs; /* True if signatures loaded */
int cbImage; /* Length of image in bytes */ int cbImage; /* Length of image in bytes */
uint8_t * Imagez; /* Allocated by loader to hold entire program image */ uint8_t * Imagez; /* Allocated by loader to hold entire program image */
int addressingMode; int addressingMode;

View File

@ -544,8 +544,8 @@ public:
} }
}; };
icodeType type; /* Icode type */ icodeType type; /* Icode type */
DU_ICODE du; /* Def/use regs/vars */ DU_ICODE du; /* Def/use regs/vars */
DU1 du1; /* du chain 1 */ DU1 du1; /* du chain 1 */
int loc_ip; // used by CICodeRec to number ICODEs int loc_ip; // used by CICodeRec to number ICODEs
LLInst * ll() { return &m_ll;} LLInst * ll() { return &m_ll;}

View File

@ -638,7 +638,8 @@ void interactDis(Function * initProc, int initIC)
const char *procname = "UNKNOWN"; const char *procname = "UNKNOWN";
if(initProc) if(initProc)
procname = initProc->name.c_str(); procname = initProc->name.c_str();
printf("Wanted to start interactive disasassembler for %s at %x\n",procname,initIC);
printf("Wanted to start interactive disasassembler for %s:%d\n",procname,initIC);
return; return;
} }

View File

@ -8,10 +8,10 @@
using namespace std; using namespace std;
//Project g_proj; //Project g_proj;
QString asm1_name, asm2_name; /* Assembler output filenames */ QString asm1_name, asm2_name; /* Assembler output filenames */
SYMTAB symtab; /* Global symbol table */ SYMTAB symtab; /* Global symbol table */
STATS stats; /* cfg statistics */ STATS stats; /* cfg statistics */
//PROG prog; /* programs fields */ //PROG prog; /* programs fields */
OPTION option; /* Command line options */ OPTION option; /* Command line options */
Project *Project::s_instance = nullptr; Project *Project::s_instance = nullptr;
Project::Project() : callGraph(nullptr) Project::Project() : callGraph(nullptr)
{ {

View File

@ -210,7 +210,7 @@ static int longJCond22 (Assignment &asgn, iICODE pIcode,iICODE pEnd)
iter=std::find(tbb->inEdges.begin(),tbb->inEdges.end(),obb1); iter=std::find(tbb->inEdges.begin(),tbb->inEdges.end(),obb1);
assert(iter!=tbb->inEdges.end()); assert(iter!=tbb->inEdges.end());
tbb->inEdges.erase(iter); tbb->inEdges.erase(iter);
if (icodes[3]->ll()->getOpcode() == iJE) /* replace */ if (icodes[3]->ll()->getOpcode() == iJE) /* replace */
tbb->inEdges.push_back(pbb); tbb->inEdges.push_back(pbb);
/* Update statistics */ /* Update statistics */
@ -264,9 +264,9 @@ void Function::propLongStk (int i, const ID &pLocId)
condOp oper = DUMMY; condOp oper = DUMMY;
switch (pIcode->ll()->getOpcode()) switch (pIcode->ll()->getOpcode())
{ {
case iAND: oper=AND; break; case iAND: oper=AND; break;
case iOR: oper=OR; break; case iOR: oper=OR; break;
case iXOR: oper=XOR; break; case iXOR: oper=XOR; break;
} }
if(DUMMY!=oper) if(DUMMY!=oper)
{ {
@ -503,7 +503,7 @@ int Function::findForwardLongUses(int loc_ident_idx, const ID &pLocId, iICODE be
if (pLocId.longId().srcDstRegMatch(pIcode,pIcode)) if (pLocId.longId().srcDstRegMatch(pIcode,pIcode))
{ {
asgn.lhs = AstIdent::LongIdx (loc_ident_idx); asgn.lhs = AstIdent::LongIdx (loc_ident_idx);
asgn.rhs = new Constant(0, 4); /* long 0 */ asgn.rhs = new Constant(0, 4); /* long 0 */
asgn.lhs = new BinaryOperator(condOpJCond[next1->ll()->getOpcode() - iJB],asgn.lhs, asgn.rhs); asgn.lhs = new BinaryOperator(condOpJCond[next1->ll()->getOpcode() - iJB],asgn.lhs, asgn.rhs);
next1->setJCond(asgn.lhs); next1->setJCond(asgn.lhs);
next1->copyDU(*pIcode, eUSE, eUSE); next1->copyDU(*pIcode, eUSE, eUSE);