Skip to content

Add source map support for full stacktraces#2039

Merged
koesie10 merged 3 commits intomainfrom
koesie10/source-map-script-stacktrace
Feb 7, 2023
Merged

Add source map support for full stacktraces#2039
koesie10 merged 3 commits intomainfrom
koesie10/source-map-script-stacktrace

Conversation

@koesie10
Copy link
Copy Markdown
Member

@koesie10 koesie10 commented Feb 3, 2023

This adds support for mapping full stacktraces in the source map script. This allows you to pass a full stacktrace to the script and get back a stacktrace with all original positions.

Based on #2037

Example input:

npx ts-node scripts/source-map.ts v1.7.8 'Error: Failed to find CodeQL distribution.
    at CodeQLCliServer.getCodeQlPath (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/out/extension.js:131164:13)
    at CodeQLCliServer.launchProcess (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/out/extension.js:131169:24)
    at CodeQLCliServer.runCodeQlCliInternal (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/out/extension.js:131194:24)
    at CodeQLCliServer.runJsonCodeQlCliCommand (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/out/extension.js:131330:20)
    at CodeQLCliServer.resolveRam (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/out/extension.js:131455:12)
    at QueryServerClient2.startQueryServerImpl (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/out/extension.js:138618:21)'

Output:

Error: Failed to find CodeQL distribution.
    at CodeQLCliServer.getCodeQlPath (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/src/cli.ts:281:12)
    at CodeQLCliServer.launchProcess (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/src/cli.ts:290:23)
    at CodeQLCliServer.runCodeQlCliInternal (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/src/cli.ts:324:23)
    at CodeQLCliServer.runJsonCodeQlCliCommand (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/src/cli.ts:575:19)
    at CodeQLCliServer.resolveRam (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/src/cli.ts:809:11)
    at QueryServerClient2.startQueryServerImpl (/Users/user/.vscode/extensions/github.vscode-codeql-1.7.8/src/query-server/queryserver-client.ts:125:20)

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

This adds support for mapping full stacktraces in the source map
script. This allows you to pass a full stacktrace to the script and get
back a stacktrace with all original positions.
@koesie10 koesie10 requested a review from a team as a code owner February 3, 2023 14:24
Copy link
Copy Markdown
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't actually tried this out myself, but the code looks generally good. Small suggestion inline.

Comment thread extensions/ql-vscode/scripts/source-map.ts Outdated
Base automatically changed from koesie10/source-map-script to main February 7, 2023 16:37
@koesie10 koesie10 enabled auto-merge February 7, 2023 16:40
@koesie10 koesie10 added the secexp label Feb 7, 2023
@koesie10 koesie10 merged commit 81502fe into main Feb 7, 2023
@koesie10 koesie10 deleted the koesie10/source-map-script-stacktrace branch February 7, 2023 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants