mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00

Due to V8 upgrade in https://github.com/denoland/deno/pull/30629, we are not generating debug symbols on Windows and because of that symcache generation is not available.
31 lines
955 B
TypeScript
31 lines
955 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") {
|
|
// TODO(bartlomieju): fix the regression from V8 upgrade
|
|
// https://github.com/denoland/deno/pull/30629
|
|
// debugFile = debugFile.replace(/\.exe$/, ".pdb");
|
|
Deno.exit(0);
|
|
} 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);
|