decompiler  1.0.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ghidra::SleighArchitecture Class Reference

An Architecture that uses the decompiler's native SLEIGH translation engine. More...

#include <sleigh_arch.hh>

Inheritance diagram for ghidra::SleighArchitecture:
ghidra::Architecture ghidra::AddrSpaceManager ghidra::BfdArchitecture ghidra::RawBinaryArchitecture ghidra::XmlArchitecture

Public Member Functions

 SleighArchitecture (const string &fname, const string &targ, ostream *estream)
 Construct given executable file. More...
 
const string & getFilename (void) const
 Get the executable filename.
 
const string & getTarget (void) const
 Get the language id of the active processor.
 
void encodeHeader (Encoder &encoder) const
 Encode basic attributes of the active executable. More...
 
void restoreXmlHeader (const Element *el)
 Restore from basic attributes of an executable. More...
 
virtual void printMessage (const string &message) const
 Print an error message to console. More...
 
virtual string getDescription (void) const
 Get a string describing this architecture.
 
- Public Member Functions inherited from ghidra::Architecture
 Architecture (void)
 Construct an uninitialized Architecture. More...
 
void init (DocumentStorage &store)
 Load the image and configure architecture. More...
 
void resetDefaultsInternal (void)
 Reset default values for options specific to Architecture.
 
void resetDefaults (void)
 Reset defaults values for options owned by this. More...
 
ProtoModelgetModel (const string &nm) const
 Get a specific PrototypeModel. More...
 
bool hasModel (const string &nm) const
 Does this Architecture have a specific PrototypeModel. More...
 
ProtoModelcreateUnknownModel (const string &modelName)
 Create a model for an unrecognized name. More...
 
bool highPtrPossible (const Address &loc, int4 size) const
 Are pointers possible to the given location? More...
 
AddrSpacegetSpaceBySpacebase (const Address &loc, int4 size) const
 Get space associated with a spacebase register. More...
 
const LanedRegistergetLanedRegister (const Address &loc, int4 size) const
 Get LanedRegister associated with storage. More...
 
int4 getMinimumLanedRegisterSize (void) const
 Get the minimum size of a laned register in bytes. More...
 
void setDefaultModel (ProtoModel *model)
 Set the default PrototypeModel. More...
 
void clearAnalysis (Funcdata *fd)
 Clear analysis specific to a function. More...
 
void readLoaderSymbols (const string &delim)
 Read any symbols from loader into database. More...
 
void collectBehaviors (vector< OpBehavior *> &behave) const
 Provide a list of OpBehavior objects. More...
 
SegmentOpgetSegmentOp (AddrSpace *spc) const
 Retrieve the segment op for the given space if any. More...
 
void setPrototype (const PrototypePieces &pieces)
 Set the prototype for a particular function. More...
 
void setPrintLanguage (const string &nm)
 Establish a particular output language. More...
 
void globalify (void)
 Mark all spaces as global. More...
 
void decodeFlowOverride (Decoder &decoder)
 Set flow overrides from XML. More...
 
virtual ~Architecture (void)
 Destructor. More...
 
virtual void encode (Encoder &encoder) const
 Encode this architecture to a stream. More...
 
virtual void restoreXml (DocumentStorage &store)
 Restore the Architecture state from XML documents. More...
 
virtual void nameFunction (const Address &addr, string &name) const
 Pick a default name for a function. More...
 
- Public Member Functions inherited from ghidra::AddrSpaceManager
 AddrSpaceManager (void)
 Construct an empty address space manager. More...
 
virtual ~AddrSpaceManager (void)
 Destroy the manager. More...
 
int4 getDefaultSize (void) const
 Get size of addresses for the default space. More...
 
AddrSpacegetSpaceByName (const string &nm) const
 Get address space by name. More...
 
AddrSpacegetSpaceByShortcut (char sc) const
 Get address space from its shortcut. More...
 
AddrSpacegetIopSpace (void) const
 Get the internal pcode op space. More...
 
AddrSpacegetFspecSpace (void) const
 Get the internal callspec space. More...
 
AddrSpacegetJoinSpace (void) const
 Get the joining space. More...
 
AddrSpacegetStackSpace (void) const
 Get the stack space for this processor. More...
 
AddrSpacegetUniqueSpace (void) const
 Get the temporary register space for this processor. More...
 
AddrSpacegetDefaultCodeSpace (void) const
 Get the default address space of this processor. More...
 
AddrSpacegetDefaultDataSpace (void) const
 Get the default address space where data is stored. More...
 
AddrSpacegetConstantSpace (void) const
 Get the constant space. More...
 
Address getConstant (uintb val) const
 Get a constant encoded as an Address. More...
 
Address createConstFromSpace (AddrSpace *spc) const
 Create a constant address encoding an address space. More...
 
Address resolveConstant (AddrSpace *spc, uintb val, int4 sz, const Address &point, uintb &fullEncoding) const
 Resolve a native constant into an Address. More...
 
int4 numSpaces (void) const
 Get the number of address spaces for this processor. More...
 
AddrSpacegetSpace (int4 i) const
 Get an address space via its index. More...
 
AddrSpacegetNextSpaceInOrder (AddrSpace *spc) const
 Get the next contiguous address space. More...
 
JoinRecordfindAddJoin (const vector< VarnodeData > &pieces, uint4 logicalsize)
 Get (or create) JoinRecord for pieces. More...
 
JoinRecordfindJoin (uintb offset) const
 Find JoinRecord for offset in the join space. More...
 
void setDeadcodeDelay (AddrSpace *spc, int4 delaydelta)
 Set the deadcodedelay for a specific space. More...
 
void truncateSpace (const TruncationTag &tag)
 Mark a space as truncated from its original size. More...
 
Address constructFloatExtensionAddress (const Address &realaddr, int4 realsize, int4 logicalsize)
 Build a logically lower precision storage location for a bigger floating point register. More...
 
Address constructJoinAddress (const Translate *translate, const Address &hiaddr, int4 hisz, const Address &loaddr, int4 losz)
 Build a logical whole from register pairs. More...
 
void renormalizeJoinAddress (Address &addr, int4 size)
 Make sure a possibly offset join address has a proper JoinRecord. More...
 
Address parseAddressSimple (const string &val)
 Parse a string with just an address space name and a hex offset. More...
 

Static Public Member Functions

static string normalizeProcessor (const string &nm)
 Try to recover a language id processor field. More...
 
static string normalizeEndian (const string &nm)
 Try to recover a language id endianess field. More...
 
static string normalizeSize (const string &nm)
 Try to recover a language id size field. More...
 
static string normalizeArchitecture (const string &nm)
 Try to recover a language id string. More...
 
static void scanForSleighDirectories (const string &rootpath)
 Scan directories for SLEIGH specification files. More...
 
static const vector< LanguageDescription > & getDescriptions (void)
 Get list of all known language descriptions. More...
 
static void shutdown (void)
 Shutdown all Translate objects and free global resources.
 

Static Public Attributes

static FileManage specpaths
 Known directories that contain .ldefs files.
 

Protected Member Functions

virtual TranslatebuildTranslator (DocumentStorage &store)
 Build the Translator object. More...
 
virtual PcodeInjectLibrarybuildPcodeInjectLibrary (void)
 Build the injection library. More...
 
virtual void buildTypegrp (DocumentStorage &store)
 Build the data-type factory/container. More...
 
virtual void buildCommentDB (DocumentStorage &store)
 Build the comment database. More...
 
virtual void buildStringManager (DocumentStorage &store)
 Build the string manager. More...
 
virtual void buildConstantPool (DocumentStorage &store)
 Build the constant pool. More...
 
virtual void buildContext (DocumentStorage &store)
 Build the Context database. More...
 
virtual void buildSymbols (DocumentStorage &store)
 Build any symbols from spec files. More...
 
virtual void buildSpecFile (DocumentStorage &store)
 Load any relevant specification files. More...
 
virtual void modifySpaces (Translate *trans)
 Modify address spaces as required by this Architecture. More...
 
virtual void resolveArchitecture (void)
 Figure out the processor and compiler of the target executable.
 
- Protected Member Functions inherited from ghidra::Architecture
void addSpacebase (AddrSpace *basespace, const string &nm, const VarnodeData &ptrdata, int4 truncSize, bool isreversejustified, bool stackGrowth, bool isFormal)
 Create a new address space associated with a pointer register. More...
 
void addNoHighPtr (const Range &rng)
 Add a new region where pointers do not exist. More...
 
virtual ScopebuildDatabase (DocumentStorage &store)
 Build the database and global scope for this executable. More...
 
virtual void buildLoader (DocumentStorage &store)=0
 Build the LoadImage object and load the executable image. More...
 
virtual void buildInstructions (DocumentStorage &store)
 Register the p-code operations. More...
 
