mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
Namespace display options
This commit is contained in:
parent
05c3358fe4
commit
e339d91ffd
12 changed files with 129 additions and 75 deletions
|
@ -81,6 +81,7 @@ OptionDatabase::OptionDatabase(Architecture *g)
|
|||
registerOption(new OptionToggleRule());
|
||||
registerOption(new OptionAliasBlock());
|
||||
registerOption(new OptionMaxInstruction());
|
||||
registerOption(new OptionNamespaceStrategy());
|
||||
}
|
||||
|
||||
OptionDatabase::~OptionDatabase(void)
|
||||
|
@ -833,3 +834,23 @@ string OptionMaxInstruction::apply(Architecture *glb,const string &p1,const stri
|
|||
glb->max_instructions = newMax;
|
||||
return "Maximum instructions per function set";
|
||||
}
|
||||
|
||||
/// \class OptionNamespaceStrategy
|
||||
/// \brief How should namespace tokens be displayed
|
||||
///
|
||||
/// The first parameter gives the strategy identifier, mapping to PrintLanguage::namespace_strategy.
|
||||
string OptionNamespaceStrategy::apply(Architecture *glb,const string &p1,const string &p2,const string &p3) const
|
||||
|
||||
{
|
||||
PrintLanguage::namespace_strategy strategy;
|
||||
if (p1 == "minimal")
|
||||
strategy = PrintLanguage::MINIMAL_NAMESPACES;
|
||||
else if (p1 == "all")
|
||||
strategy = PrintLanguage::ALL_NAMESPACES;
|
||||
else if (p1 == "none")
|
||||
strategy = PrintLanguage::NO_NAMESPACES;
|
||||
else
|
||||
throw ParseError("Must specify a valid strategy");
|
||||
glb->print->setNamespaceStrategy(strategy);
|
||||
return "Namespace strategy set";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue