Class DBTraceProgramViewSymbolTable

java.lang.Object
ghidra.trace.database.program.DBTraceProgramViewSymbolTable
All Implemented Interfaces:
SymbolTable

public class DBTraceProgramViewSymbolTable extends Object implements SymbolTable
  • Field Details

  • Constructor Details

    • DBTraceProgramViewSymbolTable

      public DBTraceProgramViewSymbolTable(DBTraceProgramView program)
  • Method Details

    • assertTraceNamespace

      protected TraceNamespaceSymbol assertTraceNamespace(Namespace ns)
    • createLabel

      public Symbol createLabel(Address addr, String name, SourceType source) throws InvalidInputException
      Description copied from interface: SymbolTable
      Create a label symbol with the given name in the global namespace and associated to the given memory address. (see Address.isMemoryAddress()).

      The new symbol will be of type SymbolType.LABEL or SymbolType.FUNCTION if a default function symbol currently exists at the address. If a default function symbol exists at the specified address the function symbol will be renamed and returned. Label and function symbols do not need to be unique across multiple addresses. However, if a global symbol at the specified address already has the specified name it will be returned without changing the source type. If this is the first non-dynamic symbol defined for the address it becomes the primary symbol.

      Specified by:
      createLabel in interface SymbolTable
      Parameters:
      addr - the memory address at which to create a symbol
      name - the name of the symbol
      source - the source of this symbol. In general, a source of SourceType.DEFAULT should never be specified using this method.
      Returns:
      new labe or function symbol
      Throws:
      InvalidInputException - if name contains white space, is zero length, or is null for non-default source
    • createLabel

      public Symbol createLabel(Address addr, String name, Namespace namespace, SourceType source) throws InvalidInputException
      Description copied from interface: SymbolTable
      Create a label symbol with the given name and namespace associated to the given memory address. (see Address.isMemoryAddress()).

      The new symbol will be of type SymbolType.LABEL or SymbolType.FUNCTION if a default function symbol currently exists at the address. If a default function symbol exists at the specified address the function symbol will be renamed and returned. Label and function symbols do not need to be unique across multiple addresses or namespaces. However, if a symbol at the specified address already has the specified name and namespace it will be returned without changing the source type. If this is the first non-dynamic symbol defined for the address it becomes the primary symbol.

      Specified by:
      createLabel in interface SymbolTable
      Parameters:
      addr - the memory address at which to create a symbol
      name - the name of the symbol
      namespace - the parent namespace of the symbol, or null for the global namespace.
      source - the source of this symbol. In general, a source of SourceType.DEFAULT should never be specified using this method.
      Returns:
      new label or function symbol
      Throws:
      InvalidInputException - if name contains white space, is zero length, or is null for non-default source. Also thrown if invalid parent namespace is specified.
    • removeSymbolSpecial

      public boolean removeSymbolSpecial(Symbol sym)
      Description copied from interface: SymbolTable
      Removes the specified symbol from the symbol table.

      If removing any non-function symbol, the behavior will be the same as invoking Symbol.delete() on the symbol. Use of this method for non-function symbols is discouraged.

      WARNING! If removing a function symbol, the behavior differs from directly invoking Symbol.delete() on the function symbol. When removing a function symbol this method has the following behavior:

      • If the function is a default symbol (e.g., FUN_12345678) this method has no effect and will return false.
      • If no other labels exist at the function entry, the function will be renamed to the default function name.
      • If another label does exist at the function entry point, that label will be removed, and the function will be renamed to that label's name.

      Any reference bound to a removed symbol will lose that symbol specific binding.

      Specified by:
      removeSymbolSpecial in interface SymbolTable
      Parameters:
      sym - the symbol to be removed.
      Returns:
      true if a symbol is removed, false if not or in case of failure
    • requireVisible

      protected <T extends TraceSymbol> T requireVisible(T sym)
    • getSymbol

      public Symbol getSymbol(long symbolID)
      Description copied from interface: SymbolTable
      Get the symbol for the given symbol ID.
      Specified by:
      getSymbol in interface SymbolTable
      Parameters:
      symbolID - the id of the symbol to be retrieved
      Returns:
      null if there is no symbol with the given ID
    • getSymbol

      public Symbol getSymbol(String name, Address addr, Namespace namespace)
      Description copied from interface: SymbolTable
      Get the symbol with the given name, address, and namespace.

      Note that for a symbol to be uniquely specified, all these parameters are required. Any method that queries for symbols using just one or two of these parameters will return only the first match.

      NOTE: This method will not return a default thunk (i.e., thunk function symbol with default source type) since it mirrors the name and parent namespace of the function it thunks.

      Specified by:
      getSymbol in interface SymbolTable
      Parameters:
      name - the name of the symbol to retrieve
      addr - the address of the symbol to retrieve
      namespace - the namespace of the symbol to retrieve. May be null which indicates the global namespace.
      Returns:
      the symbol which matches the specified criteria or null if not found
      See Also:
    • getGlobalSymbol

      public Symbol getGlobalSymbol(String name, Address addr)
      Description copied from interface: SymbolTable
      Get the global symbol with the given name and address.

      Note that this results in a single Symbol because of an additional restriction that allows only one symbol with a given name at the same address and namespace (in this case the global namespace).

      This is just a convenience method for SymbolTable.getSymbol(String, Address, Namespace) where the namespace is the global namespace.

      NOTE: This method will not return a default thunk (i.e., thunk function symbol with default source type) since it mirrors the name and parent namespace of the function it thunks.

      Specified by:
      getGlobalSymbol in interface SymbolTable
      Parameters:
      name - the name of the symbol to retrieve
      addr - the address of the symbol to retrieve
      Returns:
      the symbol which matches the specified criteria in the global namespace or null if not found
      See Also:
    • getSymbols

      public List<Symbol> getSymbols(String name, Namespace namespace)
      Description copied from interface: SymbolTable
      Get a list of all symbols with the given name in the given parent namespace. If the global namespace is specified matches against dynamic label symbols will be included.

      NOTE: If a function namespace is specified default parameter and local variable names will be included. If an external library or namespace is specified default external label/function symbols will be included.

      NOTE: The resulting iterator will not return default thunks (i.e., thunk function symbol with default source type).

      Specified by:
      getSymbols in interface SymbolTable
      Parameters:
      name - the name of the symbols to retrieve
      namespace - the namespace to search for symbols
      Returns:
      a list of symbols which satisfy specified criteria
    • getGlobalSymbols

      public List<Symbol> getGlobalSymbols(String name)
      Description copied from interface: SymbolTable
      Get a list of all global symbols with the given name. Matches against dynamic label symbols will be included.

      NOTE: This method will not return default thunks (i.e., thunk function symbol with default source type).

      Specified by:
      getGlobalSymbols in interface SymbolTable
      Parameters:
      name - the name of the symbols to retrieve
      Returns:
      a list of all global symbols with the given name
    • getLabelOrFunctionSymbols

      public List<Symbol> getLabelOrFunctionSymbols(String name, Namespace namespace)
      Description copied from interface: SymbolTable
      Get all the label or function symbols that have the given name in the given parent namespace. If the global namespace is specified matches against dynamic label symbols will be included.

      NOTE: If a function namespace is specified default parameter and local variable names will be included. If an external library or namespace is specified default external label/function symbols will be included.

      NOTE: This method will not return a default thunk (i.e., thunk function symbol with default source type) since it mirrors the name and parent namespace of the function it thunks.

      Specified by:
      getLabelOrFunctionSymbols in interface SymbolTable
      Parameters:
      name - the name of the symbols to search for
      namespace - the namespace to search. If null, then the global namespace is assumed.
      Returns:
      a list of all the label or function symbols with the given name in the given parent namespace
    • getNamespaceSymbol

      public Symbol getNamespaceSymbol(String name, Namespace namespace)
      Description copied from interface: SymbolTable
      Get a generic namespace symbol with the given name in the given parent namespace
      Specified by:
      getNamespaceSymbol in interface SymbolTable
      Parameters:
      name - the name of the namespace symbol to retrieve
      namespace - the namespace containing the symbol to retrieve
      Returns:
      the symbol, or null
    • getLibrarySymbol

      public Symbol getLibrarySymbol(String name)
      Description copied from interface: SymbolTable
      Get the library symbol with the given name
      Specified by:
      getLibrarySymbol in interface SymbolTable
      Parameters:
      name - the name of the library symbol to retrieve
      Returns:
      the library symbol with the given name
    • getClassSymbol

      public Symbol getClassSymbol(String name, Namespace namespace)
      Description copied from interface: SymbolTable
      Get the class symbol with the given name in the given namespace
      Specified by:
      getClassSymbol in interface SymbolTable
      Parameters:
      name - the name of the class
      namespace - the parent namespace to search for the class
      Returns:
      the class symbol with the given name in the given namespace
    • getParameterSymbol

      public Symbol getParameterSymbol(String name, Namespace namespace)
      Description copied from interface: SymbolTable
      Get the parameter symbol with the given name in the given namespace
      Specified by:
      getParameterSymbol in interface SymbolTable
      Parameters:
      name - the name of the parameter
      namespace - the namespace (function) to search for the class
      Returns:
      the parameter symbol with the given name in the given namespace
    • getLocalVariableSymbol

      public Symbol getLocalVariableSymbol(String name, Namespace namespace)
      Description copied from interface: SymbolTable
      Get the local variable symbol with the given name in the given namespace
      Specified by:
      getLocalVariableSymbol in interface SymbolTable
      Parameters:
      name - the name of the local variable
      namespace - the parent namespace (function) to search for the local variable
      Returns:
      the local variable symbol with the given name in the given namespace
    • getVariableSymbol

      public Symbol getVariableSymbol(String name, Function function)
      Description copied from interface: SymbolTable
      Get a symbol that is either a parameter or local variable.

      There can be only one because these symbol types have a unique name requirement.

      Specified by:
      getVariableSymbol in interface SymbolTable
      Parameters:
      name - the name of the variable
      function - the function to search
      Returns:
      a parameter or local variable symbol with the given name
    • getNamespace

      public Namespace getNamespace(String name, Namespace namespace)
      Description copied from interface: SymbolTable
      Get the namespace with the given name in the given parent namespace.

      The returned namespace can be a generic namespace (SymbolType.NAMESPACE, NamespaceSymbol), class (SymbolType.CLASS, ClassSymbol),or library (SymbolType.LIBRARY, LibrarySymbol), but not a function.

      There can be only one because these symbol types have a unique name requirement within their parent namespace.

      Specified by:
      getNamespace in interface SymbolTable
      Parameters:
      name - the name of the namespace to be retrieved
      namespace - the parent namespace of the namespace to be retrieved
      Returns:
      the namespace with the given name in the given parent namespace
    • getSymbols

      public SymbolIterator getSymbols(String name)
      Description copied from interface: SymbolTable
      Get all the symbols with the given name

      NOTE: The resulting iterator will not return default thunks (i.e., thunk function symbol with default source type). It will also not work for default local variables and parameters.

      Specified by:
      getSymbols in interface SymbolTable
      Parameters:
      name - the name of symbols to search for
      Returns:
      an iterator over symbols with the given name
    • getAllSymbols

      public SymbolIterator getAllSymbols(boolean includeDynamicSymbols)
      Description copied from interface: SymbolTable
      Get all of the symbols, optionally including dynamic symbols
      Specified by:
      getAllSymbols in interface SymbolTable
      Parameters:
      includeDynamicSymbols - if true, the iterator will include dynamic symbols
      Returns:
      an iterator over the symbols
    • getSymbol

      public Symbol getSymbol(Reference ref)
      Description copied from interface: SymbolTable
      Get the symbol that a given reference associates
      Specified by:
      getSymbol in interface SymbolTable
      Parameters:
      ref - the reference for the associated symbol
      Returns:
      the associated symbol
    • getPrimarySymbol

      public Symbol getPrimarySymbol(Address addr)
      Description copied from interface: SymbolTable
      Get the primary label or function symbol at the given address

      This method will return null if the address specified is neither a memory address nor an external address.

      Specified by:
      getPrimarySymbol in interface SymbolTable
      Parameters:
      addr - the address of the symbol
      Returns:
      the symbol, or null if no symbol is at the address
    • getSymbols

      public Symbol[] getSymbols(Address addr)
      Description copied from interface: SymbolTable
      Get all the symbols at the given address. This method will include a dynamic memory symbol if one exists at the specified address.

      For a memory address the primary symbol will be returned at array index 0. WARNING! Use of this method with non-memory addresses is discouraged. Example: Variable address could be used multiple times by many functions.

      NOTE: unless all the symbols are needed at once, and a dynamic symbol can be ignored, consider using SymbolTable.getSymbolsAsIterator(Address) instead.

      Specified by:
      getSymbols in interface SymbolTable
      Parameters:
      addr - the address of the symbols
      Returns:
      an array, possibly empty, of the symbols at the given address
      See Also:
    • getSymbolsAsIterator

      public SymbolIterator getSymbolsAsIterator(Address addr)
      Description copied from interface: SymbolTable
      Get an iterator over the symbols at the given address. Any dynamic symbol at the address will be excluded.

      Use this instead of SymbolTable.getSymbols(Address) when you do not need to get all symbols, but rather are searching for a particular symbol. This method prevents all symbols at the given address from being loaded up front.

      Specified by:
      getSymbolsAsIterator in interface SymbolTable
      Parameters:
      addr - the address of the symbols
      Returns:
      an iterator over the symbols at the given address
      See Also:
    • getUserSymbols

      public Symbol[] getUserSymbols(Address addr)
      Description copied from interface: SymbolTable
      Get an array of defined symbols at the given address (i.e., those with database record). Any dynamic memory symbol at the address will be excluded.

      WARNING! Use of this method with non-memory addresses is discouraged. Example: Variable address could be used multiple times by many functions.

      NOTE: unless all the symbols are needed at once, consider using SymbolTable.getSymbolsAsIterator(Address) instead.

      Specified by:
      getUserSymbols in interface SymbolTable
      Parameters:
      addr - the address of the symbols
      Returns:
      an array, possibly empty, of the symbols
    • getSymbols

      public SymbolIterator getSymbols(Namespace namespace)
      Description copied from interface: SymbolTable
      Get an iterator over all the symbols in the given namespace

      NOTE: The resulting iterator will not return default thunks (i.e., thunk function symbol with default source type).

      Specified by:
      getSymbols in interface SymbolTable
      Parameters:
      namespace - the namespace to search for symbols
      Returns:
      an iterator over the symbols
    • getSymbols

      public SymbolIterator getSymbols(long namespaceID)
      Description copied from interface: SymbolTable
      Get an iterator over all the symbols in the given namespace

      NOTE: The resulting iterator will not return default thunks (i.e., thunk function symbol with default source type).

      Specified by:
      getSymbols in interface SymbolTable
      Parameters:
      namespaceID - the namespace ID to search for symbols.
      Returns:
      symbol iterator
    • hasSymbol

      public boolean hasSymbol(Address addr)
      Description copied from interface: SymbolTable
      Check if there exists any symbol at the given address
      Specified by:
      hasSymbol in interface SymbolTable
      Parameters:
      addr - address to check for an existing symbol
      Returns:
      true if any symbol exists
    • getDynamicSymbolID

      public long getDynamicSymbolID(Address addr)
      Description copied from interface: SymbolTable
      Get the unique symbol ID for a dynamic symbol at the specified address

      Having a dynamic symbol ID does not imply that a dynamic symbol actually exists. Rather, this just gives the ID that a dynamic symbol at that address would have, should it ever exist.

      NOTE: This symbol ID should not be permanently stored since the encoding may change between software releases.

      Specified by:
      getDynamicSymbolID in interface SymbolTable
      Parameters:
      addr - the dynamic symbol memory address
      Returns:
      unique symbol ID
    • getSymbolIterator

      public SymbolIterator getSymbolIterator(String searchStr, boolean caseSensitive)
      Description copied from interface: SymbolTable
      Get an iterator over all symbols that match the given query

      NOTE: The iterator is in the forward direction only and will not return default thunks (i.e., thunk function symbol with default source type).

      Specified by:
      getSymbolIterator in interface SymbolTable
      Parameters:
      searchStr - the query, which may contain * to match any sequence or ? to match a single char
      caseSensitive - flag to specify whether the search is case sensitive
      Returns:
      symbol iterator
    • getSymbols

      public SymbolIterator getSymbols(AddressSetView set, SymbolType type, boolean forward)
      Description copied from interface: SymbolTable
      Get all the symbols of the given type within the given address set.

      NOTE: All external symbols will be omiitted unless the full AddressSpace.EXTERNAL_SPACE range is included within the specified address set or a null addressSet is specified. All global dynamic label symbols will be omitted.

      Specified by:
      getSymbols in interface SymbolTable
      Parameters:
      set - the address set containing the symbols. A null value may be specified to include all memory and external primary symbols.
      type - the type of the symbols
      forward - the direction of the iterator, by address
      Returns:
      symbol iterator
    • scanSymbolsByName

      public SymbolIterator scanSymbolsByName(String startName)
      Description copied from interface: SymbolTable
      Scan symbols lexicographically by name

      If a symbol with the given start name does not exist, the iterator will start at the first symbol following it. This includes only symbols whose addresses are in memory. In particular, it excludes external symbols and dynamic symbols, i.e., those generated as a reference destination.

      Specified by:
      scanSymbolsByName in interface SymbolTable
      Parameters:
      startName - the starting point
      Returns:
      an iterator over the symbols in lexicographical order
    • getNumSymbols

      public int getNumSymbols()
      Description copied from interface: SymbolTable
      Get the total number of symbols in the table
      Specified by:
      getNumSymbols in interface SymbolTable
      Returns:
      total number of symbols
    • getSymbolIteratorAtMySnap

      protected Iterator<? extends Symbol> getSymbolIteratorAtMySnap(TraceSymbolWithLocationView<? extends TraceSymbol> view, AddressSetView asv, boolean includeDynamicSymbols, boolean forward)
    • getSymbolIterator

      public SymbolIterator getSymbolIterator()
      Description copied from interface: SymbolTable
      Get all label symbols

      Labels are defined on memory locations.

      Specified by:
      getSymbolIterator in interface SymbolTable
      Returns:
      symbol iterator
    • getDefinedSymbols

      public SymbolIterator getDefinedSymbols()
      Description copied from interface: SymbolTable
      Get all defined symbols in no particular order. All global dynamic memory labels will be excluded.
      Specified by:
      getDefinedSymbols in interface SymbolTable
      Returns:
      symbol iterator
    • getExternalSymbol

      public Symbol getExternalSymbol(String name)
      Description copied from interface: SymbolTable
      Get the external symbol with the given name. The first occurrence of the named symbol found within any external namespace will be returned. If all matching symbols need to be considered the SymbolTable.getExternalSymbols(String) should be used.
      Specified by:
      getExternalSymbol in interface SymbolTable
      Parameters:
      name - the name of the symbol
      Returns:
      the symbol, or null if no external symbol has that name
    • getExternalSymbols

      public SymbolIterator getExternalSymbols(String name)
      Description copied from interface: SymbolTable
      Get all the external symbols with the given name
      Specified by:
      getExternalSymbols in interface SymbolTable
      Parameters:
      name - the name of symbols
      Returns:
      an iterator over the symbols
    • getExternalSymbols

      public SymbolIterator getExternalSymbols()
      Description copied from interface: SymbolTable
      Get all defined external symbols in no particular order
      Specified by:
      getExternalSymbols in interface SymbolTable
      Returns:
      symbol iterator
    • getSymbolIterator

      public SymbolIterator getSymbolIterator(boolean forward)
      Description copied from interface: SymbolTable
      Get all the symbols defined with program memory.

      NOTE: The returned symbols will not include any external symbols defined within the AddressSpace.EXTERNAL_SPACE. In addition, all global dynamic label symbols will be omitted.

      Specified by:
      getSymbolIterator in interface SymbolTable
      Parameters:
      forward - the direction of the iterator, by address
      Returns:
      symbol iterator
    • getSymbolIterator

      public SymbolIterator getSymbolIterator(Address startAddr, boolean forward)
      Description copied from interface: SymbolTable
      Get all the symbols starting at the specified memory address.

      NOTE: The returned symbols will not include any external symbols defined within the AddressSpace.EXTERNAL_SPACE. In addition, all global dynamic label symbols will be omitted.

      Specified by:
      getSymbolIterator in interface SymbolTable
      Parameters:
      startAddr - the starting address
      forward - true means the iterator is in the forward direction
      Returns:
      symbol iterator
    • getPrimarySymbolIterator

      public SymbolIterator getPrimarySymbolIterator(boolean forward)
      Description copied from interface: SymbolTable
      Get all primary label and function symbols defined within program memory address. Iteration may span multiple memory spaces.

      NOTE: The returned symbols will not include any external symbols defined within the AddressSpace.EXTERNAL_SPACE. In addition, all global dynamic label symbols will be omitted.

      Specified by:
      getPrimarySymbolIterator in interface SymbolTable
      Parameters:
      forward - true means the iterator is in the forward direction
      Returns:
      symbol iterator
    • getPrimarySymbolIterator

      public SymbolIterator getPrimarySymbolIterator(Address startAddr, boolean forward)
      Description copied from interface: SymbolTable
      Get all primary label and function symbols starting at the specified memory address through to the program's maximum memory address. Iteration may span multiple memory spaces.

      NOTE: The returned symbols will not include any external symbols defined within the AddressSpace.EXTERNAL_SPACE. In addition, all global dynamic label symbols will be omitted.

      Specified by:
      getPrimarySymbolIterator in interface SymbolTable
      Parameters:
      startAddr - the starting memory address
      forward - true means the iterator is in the forward direction
      Returns:
      symbol iterator
    • getPrimarySymbolIterator

      public SymbolIterator getPrimarySymbolIterator(AddressSetView asv, boolean forward)
      Description copied from interface: SymbolTable
      Get primary label and function symbols within the given address set.

      NOTE: All external symbols will be omitted unless the full AddressSpace.EXTERNAL_SPACE range is included within the specified address set or a null addressSet is specified. All global dynamic label symbols will be omitted.

      Specified by:
      getPrimarySymbolIterator in interface SymbolTable
      Parameters:
      asv - the set of address containing the symbols. A null value may be specified to include all memory and external primary symbols.
      forward - true means the iterator is in the forward direction
      Returns:
      symbol iterator
    • addExternalEntryPoint

      public void addExternalEntryPoint(Address addr)
      Description copied from interface: SymbolTable
      Add a memory address to the external entry points.
      Specified by:
      addExternalEntryPoint in interface SymbolTable
      Parameters:
      addr - the memory address to add
    • removeExternalEntryPoint

      public void removeExternalEntryPoint(Address addr)
      Description copied from interface: SymbolTable
      Remove an address from the external entry points
      Specified by:
      removeExternalEntryPoint in interface SymbolTable
      Parameters:
      addr - the address to remove
    • isExternalEntryPoint

      public boolean isExternalEntryPoint(Address addr)
      Description copied from interface: SymbolTable
      Check if the given address is an external entry point
      Specified by:
      isExternalEntryPoint in interface SymbolTable
      Parameters:
      addr - address to check
      Returns:
      true if specified address has been marked as an entry point, otherwise false
    • getExternalEntryPointIterator

      public AddressIterator getExternalEntryPointIterator()
      Description copied from interface: SymbolTable
      Get the external entry points (addresses)
      Specified by:
      getExternalEntryPointIterator in interface SymbolTable
      Returns:
      entry-point address iterator
    • getLabelHistory

      public LabelHistory[] getLabelHistory(Address addr)
      Description copied from interface: SymbolTable
      Get the label history for the given address

      Each entry records a change made to the labels at the given address

      Specified by:
      getLabelHistory in interface SymbolTable
      Parameters:
      addr - address of the label change
      Returns:
      array of history objects
    • getLabelHistory

      public Iterator<LabelHistory> getLabelHistory()
      Description copied from interface: SymbolTable
      Get the complete label history of the program
      Specified by:
      getLabelHistory in interface SymbolTable
      Returns:
      an iterator over history entries
    • hasLabelHistory

      public boolean hasLabelHistory(Address addr)
      Description copied from interface: SymbolTable
      Check if there is a history of label changes at the given address
      Specified by:
      hasLabelHistory in interface SymbolTable
      Parameters:
      addr - the address to check
      Returns:
      true if a label history exists for specified address, otherwise false
    • getNamespace

      public Namespace getNamespace(Address addr)
      Description copied from interface: SymbolTable
      Get the deepest namespace containing the given address
      Specified by:
      getNamespace in interface SymbolTable
      Parameters:
      addr - the address contained in the namespace
      Returns:
      the deepest namespace which contains the address
    • getClassNamespaces

      public Iterator<GhidraClass> getClassNamespaces()
      Description copied from interface: SymbolTable
      Get all class namespaces defined within the program, in no particular order
      Specified by:
      getClassNamespaces in interface SymbolTable
      Returns:
      an iterator over the classes
    • createClass

      public GhidraClass createClass(Namespace parent, String name, SourceType source) throws DuplicateNameException, InvalidInputException
      Description copied from interface: SymbolTable
      Create a class namespace in the given parent namespace
      Specified by:
      createClass in interface SymbolTable
      Parameters:
      parent - the parent namespace, or null for the global namespace
      name - the name of the namespace
      source - the source of this class namespace's symbol
      Returns:
      the new class namespace
      Throws:
      DuplicateNameException - thrown if another non function or label symbol exists with the given name
      InvalidInputException - throw if the name has invalid characters or is null
    • getChildren

      public SymbolIterator getChildren(Symbol parentSymbol)
      Description copied from interface: SymbolTable
      Get all symbols that have the given parent symbol

      NOTE: The resulting iterator will not return default thunks (i.e., thunk function symbol with default source type) or global dynamic label symbols.

      Specified by:
      getChildren in interface SymbolTable
      Parameters:
      parentSymbol - the parent symbol
      Returns:
      symbol iterator
    • createExternalLibrary

      public Library createExternalLibrary(String name, SourceType source) throws DuplicateNameException, InvalidInputException
      Description copied from interface: SymbolTable
      Create a library namespace with the given name
      Specified by:
      createExternalLibrary in interface SymbolTable
      Parameters:
      name - the name of the new library namespace
      source - the source of this external library's symbol
      Returns:
      the new library namespace
      Throws:
      DuplicateNameException - thrown if another non function or label symbol exists with the given name
      InvalidInputException - if the name is invalid
    • createNameSpace

      public Namespace createNameSpace(Namespace parent, String name, SourceType source) throws DuplicateNameException, InvalidInputException
      Description copied from interface: SymbolTable
      Create a new namespace
      Specified by:
      createNameSpace in interface SymbolTable
      Parameters:
      parent - the parent of the new namespace, or null for the global namespace
      name - the name of the new namespace
      source - the source of this namespace's symbol
      Returns:
      the new namespace
      Throws:
      DuplicateNameException - if another non function or label symbol exists with the given name
      InvalidInputException - if the name is invalid
    • getOrCreateNameSpace

      public Namespace getOrCreateNameSpace(Namespace parent, String name, SourceType source) throws DuplicateNameException, InvalidInputException
      Description copied from interface: SymbolTable
      Get or create the namespace with the given name in the given parent

      If the namespace does not already exists, then it will be created.

      Specified by:
      getOrCreateNameSpace in interface SymbolTable
      Parameters:
      parent - the parent namespace
      name - the namespace name
      source - the source type for the namespace if it is created
      Returns:
      the namespace
      Throws:
      DuplicateNameException - if another non function or label symbol exists with the given name
      InvalidInputException - if the name is invalid
    • convertNamespaceToClass

      public GhidraClass convertNamespaceToClass(Namespace namespace)
      Description copied from interface: SymbolTable
      Convert the given namespace to a class namespace
      Specified by:
      convertNamespaceToClass in interface SymbolTable
      Parameters:
      namespace - the namespace to convert
      Returns:
      the new class