virtual void buildAction (DocumentStorage &store)
 Build the Action framework. More...
 
virtual void postSpecFile (void)
 Let components initialize after Translate is built.
 
void restoreFromSpec (DocumentStorage &store)
 Fully initialize the Translate object. More...
 
void fillinReadOnlyFromLoader (void)
 Load info about read-only sections. More...
 
void initializeSegments ()
 Set up segment resolvers. More...
 
void cacheAddrSpaceProperties (void)
 Calculate some frequently used space properties and cache them. More...
 
void createModelAlias (const string &aliasName, const string &parentName)
 Create name alias for a ProtoModel. More...
 
void parseProcessorConfig (DocumentStorage &store)
 Apply processor specific configuration. More...
 
void parseCompilerConfig (DocumentStorage &store)
 Apply compiler specific configuration. More...
 
void parseExtraRules (DocumentStorage &store)
 Apply any Rule tags. More...
 
void decodeDynamicRule (Decoder &decoder)
 Apply details of a dynamic Rule object. More...
 
ProtoModeldecodeProto (Decoder &decoder)
 Parse a proto-type model from a stream. More...
 
void decodeProtoEval (Decoder &decoder)
 Apply prototype evaluation configuration. More...
 
void decodeDefaultProto (Decoder &decoder)
 Apply default prototype model configuration. More...
 
void decodeGlobal (Decoder &decoder, vector< RangeProperties > &rangeProps)
 Parse information about global ranges. More...
 
void addToGlobalScope (const RangeProperties &props)
 Add a memory range to the set of addresses considered global. More...
 
void addOtherSpace (void)
 Add OTHER space and all of its overlays to the symboltab.
 
void decodeReadOnly (Decoder &decoder)
 Apply read-only region configuration. More...
 
void decodeVolatile (Decoder &decoder)
 Apply volatile region configuration. More...
 
void decodeReturnAddress (Decoder &decoder)
 Apply return address configuration. More...
 
void decodeIncidentalCopy (Decoder &decoder)
 Apply incidental copy configuration. More...
 
void decodeLaneSizes (Decoder &decoder)
 Apply lane size configuration. More...
 
void decodeStackPointer (Decoder &decoder)
 Apply stack pointer configuration. More...
 
void decodeDeadcodeDelay (Decoder &decoder)
 Apply dead-code delay configuration. More...
 
void decodeInferPtrBounds (Decoder &decoder)
 Apply pointer inference bounds. More...
 
void decodeFuncPtrAlign (Decoder &decoder)
 Apply function pointer alignment configuration. More...
 
void decodeSpacebase (Decoder &decoder)
 Create an additional indexed space. More...
 
void decodeNoHighPtr (Decoder &decoder)
 Apply memory alias configuration. More...
 
void decodePreferSplit (Decoder &decoder)
 Designate registers to be split. More...
 
void decodeAggressiveTrim (Decoder &decoder)
 Designate how to trim extension p-code ops. More...
 
- Protected Member Functions inherited from ghidra::AddrSpaceManager
AddrSpacedecodeSpace (Decoder &decoder, const Translate *trans)
 Add a space to the model based an on XML tag. More...
 
void decodeSpaces (Decoder &decoder, const Translate *trans)
 Restore address spaces in the model from an XML tag. More...
 
void setDefaultCodeSpace (int4 index)
 Set the default address space (for code) More...
 
void setDefaultDataSpace (int4 index)
 Set the default address space for data. More...
 
void setReverseJustified (AddrSpace *spc)
 Set reverse justified property on this space. More...
 
void assignShortcut (AddrSpace *spc)
 Select a shortcut character for a new space. More...
 
void markNearPointers (AddrSpace *spc, int4 size)
 Mark that given space can be accessed with near pointers. More...
 
void insertSpace (AddrSpace *spc)
 Add a new address space to the model. More...
 
void copySpaces (const AddrSpaceManager *op2)
 Copy spaces from another manager. More...
 
void addSpacebasePointer (SpacebaseSpace *basespace, const VarnodeData &ptrdata, int4 truncSize, bool stackGrowth)
 Set the base register of a spacebase space. More...
 
void insertResolver (AddrSpace *spc, AddressResolver *rsolv)
 Override the base resolver for a space. More...
 
void setInferPtrBounds (const Range &range)
 Set the range of addresses that can be inferred as pointers. More...
 
JoinRecordfindJoinInternal (uintb offset) const
 Find JoinRecord for offset in the join space. More...
 

Static Protected Member Functions

