Interface Settings

interface Settings {
    get(settingId: string): string | number | boolean;
    getDetailedSettings(): DebugSetting[];
    set(settingId: string, value: string | number | boolean): void;
}

Methods

  • Get the value of a specific debugger setting

    Parameters

    • settingId: string

      The identifier for the desired setting

    Returns string | number | boolean

    The value of the setting

    Will throw if the setting does not exist

    // Get a boolean indicating if debugger is configured to auto run to a label on reset
    let autoRun = session.settings.get("AutoRunToLabelOnReset");

    // print the label (a string) to which the debugger will run to on a restart or reset (if configured to do so)
    console.log(session.settings.get("AutoRunToLabelName"));
  • Get a detailed list of all debugger settings.

    Returns DebugSetting[]

    A list of objects which detail each debugger setting

    let settings = session.settings.getDetailedSettings();

    // print details of settings
    for (const setting of settings) {
    console.log(`${setting.id}:`);
    console.log(` type: ${setting.type}`);
    console.log(` name: ${setting.name}`);
    console.log(` value: ${setting.value}`);
    if (setting.allowedValues) {
    console.log(` allowedValues: ${JSON.stringify(setting.allowedValues)}`);
    }
    if (setting.allowedRange) {
    console.log(` allowedRange: [${setting.allowedRange.min}, ${setting.allowedRange.max}]`);
    }
    console.log("");
    }
  • Set the value of a specific debugger setting.

    Parameters

    • settingId: string

      The identifier for the desired setting

    • value: string | number | boolean

      The new value of the setting

    Returns void

    Will throw if the setting does not exist, or the provided value cannot be set on the setting.

    // Configure the debugger to auto-run to a label named SYSCFG_DL_init on reset
    session.settings.set("AutoRunToLabelName", "SYSCFG_DL_init");
    session.settings.set("AutoRunToLabelOnReset", true);