diff --git a/src/flags.ts b/src/flags.ts index 55b1e344c..20a4a9073 100644 --- a/src/flags.ts +++ b/src/flags.ts @@ -49,6 +49,13 @@ export type Flag = * Injects the webmanifest which allows installation. */ | "pwa" + /** + * Passes the debugWasm flag to the simulator. + * + * The simulator then loads its debug firmware, which enables Emscripten + * assertions and has DWARF for the DevTools C/C++ debugging extension. + */ + | "simDebugWasm" /** * Enables in-context Crowdin translating. */ @@ -71,6 +78,7 @@ const allFlags: FlagMetadata[] = [ name: "pwa", defaultOnStages: ["REVIEW", "STAGING", "PRODUCTION"], }, + { name: "simDebugWasm", defaultOnStages: [] }, ]; type Flags = Record; diff --git a/src/simulator/Simulator.tsx b/src/simulator/Simulator.tsx index 7c9b5b7eb..0f197d7eb 100644 --- a/src/simulator/Simulator.tsx +++ b/src/simulator/Simulator.tsx @@ -17,6 +17,7 @@ import SimulatorActionBar from "./SimulatorActionBar"; import SimulatorSplitView from "./SimulatorSplitView"; import SimSerialTabControlProvider from "./tab-control-hooks"; import { stage } from "../environment"; +import { flags } from "../flags"; export enum RunningStatus { RUNNING, @@ -41,7 +42,7 @@ const Simulator = ({ const brand500 = token("colors.brand.500"); const url = useMemo(() => { const production = - "https://python-simulator.usermbit.org/v/0.1/simulator.html?flag=sw"; + "https://python-simulator.usermbit.org/v/0.2/simulator.html?flag=sw"; const staging = "https://python-simulator.usermbit.org/staging/simulator.html?flag=sw"; @@ -50,6 +51,9 @@ const Simulator = ({ //const url = new URL(`https://review-python-simulator.usermbit.org/${branch}/simulator.html`); const url = new URL(stage === "PRODUCTION" ? production : staging); url.searchParams.append("color", brand500); + if (flags.simDebugWasm) { + url.searchParams.append("flag", "debugWasm"); + } return url.toString(); }, [brand500]);