deno/tools/release/create_symcache.ts
Bartek Iwańczuk cd0a592b2d
fix: restore Windows debug info (#30778)
Restores generation of debug info on Windows, that was disabled in 2.5.0
as part of V8 upgrade - https://github.com/denoland/deno/pull/30629
2025-09-18 18:14:05 -07:00

28 lines
828 B
TypeScript

// Copyright 2018-2025 the Deno authors. MIT license.
// deno-lint-ignore-file no-console
import { createSymcache } from "jsr:@deno/panic@0.1.0";
import path from "node:path";
// Generate symcache for the current Deno executable.
let debugFile = Deno.execPath();
if (Deno.build.os === "windows") {
debugFile = debugFile.replace(/\.exe$/, ".pdb");
} else if (Deno.build.os === "darwin") {
const resolvedPath = Deno.realPathSync(`${debugFile}.dSYM`);
const { name } = path.parse(resolvedPath);
debugFile = path.join(resolvedPath, "Contents/Resources/DWARF", name);
}
const outfile = Deno.args[0];
if (!outfile) {
console.error("Usage: ./target/release/deno -A create_symcache.ts <outfile>");
Deno.exit(1);
}
const symcache = createSymcache(Deno.readFileSync(debugFile));
Deno.writeFileSync(outfile, symcache);