static void collectSpecFiles (ostream &errs)
 Gather specification files in normal locations. More...
 

Protected Attributes

ostream * errorstream
 Error stream associated with this SleighArchitecture.
 

Private Member Functions

bool isTranslateReused (void)
 Test if last Translate object can be reused. More...
 

Static Private Member Functions

static void loadLanguageDescription (const string &specfile, ostream &errs)
 Read a SLEIGH .ldefs file. More...
 

Private Attributes

int4 languageindex
 Index (within LanguageDescription array) of the active language.
 
string filename
 Name of active load-image file.
 
string target
 The language id of the active load-image.
 

Static Private Attributes

static map< int4, Sleigh * > translators
 Map from language index to instantiated translators.
 
static vector< LanguageDescriptiondescription
 List of languages we know about.
 

Additional Inherited Members

- Public Attributes inherited from ghidra::Architecture
string archid
 ID string uniquely describing this architecture.
 
int4 trim_recurse_max
 How many levels to let parameter trims recurse.
 
int4 max_implied_ref
 Maximum number of references to an implied var.
 
int4 max_term_duplication
 Max terms duplicated without a new variable.
 
int4 max_basetype_size
 Maximum size of an "integer" type before creating an array type.
 
int4 min_funcsymbol_size
 Minimum size of a function symbol.
 
uint4 max_jumptable_size
 Maximum number of entries in a single JumpTable.
 
bool aggressive_ext_trim
 Aggressively trim inputs that look like they are sign extended.
 
bool readonlypropagate
 true if readonly values should be treated as constants
 
bool infer_pointers
 True if we should infer pointers from constants that are likely addresses.
 
bool analyze_for_loops
 True if we should attempt conversion of whiledo loops to for loops.
 
vector< AddrSpace * > inferPtrSpaces
 Set of address spaces in which a pointer constant is inferable.
 
int4 funcptr_align
 How many bits of alignment a function ptr has.
 
uint4 flowoptions
 options passed to flow following engine
 
uint4 max_instructions
 Maximum instructions that can be processed in one function.
 
int4 alias_block_level
 Aliases blocked by 0=none, 1=struct, 2=array, 3=all.
 
uint4 split_datatype_config
 Toggle for data-types splitting: Bit 0=structs, 1=arrays, 2=pointers.
 
vector< Rule * > extra_pool_rules
 Extra rules that go in the main pool (cpu specific, experimental)
 
Databasesymboltab
 Memory map of global variables and functions.
 
ContextDatabasecontext
 Map from addresses to context settings.
 
map< string, ProtoModel * > protoModels
 Parsed forms of possible prototypes.
 
ProtoModeldefaultfp
 Parsed form of default prototype.
 
VarnodeData defaultReturnAddr
 Default storage location of return address (for current function)
 
ProtoModelevalfp_current
 Function proto to use when evaluating current function.
 
ProtoModelevalfp_called
 Function proto to use when evaluating called functions.
 
TypeFactorytypes
 List of types for this binary.
 
const Translatetranslate
 Translation method for this binary.
 
LoadImageloader
 Method for loading portions of binary.
 
PcodeInjectLibrarypcodeinjectlib
 Pcode injection manager.
 
RangeList nohighptr
 Ranges for which high-level pointers are not possible.
 
CommentDatabasecommentdb
 Comments for this architecture.
 
StringManagerstringManager
 Manager of decoded strings.
 
ConstantPoolcpool
 Deferred constant values.
 
PrintLanguageprint
 Current high-level language printer.
 
vector< PrintLanguage * > printlist
 List of high-level language printers supported.
 
OptionDatabaseoptions
 Options that can be configured.
 
vector< TypeOp * > inst
 Registered p-code instructions.
 
UserOpManage userops
 Specifically registered user-defined p-code ops.
 
vector< PreferSplitRecord > splitrecords
 registers that we would prefer to see split for this processor
 
vector< LanedRegisterlanerecords
 Vector registers that have preferred lane sizes.
 
ActionDatabase allacts
 Actions that can be applied in this architecture.
 
bool loadersymbols_parsed
 True if loader symbols have been read.
 

Detailed Description

An Architecture that uses the decompiler's native SLEIGH translation engine.

Any Architecture derived from this knows how to natively read in:

Generally a language id (i.e. x86:LE:64:default) is provided, then this object is able to automatically load in configuration and construct the Translate object.

Constructor & Destructor Documentation

◆ SleighArchitecture()

