Interface Symbols

interface Symbols {
    add(fullPath: string): void;
    addWithOffset(fullPath: string, codeOffset: string | number | bigint, dataOffset: string | number | bigint, relativeOffset?: boolean): void;
    getAddress(symbol: string): null | bigint;
    load(fullPath: string): void;
    loadWithOffset(fullPath: string, codeOffset: string | number | bigint, dataOffset: string | number | bigint, relativeOffset?: boolean): void;
    lookupSymbols(start: DSLocation, length?: string | number | bigint): string[];
    remove(fullPath: string): void;
    unloadAllSymbols(): void;
}

Methods

  • Loads only the symbol information for the provided file and adds it to the currently loaded debug information.

    Parameters

    • fullPath: string

      full path to the file

    Returns void

    session.symbols.add("C:/my_project/Debug/example.out");
    
  • Parameters

    • fullPath: string
    • codeOffset: string | number | bigint
    • dataOffset: string | number | bigint
    • OptionalrelativeOffset: boolean

    Returns void

  • Returns the address of the provided symbol if it exists.

    Parameters

    • symbol: string

      name of the symbol to lookup

    Returns null | bigint

    address of the symbol

    // Get the address of the main function
    const address = session.symbols.getAddress("main");

    // Get the address of a global variable
    const address = session.symbols.getAddress("my_global");
  • Loads only the symbol information for the provided file and replaces the currently loaded symbol information with it. This is equivalent to calling unloadAllSymbols followed by add.

    Parameters

    • fullPath: string

      full path to the file

    Returns void

    session.symbols.load("C:/my_project/Debug/example.out");
    
  • Parameters

    • fullPath: string
    • codeOffset: string | number | bigint
    • dataOffset: string | number | bigint
    • OptionalrelativeOffset: boolean

    Returns void

  • Returns the names of all symbols at the provided location, or in the provided range

    Parameters

    • start: DSLocation

      location at which to look for symbols

    • Optionallength: string | number | bigint

      length of range in which to look for symbols (defaults to 0)

    Returns string[]

    list of symbol names

    // Look up symbols at 0x100
    const symbols = session.symbols.lookupSymbols(0x100);

    // Look up symbols in the range 0x100 to 0x140
    const symbols = session.symbols.lookupSymbols(0x100, 0x40);
  • Removes the symbol information defined in the provided file. Symbol information from other files is not affected.

    Parameters

    • fullPath: string

      full path to the file

    Returns void

    session.symbols.remove("C:/my_project/Debug/example.out");
    
  • Unloads all symbol information. This is equivalent to calling remove for all currently loaded files.

    Returns void

    session.symbols.unloadAllSymbols();