Merge remote-tracking branch 'origin/GT-2752_caheckman'

This commit is contained in:
ghidravore 2019-04-16 14:51:20 -04:00
commit fb4f89445a
11 changed files with 20 additions and 18 deletions

View file

@ -116,8 +116,6 @@ public:
class Architecture : public AddrSpaceManager { class Architecture : public AddrSpaceManager {
public: public:
string archid; ///< ID string uniquely describing this architecture string archid; ///< ID string uniquely describing this architecture
string description; ///< Description of architecture
string version; ///< Configuration version
// Configuration data // Configuration data
int4 trim_recurse_max; ///< How many levels to let parameter trims recurse int4 trim_recurse_max; ///< How many levels to let parameter trims recurse
@ -178,6 +176,8 @@ public:
void restoreFlowOverride(const Element *el); ///< Set flow overrides from XML void restoreFlowOverride(const Element *el); ///< Set flow overrides from XML
virtual ~Architecture(void); ///< Destructor virtual ~Architecture(void); ///< Destructor
virtual string getDescription(void) const { return archid; } ///< Get a string describing \b this architecture
/// \brief Print an error message to console /// \brief Print an error message to console
/// ///
/// Write the given message to whatever the registered error stream is /// Write the given message to whatever the registered error stream is

View file

@ -100,7 +100,7 @@ void IfcLoadFile::execute(istream &s)
#ifdef OPACTION_DEBUG #ifdef OPACTION_DEBUG
dcp->conf->setDebugStream(status->optr); dcp->conf->setDebugStream(status->optr);
#endif #endif
*status->optr << filename << " successfully loaded: " << dcp->conf->description << endl; *status->optr << filename << " successfully loaded: " << dcp->conf->getDescription() << endl;
} }
void IfcAddpath::execute(istream &s) void IfcAddpath::execute(istream &s)
@ -162,7 +162,7 @@ void IfcRestore::execute(istream &s)
#ifdef OPACTION_DEBUG #ifdef OPACTION_DEBUG
dcp->conf->setDebugStream(status->optr); dcp->conf->setDebugStream(status->optr);
#endif #endif
*status->optr << savefile << " successfully loaded: " << dcp->conf->description << endl; *status->optr << savefile << " successfully loaded: " << dcp->conf->getDescription() << endl;
} }
int main(int argc,char **argv) int main(int argc,char **argv)

View file

@ -2282,7 +2282,7 @@ ProtoStoreSymbol::ProtoStoreSymbol(Scope *sc,const Address &usepoint)
ParameterPieces pieces; ParameterPieces pieces;
pieces.type = scope->getArch()->types->getTypeVoid(); pieces.type = scope->getArch()->types->getTypeVoid();
pieces.flags = 0; pieces.flags = 0;
setOutput(pieces); ProtoStoreSymbol::setOutput(pieces);
} }
ProtoStoreSymbol::~ProtoStoreSymbol(void) ProtoStoreSymbol::~ProtoStoreSymbol(void)
@ -2465,7 +2465,7 @@ ProtoStoreInternal::ProtoStoreInternal(Datatype *vt)
ParameterPieces pieces; ParameterPieces pieces;
pieces.type = voidtype; pieces.type = voidtype;
pieces.flags = 0; pieces.flags = 0;
setOutput(pieces); ProtoStoreInternal::setOutput(pieces);
} }
ProtoStoreInternal::~ProtoStoreInternal(void) ProtoStoreInternal::~ProtoStoreInternal(void)

View file

@ -281,9 +281,8 @@ void InjectPayloadDynamic::inject(InjectContext &context,PcodeEmit &emit) const
PcodeInjectLibrarySleigh::PcodeInjectLibrarySleigh(Architecture *g,uintb tmpbase) PcodeInjectLibrarySleigh::PcodeInjectLibrarySleigh(Architecture *g,uintb tmpbase)
: PcodeInjectLibrary(g,tmpbase) : PcodeInjectLibrary(g,tmpbase)
{ {
glb = g; slgh = (const SleighBase *)g->translate;
slgh = (const SleighBase *)glb->translate; contextCache.glb = g;
contextCache.glb = glb;
} }
int4 PcodeInjectLibrarySleigh::registerDynamicInject(InjectPayload *payload) int4 PcodeInjectLibrarySleigh::registerDynamicInject(InjectPayload *payload)

View file