ghidra::SleighArchitecture::SleighArchitecture ( const string &  fname,
const string &  targ,
ostream *  estream 
)

Construct given executable file.

Prepare this SleighArchitecture for analyzing the given executable image. Full initialization, including creation of the Translate object, still must be performed by calling the init() method.

Parameters
fnameis the filename of the given executable image
targis the optional language id or other target information
estreamis a pointer to an output stream for writing error messages

References errorstream, filename, and target.

Member Function Documentation

◆ buildCommentDB()

void ghidra::SleighArchitecture::buildCommentDB ( DocumentStorage store)
protectedvirtual

Build the comment database.

Build the container that holds comments in this Architecture.

Parameters
storemay hold configuration information

Implements ghidra::Architecture.

◆ buildConstantPool()

void ghidra::SleighArchitecture::buildConstantPool ( DocumentStorage store)
protectedvirtual

Build the constant pool.

Some processor models (Java byte-code) need a database of constants. The database is always built, but may remain empty.

Parameters
storemay hold configuration information

Implements ghidra::Architecture.

◆ buildContext()

void ghidra::SleighArchitecture::buildContext ( DocumentStorage store)
protectedvirtual

Build the Context database.

Build the database which holds status register settings and other information that can affect disassembly depending on context.

Parameters
storemay hold configuration information

Implements ghidra::Architecture.

◆ buildPcodeInjectLibrary()

PcodeInjectLibrary * ghidra::SleighArchitecture::buildPcodeInjectLibrary ( void  )
protectedvirtual

Build the injection library.

This creates the container for p-code injections. It is initially empty.

Returns
the PcodeInjectLibrary object

Implements ghidra::Architecture.

◆ buildSpecFile()

void ghidra::SleighArchitecture::buildSpecFile ( DocumentStorage store)
protectedvirtual

Load any relevant specification files.

Processor/architecture specific configuration files are loaded into the XML store

Parameters
storeis the document store that will hold the configuration

Implements ghidra::Architecture.

References ghidra::LowlevelError::explain, ghidra::DecoderError::explain, ghidra::LanguageDescription::getCompiler(), ghidra::LanguageDescription::getProcessorSpec(), ghidra::Document::getRoot(), ghidra::LanguageDescription::getSlaFile(), ghidra::DocumentStorage::openDocument(), and ghidra::DocumentStorage::registerTag().

◆ buildStringManager()

void ghidra::SleighArchitecture::buildStringManager ( DocumentStorage store)
protectedvirtual

Build the string manager.

Build container that holds decoded strings for this Architecture.

Parameters
storemay hold configuration information

Implements ghidra::Architecture.

◆ buildSymbols()

void ghidra::SleighArchitecture::buildSymbols ( DocumentStorage store)
protectedvirtual

◆ buildTranslator()

Translate * ghidra::SleighArchitecture::buildTranslator ( DocumentStorage store)
protectedvirtual

Build the Translator object.

This builds the main disassembly component for the Architecture This does not initially the engine for a specific processor.

Parameters
storemay hold configuration information
Returns
the Translate object

Implements ghidra::Architecture.

References ghidra::Sleigh::reset().

◆ buildTypegrp()

void ghidra::SleighArchitecture::buildTypegrp ( DocumentStorage store)
protectedvirtual

Build the data-type factory/container.

Build the TypeFactory object specific to this Architecture and prepopulate it with the core types. Core types may be pulled from the configuration information, or default core types are used.

Parameters
storecontains possible configuration information

Implements ghidra::Architecture.

References ghidra::DocumentStorage::getTag(), ghidra::TYPE_BOOL, ghidra::TYPE_CODE, ghidra::TYPE_FLOAT, ghidra::TYPE_INT, ghidra::TYPE_UINT, ghidra::TYPE_UNKNOWN, and ghidra::TYPE_VOID.

◆ collectSpecFiles()

void ghidra::SleighArchitecture::collectSpecFiles ( ostream &  errs)
staticprotected

Gather specification files in normal locations.

This is run once when spinning up the decompiler. Look for the root .ldefs files within the normal directories and parse them. Use these to populate the list of language ids that are supported.

Parameters
errsis an output stream for writing error messages

References description, loadLanguageDescription(), and specpaths.

Referenced by getDescriptions().

◆ encodeHeader()

void ghidra::SleighArchitecture::encodeHeader ( Encoder encoder) const

Encode basic attributes of the active executable.

Parameters
encoderis the stream encoder

