mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Default for maximum number of instructions
This commit is contained in:
parent
d9bd93c36b
commit
a8dcc7266b
8 changed files with 34 additions and 11 deletions
|
@ -80,6 +80,7 @@ OptionDatabase::OptionDatabase(Architecture *g)
|
|||
registerOption(new OptionJumpLoad());
|
||||
registerOption(new OptionToggleRule());
|
||||
registerOption(new OptionAliasBlock());
|
||||
registerOption(new OptionMaxInstruction());
|
||||
}
|
||||
|
||||
OptionDatabase::~OptionDatabase(void)
|
||||
|
@ -816,3 +817,19 @@ string OptionAliasBlock::apply(Architecture *glb,const string &p1,const string &
|
|||
return "Alias block level unchanged";
|
||||
return "Alias block level set to " + p1;
|
||||
}
|
||||
|
||||
string OptionMaxInstruction::apply(Architecture *glb,const string &p1,const string &p2,const string &p3) const
|
||||
|
||||
{
|
||||
if (p1.size() == 0)
|
||||
throw ParseError("Must specify number of instructions");
|
||||
|
||||
int4 newMax = -1;
|
||||
istringstream s1(p1);
|
||||
s1.unsetf(ios::dec | ios::hex | ios::oct); // Let user specify base
|
||||
s1 >> newMax;
|
||||
if (newMax < 0)
|
||||
throw ParseError("Bad maxinstruction parameter");
|
||||
glb->max_instructions = newMax;
|
||||
return "Maximum instructions per function set";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue