Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit 97b09ca

Browse files
authored
Add Source Map Images to Debug Meta Interface (#836)
1 parent 1bdcc1e commit 97b09ca

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

src/docs/sdk/event-payloads/debugmeta.mdx

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ and their memory addresses. Instruction addresses in the [Stack Trace](/sdk/even
3333
mapped into the list of debug images in order to retrieve debug files for
3434
symbolication.
3535

36-
There are two kinds of debug images:
36+
There are three kinds of debug images:
3737

3838
- Native debug images with types `macho`, `elf`, and `pe`
3939
- Android debug images with type `proguard`
40+
- JavaScript source map debug images with type `sourcemap`
4041

4142
### Mach-O Images
4243

@@ -326,15 +327,15 @@ leading 16 bytes.
326327

327328
`debug_file`
328329

329-
: _Optional_: Name or absolute URL to the WASM file containing debug
330+
: _Optional_. Name or absolute URL to the WASM file containing debug
330331
information for this image. This value might be required to retrieve debug
331332
files from certain symbol servers. This should correspond to the externalized
332333
URL pulled from the `external_debug_info` custom section.
333334

334335
`code_id`
335336

336-
: _Optional_. Identifier of the WASM file. It is the value of the
337-
`build_id` custom section formatted as HEX string. It can be omitted in case
337+
: _Optional_. Identifier of the WASM file. It is the value of the
338+
`build_id` custom section formatted as HEX string. It can be omitted in case
338339
the section contains a UUID (16 bytes).
339340

340341
`code_file`
@@ -370,6 +371,38 @@ Example:
370371
}
371372
```
372373

374+
### Source Map Images
375+
376+
Source Map images are used to provide information about which artifact (i.e.
377+
source map) should be used to resolve a particular JavaScript file to its
378+
original source. We use the `abs_path` property of a stack frame and the
379+
`code_file` field in the image to query for a source map file via the `debug_id`
380+
field.
381+
382+
Attributes:
383+
384+
`type`
385+
386+
: **Required**. Type of the debug image. Must be `"sourcemap"`.
387+
388+
`code_file`
389+
390+
: **Required**. Path/Url of the file that should be mapped. Corresponds to the
391+
`abs_path` property inside a stack frame.
392+
393+
`debug_id`
394+
395+
: **Required**. Identifier of the file that will be used to resolve the source
396+
file.
397+
398+
```json
399+
{
400+
"type": "sourcemap",
401+
"code_file": "https://example.com/static/js/main.js",
402+
"debug_id": "395835f4-03e0-4436-80d3-136f0749a893"
403+
}
404+
```
405+
373406
## Examples
374407

375408
See examples for types of debug images above.

0 commit comments

Comments
 (0)