Skip to content

Commit 5021ae6

Browse files
committed
Fixup gdb unzip on Windows
1 parent ef59115 commit 5021ae6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
"name": "Run download-tools.ts",
2626
"skipFiles": ["<node_internals>/**"],
2727
"program": "${workspaceFolder}/scripts/download-tools.ts",
28-
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/ts-node",
29-
"runtimeArgs": [],
30-
"args": ["-f", "gdb"]
28+
"runtimeExecutable": "npx",
29+
"runtimeArgs": ["tsx"],
30+
"args": ["-f", "gdb", "-t", "win32-x64"]
3131
},
3232
{
3333
"type": "node",

scripts/download-tools.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,21 @@ const pyocd : Downloadable = new Downloadable(
6767
const gdb : Downloadable = new Downloadable(
6868
'GNU Debugger for Arm', 'gdb',
6969
async (target) => {
70-
const { build, ext } = {
71-
'win32-x64': { build: 'mingw-w64-x86_64', ext: 'zip' },
72-
'win32-arm64': { build: 'mingw-w64-x86_64', ext: 'zip' },
73-
'linux-x64': { build: 'x86_64', ext: 'tar.xz'},
74-
'linux-arm64': { build: 'aarch64', ext: 'tar.xz'},
75-
'darwin-x64': { build: 'darwin-arm64', ext: 'tar.xz'},
76-
'darwin-arm64': { build: 'darwin-arm64', ext: 'tar.xz'},
70+
const { build, ext, strip } = {
71+
'win32-x64': { build: 'mingw-w64-x86_64', ext: 'zip', strip: 0 },
72+
'win32-arm64': { build: 'mingw-w64-x86_64', ext: 'zip', strip: 0 },
73+
'linux-x64': { build: 'x86_64', ext: 'tar.xz', strip: 1 },
74+
'linux-arm64': { build: 'aarch64', ext: 'tar.xz', strip: 1 },
75+
'darwin-x64': { build: 'darwin-arm64', ext: 'tar.xz', strip: 1 },
76+
'darwin-arm64': { build: 'darwin-arm64', ext: 'tar.xz', strip: 1 },
7777
}[target];
7878

7979
const json = await downloader.getPackageJson<CmsisPackageJson>();
8080
const version = json?.cmsis?.gdb;
8181
const asset_name = `arm-gnu-toolchain-${build}-arm-none-eabi-gdb.${ext}`;
8282
const url = new URL(`https://artifacts.tools.arm.com/arm-none-eabi-gdb/${version}/${asset_name}`);
8383
const dlAsset = new WebFileAsset(url, asset_name, version);
84-
const asset = new ArchiveFileAsset(dlAsset, 1);
84+
const asset = new ArchiveFileAsset(dlAsset, strip);
8585
return asset;
8686
},
8787
);

0 commit comments

Comments
 (0)