@ -87,7 +87,6 @@ public:
}; };
class PcodeInjectLibrarySleigh : public PcodeInjectLibrary { class PcodeInjectLibrarySleigh : public PcodeInjectLibrary {
Architecture *glb;
const SleighBase *slgh; const SleighBase *slgh;
vector<OpBehavior *> inst; vector<OpBehavior *> inst;
InjectContextSleigh contextCache; InjectContextSleigh contextCache;

View file

@ -125,6 +125,12 @@ SleighArchitecture::~SleighArchitecture(void)
translate = (const Translate *)0; translate = (const Translate *)0;
} }
string SleighArchitecture::getDescription(void) const
{
return description[languageindex].getDescription();
}
/// If the current \b languageindex matches the \b last_languageindex, /// If the current \b languageindex matches the \b last_languageindex,
/// try to reuse the previous Sleigh object, so we don't reload /// try to reuse the previous Sleigh object, so we don't reload
/// the .sla file. /// the .sla file.
@ -198,8 +204,6 @@ void SleighArchitecture::buildSpecFile(DocumentStorage &store)
{ // Given a specific language, make sure relevant spec files are loaded { // Given a specific language, make sure relevant spec files are loaded
bool language_reuse = isTranslateReused(); bool language_reuse = isTranslateReused();
const LanguageDescription &language(description[languageindex]); const LanguageDescription &language(description[languageindex]);
Architecture::description = language.getDescription();
version = language.getVersion();
string compiler = archid.substr(archid.rfind(':')+1); string compiler = archid.substr(archid.rfind(':')+1);
const CompilerTag &compilertag( language.getCompiler(compiler)); const CompilerTag &compilertag( language.getCompiler(compiler));

View file

@ -112,6 +112,7 @@ public:
void restoreXmlHeader(const Element *el); ///< Restore from XML basic attributes of an executable void restoreXmlHeader(const Element *el); ///< Restore from XML basic attributes of an executable
virtual void printMessage(const string &message) const { *errorstream << message << endl; } virtual void printMessage(const string &message) const { *errorstream << message << endl; }
virtual ~SleighArchitecture(void); virtual ~SleighArchitecture(void);
virtual string getDescription(void) const;
static string normalizeProcessor(const string &nm); ///< Try to recover a \e language \e id processor field static string normalizeProcessor(const string &nm); ///< Try to recover a \e language \e id processor field
static string normalizeEndian(const string &nm); ///< Try to recover a \e language \e id endianess field static string normalizeEndian(const string &nm); ///< Try to recover a \e language \e id endianess field

View file

@ -2062,10 +2062,10 @@ int4 DecisionNode::getNumFixed(int4 low,int4 size,bool context)
double DecisionNode::getScore(int4 low,int4 size,bool context) double DecisionNode::getScore(int4 low,int4 size,bool context)
{ {
int4 numBins = 1 << size; int4 numBins = 1 << size; // size is between 1 and 8
int4 i; int4 i;
uintm val,mask; uintm val,mask;
uintm m = (size==8*sizeof(uintm)) ? 0 : (((uintm)1)<<size); uintm m = ((uintm)1)<<size;
m = m-1; m = m-1;
int4 total = 0; int4 total = 0;

View file

@ -1986,8 +1986,7 @@ Varnode *SubfloatFlow::getReplaceVarnode(ReplaceVarnode *rvn)
// Here we artificially truncate the location, which isn't realistic // Here we artificially truncate the location, which isn't realistic
if (addr.isBigEndian()) if (addr.isBigEndian())
addr = addr + (rvn->vn->getSize() - precision); addr = addr + (rvn->vn->getSize() - precision);
if (isinput) replaceInput(rvn); // Replace input to avoid overlap errors
replaceInput(rvn); // Replace input to avoid overlap errors
rvn->replacement = fd->newVarnode(precision,addr); rvn->replacement = fd->newVarnode(precision,addr);
} }
else else

View file

@ -91,7 +91,7 @@ UnifyDatatype::~UnifyDatatype(void)
delete storespot.cn; delete storespot.cn;
break; break;
default: default:
throw LowlevelError("Bad unify datatype"); break;
} }
} }

View file

@ -1,5 +1,5 @@
application.name=Ghidra application.name=Ghidra
application.version=9.0.2 application.version=9.0.3-DEV
application.release.name=PUBLIC application.release.name=PUBLIC
application.layout.version=1 application.layout.version=1
application.gradle.version=5.0 application.gradle.version=5.0