References filename, target, and ghidra::Encoder::writeString().

Referenced by ghidra::RawBinaryArchitecture::encode(), ghidra::XmlArchitecture::encode(), and ghidra::BfdArchitecture::encode().

◆ getDescriptions()

const vector< LanguageDescription > & ghidra::SleighArchitecture::getDescriptions ( void  )
static

Get list of all known language descriptions.

Parse all .ldef files and a return the list of all LanguageDescription objects If there are any parse errors in the .ldef files, an exception is thrown

Returns
the list of LanguageDescription objects

References collectSpecFiles(), and description.

◆ isTranslateReused()

bool ghidra::SleighArchitecture::isTranslateReused ( void  )
private

Test if last Translate object can be reused.

If the current languageindex matches the last_languageindex, try to reuse the previous Sleigh object, so we don't reload the .sla file.

Returns
true if it can be reused

◆ loadLanguageDescription()

void ghidra::SleighArchitecture::loadLanguageDescription ( const string &  specfile,
ostream &  errs 
)
staticprivate

Read a SLEIGH .ldefs file.

Any <language> tags are added to the LanguageDescription array

Parameters
specfileis the filename of the .ldefs file
errsis an output stream for printing error messages

References ghidra::XmlDecode::closeElement(), ghidra::XmlDecode::closeElementSkipping(), ghidra::XmlDecode::ingestStream(), ghidra::XmlDecode::openElement(), and ghidra::XmlDecode::peekElement().

Referenced by collectSpecFiles().

◆ modifySpaces()

void ghidra::SleighArchitecture::modifySpaces ( Translate trans)
protectedvirtual

Modify address spaces as required by this Architecture.

If spaces need to be truncated or otherwise changed from processor defaults, this routine performs the modification.

Parameters
transis the processor disassembly object

Implements ghidra::Architecture.

References ghidra::LanguageDescription::getTruncation(), ghidra::LanguageDescription::numTruncations(), and ghidra::AddrSpaceManager::truncateSpace().

◆ normalizeArchitecture()

string ghidra::SleighArchitecture::normalizeArchitecture ( const string &  nm)
static

Try to recover a language id string.

Try to normalize the target string into a valid language id. In general the target string must already look like a language id, but it can drop the compiler field and be a little sloppier in its format.

Parameters
nmis the given target string
Returns
the normalized language id

References normalizeEndian(), normalizeProcessor(), and normalizeSize().

◆ normalizeEndian()

string ghidra::SleighArchitecture::normalizeEndian ( const string &  nm)
static

Try to recover a language id endianess field.

Given an architecture target string try to recover an appropriate endianness string for use in a normalized language id.

Parameters
nmis the given target string
Returns
the endianness field

Referenced by normalizeArchitecture().

◆ normalizeProcessor()

string ghidra::SleighArchitecture::normalizeProcessor ( const string &  nm)
static

Try to recover a language id processor field.

Given an architecture target string try to recover an appropriate processor name for use in a normalized language id.

Parameters
nmis the given target string
Returns
the processor field

Referenced by normalizeArchitecture().

◆ normalizeSize()

string ghidra::SleighArchitecture::normalizeSize ( const string &  nm)
static

Try to recover a language id size field.

Given an architecture target string try to recover an appropriate size string for use in a normalized language id.

Parameters
nmis the given target string
Returns
the size field

Referenced by normalizeArchitecture().

◆ printMessage()

virtual void ghidra::SleighArchitecture::printMessage ( const string &  message) const
inlinevirtual

Print an error message to console.

Write the given message to whatever the registered error stream is

Parameters
messageis the error message

Implements ghidra::Architecture.

◆ restoreXmlHeader()

void ghidra::SleighArchitecture::restoreXmlHeader ( const Element el)

Restore from basic attributes of an executable.

Parameters
elis the root XML element

References filename, ghidra::Element::getAttributeValue(), and target.

Referenced by ghidra::RawBinaryArchitecture::restoreXml(), ghidra::XmlArchitecture::restoreXml(), and ghidra::BfdArchitecture::restoreXml().

◆ scanForSleighDirectories()

void ghidra::SleighArchitecture::scanForSleighDirectories ( const string &  rootpath)
static

Scan directories for SLEIGH specification files.

This assumes a standard "Ghidra/Processors/*/data/languages" layout. It scans for all matching directories and prepares for reading .ldefs files.

Parameters
rootpathis the root path of the Ghidra installation

References specpaths.


The documentation for this class was generated from the following files: