Package ghidra.program.model.symbol
Interface ExternalManager
-
- All Known Implementing Classes:
ExternalManagerDB
public interface ExternalManager
External manager interface. Defines methods for dealing with external programs and locations within those programs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Library
addExternalLibraryName(java.lang.String name, SourceType source)
Adds a new external library nameExternalLocation
addExtFunction(Namespace extNamespace, java.lang.String extLabel, Address extAddr, SourceType sourceType)
Get or create an external function location associated with an library/file named extName and the label within that file specified by extLabelExternalLocation
addExtFunction(Namespace extNamespace, java.lang.String extLabel, Address extAddr, SourceType sourceType, boolean reuseExisting)
Get or create an external function location associated with an library/file named extName and the label within that file specified by extLabelExternalLocation
addExtFunction(java.lang.String extName, java.lang.String extLabel, Address extAddr, SourceType sourceType)
Get or create an external location associated with an library/file named extName and the label within that file specified by extLabelExternalLocation
addExtLocation(Namespace extNamespace, java.lang.String extLabel, Address extAddr, SourceType sourceType)
Get or create an external location in the indicated parent namespace with the specified name.ExternalLocation
addExtLocation(Namespace extNamespace, java.lang.String extLabel, Address extAddr, SourceType sourceType, boolean reuseExisting)
Get or create an external location in the indicated parent namespace with the specified name.ExternalLocation
addExtLocation(java.lang.String extName, java.lang.String extLabel, Address extAddr, SourceType sourceType)
Get or create an external location associated with an library/file named extName and the label within that file specified by extLabelboolean
contains(java.lang.String libraryName)
Determines if the indicated external library name is being managed (exists).Library
getExternalLibrary(java.lang.String name)
Get the Library which corresponds to the specified namejava.lang.String[]
getExternalLibraryNames()
Returns a list of all external names for which locations have been defined.java.lang.String
getExternalLibraryPath(java.lang.String libraryName)
Returns the file pathname associated with an external name.ExternalLocation
getExternalLocation(Namespace namespace, java.lang.String label)
Deprecated.ExternalLocation
getExternalLocation(Symbol symbol)
Returns the external location associated with the given external symbolExternalLocation
getExternalLocation(java.lang.String libraryName, java.lang.String label)
Deprecated.UsegetExternalLocations(String, String)
insteadExternalLocationIterator
getExternalLocations(Address memoryAddress)
Get an iterator over all external locations which have been associated to the specified memory addressjava.util.List<ExternalLocation>
getExternalLocations(Namespace namespace, java.lang.String label)
Returns a list of External Locations matching the given label name in the given Namespace.ExternalLocationIterator
getExternalLocations(java.lang.String libraryName)
Get an iterator over all external locations associated with the specified externalName.java.util.List<ExternalLocation>
getExternalLocations(java.lang.String libraryName, java.lang.String label)
Returns a list of External Locations matching the given label name in the given Library.ExternalLocation
getUniqueExternalLocation(Namespace namespace, java.lang.String label)
ExternalLocation
getUniqueExternalLocation(java.lang.String libraryName, java.lang.String label)
boolean
removeExternalLibrary(java.lang.String name)
Removes external name if no associated ExternalLocation's existvoid
setExternalPath(java.lang.String libraryName, java.lang.String pathname, boolean userDefined)
Sets the file pathname associated with an existing external name.void
updateExternalLibraryName(java.lang.String oldName, java.lang.String newName, SourceType source)
Change the name of an existing external name.
-
-
-
Method Detail
-
getExternalLibraryNames
java.lang.String[] getExternalLibraryNames()
Returns a list of all external names for which locations have been defined.
-
getExternalLibrary
Library getExternalLibrary(java.lang.String name)
Get the Library which corresponds to the specified name- Parameters:
name
- name of library- Returns:
- library or null if not found
-
removeExternalLibrary
boolean removeExternalLibrary(java.lang.String name)
Removes external name if no associated ExternalLocation's exist- Parameters:
name
- external name- Returns:
- true if removed, false if unable to due to associated locations/references
-
getExternalLibraryPath
java.lang.String getExternalLibraryPath(java.lang.String libraryName)
Returns the file pathname associated with an external name. Null is returned if either the external name does not exist or a pathname has not been set.- Parameters:
libraryName
- external name
-
setExternalPath
void setExternalPath(java.lang.String libraryName, java.lang.String pathname, boolean userDefined) throws InvalidInputException
Sets the file pathname associated with an existing external name.- Parameters:
libraryName
- the name of the library to associate with a file.pathname
- the path to the program to be associated with the library name.userDefined
- true if the external path is being specified by the user- Throws:
InvalidInputException
-
updateExternalLibraryName
void updateExternalLibraryName(java.lang.String oldName, java.lang.String newName, SourceType source) throws DuplicateNameException, InvalidInputException
Change the name of an existing external name.- Parameters:
oldName
- the old name of the external library name.newName
- the new name of the external library name.source
- the source of this external library- Throws:
DuplicateNameException
InvalidInputException
-
getExternalLocations
ExternalLocationIterator getExternalLocations(java.lang.String libraryName)
Get an iterator over all external locations associated with the specified externalName.- Parameters:
libraryName
- the name of the library to get locations for- Returns:
- external location iterator
-
getExternalLocations
ExternalLocationIterator getExternalLocations(Address memoryAddress)
Get an iterator over all external locations which have been associated to the specified memory address- Parameters:
memoryAddress
-- Returns:
- external location iterator
-
getExternalLocation
@Deprecated ExternalLocation getExternalLocation(java.lang.String libraryName, java.lang.String label)
Deprecated.UsegetExternalLocations(String, String)
insteadGet an external location.- Parameters:
libraryName
- the name of the library for which to get an external locationlabel
- the name of the external location.
-
getExternalLocation
@Deprecated ExternalLocation getExternalLocation(Namespace namespace, java.lang.String label)
Deprecated.Get an external location.- Parameters:
namespace
- the namespace containing the external label.label
- the name of the external location.
-
getExternalLocations
java.util.List<ExternalLocation> getExternalLocations(java.lang.String libraryName, java.lang.String label)
Returns a list of External Locations matching the given label name in the given Library.- Parameters:
libraryName
- the name of the librarylabel
- the name of the label- Returns:
- a list of External Locations matching the given label name in the given Library.
-
getExternalLocations
java.util.List<ExternalLocation> getExternalLocations(Namespace namespace, java.lang.String label)
Returns a list of External Locations matching the given label name in the given Namespace.- Parameters:
the
- Namespace to searchlabel
- the name of the labels to search for.- Returns:
- a list of External Locations matching the given label name in the given Namespace.
-
getUniqueExternalLocation
ExternalLocation getUniqueExternalLocation(java.lang.String libraryName, java.lang.String label)
-
getUniqueExternalLocation
ExternalLocation getUniqueExternalLocation(Namespace namespace, java.lang.String label)
-
getExternalLocation
ExternalLocation getExternalLocation(Symbol symbol)
Returns the external location associated with the given external symbol- Parameters:
symbol
- the external symbol.- Returns:
- the external location or null
-
contains
boolean contains(java.lang.String libraryName)
Determines if the indicated external library name is being managed (exists).- Parameters:
libraryName
- the external library name- Returns:
- true if the name is defined (whether it has a path or not).
-
addExternalLibraryName
Library addExternalLibraryName(java.lang.String name, SourceType source) throws DuplicateNameException, InvalidInputException
Adds a new external library name- Parameters:
name
- the new library name to add.source
- the source of this external library- Returns:
- library
- Throws:
DuplicateNameException
InvalidInputException
-
addExtLocation
ExternalLocation addExtLocation(java.lang.String extName, java.lang.String extLabel, Address extAddr, SourceType sourceType) throws InvalidInputException, DuplicateNameException
Get or create an external location associated with an library/file named extName and the label within that file specified by extLabel- Parameters:
extName
-extLabel
-extAddr
-source
- the source of this external library's symbol- Returns:
- external location
- Throws:
InvalidInputException
DuplicateNameException
-
addExtLocation
ExternalLocation addExtLocation(Namespace extNamespace, java.lang.String extLabel, Address extAddr, SourceType sourceType) throws InvalidInputException, DuplicateNameException
Get or create an external location in the indicated parent namespace with the specified name.- Parameters:
extNameSpace
-extLabel
-extAddr
-source
- the source of this external library's symbol- Returns:
- external location
- Throws:
InvalidInputException
DuplicateNameException
-
addExtLocation
ExternalLocation addExtLocation(Namespace extNamespace, java.lang.String extLabel, Address extAddr, SourceType sourceType, boolean reuseExisting) throws InvalidInputException, DuplicateNameException
Get or create an external location in the indicated parent namespace with the specified name.- Parameters:
extNameSpace
-extLabel
-extAddr
-source
- the source of this external library's symbolreuseExisting
- if true, this will return an existing matching external location instead of creating a new one.- Returns:
- external location
- Throws:
InvalidInputException
DuplicateNameException
-
addExtFunction
ExternalLocation addExtFunction(java.lang.String extName, java.lang.String extLabel, Address extAddr, SourceType sourceType) throws DuplicateNameException, InvalidInputException
Get or create an external location associated with an library/file named extName and the label within that file specified by extLabel- Parameters:
extName
-extLabel
-extAddr
-source
- the source of this external library's symbol- Returns:
- external location
- Throws:
InvalidInputException
DuplicateNameException
-
addExtFunction
ExternalLocation addExtFunction(Namespace extNamespace, java.lang.String extLabel, Address extAddr, SourceType sourceType) throws InvalidInputException, DuplicateNameException
Get or create an external function location associated with an library/file named extName and the label within that file specified by extLabel- Parameters:
extNamespace
-extLabel
-extAddr
-source
- the source of this external library's symbol- Returns:
- external location
- Throws:
InvalidInputException
DuplicateNameException
- if another non-Library namespace has the same name
-
addExtFunction
ExternalLocation addExtFunction(Namespace extNamespace, java.lang.String extLabel, Address extAddr, SourceType sourceType, boolean reuseExisting) throws InvalidInputException, DuplicateNameException
Get or create an external function location associated with an library/file named extName and the label within that file specified by extLabel- Parameters:
extNamespace
-extLabel
-source
- the source of this external library's symbolreuseExisting
- if true, will return any existing matching location instead of creating a new one. If false, will prefer to create a new one as long as the specified address is not null and not used in an existing location.- Returns:
- external location
- Throws:
InvalidInputException
DuplicateNameException
- if another non-Library namespace has the same name
-
-