Package ghidra.program.database.external
Class ExternalLocationDB
java.lang.Object
ghidra.program.database.external.ExternalLocationDB
- All Implemented Interfaces:
ExternalLocation
-
Method Summary
Modifier and TypeMethodDescriptionCreate an external function associated with this location or return the existing function if one already existsbooleanReturns the external address if known, or nullReturns the DataType which has been associated with this location.Returns the address in "External" (fake) space where this location is stored.Returns the external function associated with this location or null if this is a data location.getLabel()Returns the external label associated with this location.Returns the name of the external program containing this location.Returns the original name for this location.Returns the name of the parent namespace containing this location.Returns the parent namespace containing this location.Returns the source of this location.Returns the symbol associated with this external location or null.inthashCode()booleanisEquivalent(ExternalLocation other) Returns true if the given external location has the same name, namespace, original import name, and external address.booleanvoidIf this external location has a replacement name, then the primary symbol will be deleted and the original symbol will become the primary symbol, effectively restoring the location to it's original name.voidsaveOriginalNameIfNeeded(Namespace oldNamespace, String oldName, SourceType oldSource) voidsetAddress(Address address) Sets the address in the external program associated with this location.voidsetDataType(DataType dt) Associate the specified data type with this location.voidsetLocation(String label, Address addr, SourceType source) Set the external label which defines this location.voidsetName(Namespace namespace, String newName, SourceType sourceType) Set a new name for this external location.toString()
-
Method Details
-
getSymbol
Description copied from interface:ExternalLocationReturns the symbol associated with this external location or null.- Specified by:
getSymbolin interfaceExternalLocation- Returns:
- the symbol associated with this external location or null.
-
getLibraryName
Description copied from interface:ExternalLocationReturns the name of the external program containing this location.- Specified by:
getLibraryNamein interfaceExternalLocation- Returns:
- the name of the external program containing this location.
- See Also:
-
getParentNameSpace
Description copied from interface:ExternalLocationReturns the parent namespace containing this location.- Specified by:
getParentNameSpacein interfaceExternalLocation- Returns:
- the parent namespace containing this location.
- See Also:
-
getParentName
Description copied from interface:ExternalLocationReturns the name of the parent namespace containing this location.- Specified by:
getParentNamein interfaceExternalLocation- Returns:
- the name of the parent namespace containing this location.
- See Also:
-
getLabel
Description copied from interface:ExternalLocationReturns the external label associated with this location.- Specified by:
getLabelin interfaceExternalLocation- Returns:
- the external label associated with this location.
- See Also:
-
getOriginalImportedName
Description copied from interface:ExternalLocationReturns the original name for this location. Will be null if the name was never changed.- Specified by:
getOriginalImportedNamein interfaceExternalLocation- Returns:
- the original name for this location. Will be null if the name was never changed.
-
getSource
Description copied from interface:ExternalLocationReturns the source of this location.- Specified by:
getSourcein interfaceExternalLocation- Returns:
- the source
-
getAddress
Description copied from interface:ExternalLocationReturns the external address if known, or null- Specified by:
getAddressin interfaceExternalLocation- Returns:
- the external address if known, or null
- See Also:
-
getExternalSpaceAddress
Description copied from interface:ExternalLocationReturns the address in "External" (fake) space where this location is stored.- Specified by:
getExternalSpaceAddressin interfaceExternalLocation- Returns:
- the address that represents this location in "External" space.
- See Also:
-
toString
-
isFunction
public boolean isFunction()- Specified by:
isFunctionin interfaceExternalLocation- Returns:
- true if location corresponds to a function
-
getDataType
Description copied from interface:ExternalLocationReturns the DataType which has been associated with this location.- Specified by:
getDataTypein interfaceExternalLocation- See Also:
-
setDataType
Description copied from interface:ExternalLocationAssociate the specified data type with this location.- Specified by:
setDataTypein interfaceExternalLocation- Parameters:
dt- data type- See Also:
-
getFunction
Description copied from interface:ExternalLocationReturns the external function associated with this location or null if this is a data location.- Specified by:
getFunctionin interfaceExternalLocation- Returns:
- external function associated with this location or null if this is a data location.
-
createFunction
Description copied from interface:ExternalLocationCreate an external function associated with this location or return the existing function if one already exists- Specified by:
createFunctionin interfaceExternalLocation- Returns:
- external function
-
setLocation
Description copied from interface:ExternalLocationSet the external label which defines this location.- Specified by:
setLocationin interfaceExternalLocation- Parameters:
label- external label, may be null if addr is not null. Label may also be namespace qualified and best effort will be used to parse namespace (seeSymbolPath). If a namespace is not included within label, the current namespace will be preserved. Note that this method does not properly handle the presence of template information within the label.addr- external address, may be nullsource- the source of the external label name- Throws:
InvalidInputException
-
setAddress
Description copied from interface:ExternalLocationSets the address in the external program associated with this location. The address may not be null if location has a default label.- Specified by:
setAddressin interfaceExternalLocation- Parameters:
address- the address to set.- Throws:
InvalidInputException- if address is null and location currently has a default name
-
saveOriginalNameIfNeeded
-
setName
public void setName(Namespace namespace, String newName, SourceType sourceType) throws InvalidInputException Description copied from interface:ExternalLocationSet a new name for this external location. The new name will become the primary symbol for this location. The current name for this location will be saved as the original symbol for this location.- Specified by:
setNamein interfaceExternalLocation- Parameters:
namespace- the namespace for the original symbol. Can be different than original symbolnewName- the user-friendly name.sourceType- the SourceType for the new name.- Throws:
InvalidInputException- if the name contains illegal characters (space for example)
-
restoreOriginalName
public void restoreOriginalName()Description copied from interface:ExternalLocationIf this external location has a replacement name, then the primary symbol will be deleted and the original symbol will become the primary symbol, effectively restoring the location to it's original name.- Specified by:
restoreOriginalNamein interfaceExternalLocation
-
hashCode
public int hashCode() -
equals
-
isEquivalent
Description copied from interface:ExternalLocationReturns true if the given external location has the same name, namespace, original import name, and external address.- Specified by:
isEquivalentin interfaceExternalLocation- Parameters:
other- the other ExternalLocation to compare- Returns:
- true if the other location is equivalent to this one.
-