From e2b2a1de67d8e99bd42cada9a6ac5286820a3f82 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 13 Feb 2023 14:06:13 +0100 Subject: [PATCH 1/6] Add Source Map Images to Debug Meta Interface --- src/docs/sdk/event-payloads/debugmeta.mdx | 34 +++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/docs/sdk/event-payloads/debugmeta.mdx b/src/docs/sdk/event-payloads/debugmeta.mdx index f7af8b1179..e12f99d210 100644 --- a/src/docs/sdk/event-payloads/debugmeta.mdx +++ b/src/docs/sdk/event-payloads/debugmeta.mdx @@ -333,8 +333,8 @@ URL pulled from the `external_debug_info` custom section. `code_id` -: _Optional_. Identifier of the WASM file. It is the value of the -`build_id` custom section formatted as HEX string. It can be omitted in case +: _Optional_. Identifier of the WASM file. It is the value of the +`build_id` custom section formatted as HEX string. It can be omitted in case the section contains a UUID (16 bytes). `code_file` @@ -370,6 +370,36 @@ Example: } ``` +### Source Map Images + +Source Map images are used to provide information about which artifact (i.e. +source map) should be used to deminify a particular file. We use the `filename` +property of a stack frame and the `source_filename` field in the image to query +for a source map file via the `debug_id` field. + +Attributes: + +`type` + +: **Required**. Type of the debug image. Must be `"sourcemap"`. + +`source_filename` + +: **Required**. Name of the file that should be mapped. + +`debug_id` + +: **Required**. Identifier of the file that will be used to resolve the source +file (`source_filename`). + +```json +{ + "type": "sourcemap", + "source_filename": "https://example.com/static/js/main.js", + "debug_id": "395835f4-03e0-4436-80d3-136f0749a893" +} +``` + ## Examples See examples for types of debug images above. From ec17e6242dceca3c2cd513d52ccf877dfd43cc75 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 13 Feb 2023 14:54:10 +0100 Subject: [PATCH 2/6] . --- src/docs/sdk/event-payloads/debugmeta.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/sdk/event-payloads/debugmeta.mdx b/src/docs/sdk/event-payloads/debugmeta.mdx index e12f99d210..6f5cd537ef 100644 --- a/src/docs/sdk/event-payloads/debugmeta.mdx +++ b/src/docs/sdk/event-payloads/debugmeta.mdx @@ -373,7 +373,7 @@ Example: ### Source Map Images Source Map images are used to provide information about which artifact (i.e. -source map) should be used to deminify a particular file. We use the `filename` +source map) should be used to deminify a particular file. We use the `abs_path` property of a stack frame and the `source_filename` field in the image to query for a source map file via the `debug_id` field. From c47eba196b634a7bf960da60b194f0910b5a207a Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 13 Feb 2023 16:19:09 +0100 Subject: [PATCH 3/6] . --- src/docs/sdk/event-payloads/debugmeta.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/docs/sdk/event-payloads/debugmeta.mdx b/src/docs/sdk/event-payloads/debugmeta.mdx index 6f5cd537ef..e3b80d19a2 100644 --- a/src/docs/sdk/event-payloads/debugmeta.mdx +++ b/src/docs/sdk/event-payloads/debugmeta.mdx @@ -33,10 +33,11 @@ and their memory addresses. Instruction addresses in the [Stack Trace](/sdk/even mapped into the list of debug images in order to retrieve debug files for symbolication. -There are two kinds of debug images: +There are three kinds of debug images: - Native debug images with types `macho`, `elf`, and `pe` - Android debug images with type `proguard` +- JavaScript source map debug images with type `sourcemap` ### Mach-O Images From 011dff2c6809dc9d6694b9398f1c4216c4418519 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Mon, 13 Feb 2023 16:19:59 +0100 Subject: [PATCH 4/6] . --- src/docs/sdk/event-payloads/debugmeta.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/sdk/event-payloads/debugmeta.mdx b/src/docs/sdk/event-payloads/debugmeta.mdx index e3b80d19a2..ca2f695f5f 100644 --- a/src/docs/sdk/event-payloads/debugmeta.mdx +++ b/src/docs/sdk/event-payloads/debugmeta.mdx @@ -327,7 +327,7 @@ leading 16 bytes. `debug_file` -: _Optional_: Name or absolute URL to the WASM file containing debug +: _Optional_. Name or absolute URL to the WASM file containing debug information for this image. This value might be required to retrieve debug files from certain symbol servers. This should correspond to the externalized URL pulled from the `external_debug_info` custom section. From bce70213adb367a55df7a6325e0df82729e54ac4 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Tue, 14 Feb 2023 09:46:29 +0100 Subject: [PATCH 5/6] new format --- src/docs/sdk/event-payloads/debugmeta.mdx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/docs/sdk/event-payloads/debugmeta.mdx b/src/docs/sdk/event-payloads/debugmeta.mdx index ca2f695f5f..0fa8a84710 100644 --- a/src/docs/sdk/event-payloads/debugmeta.mdx +++ b/src/docs/sdk/event-payloads/debugmeta.mdx @@ -374,9 +374,9 @@ Example: ### Source Map Images Source Map images are used to provide information about which artifact (i.e. -source map) should be used to deminify a particular file. We use the `abs_path` -property of a stack frame and the `source_filename` field in the image to query -for a source map file via the `debug_id` field. +source map) should be used to resolve a particular JavaScript file to its +original source. We use the `abs_path` property of a stack frame and the `url` +field in the image to query for a source map file via the `debug_id` field. Attributes: @@ -384,19 +384,20 @@ Attributes: : **Required**. Type of the debug image. Must be `"sourcemap"`. -`source_filename` +`url` -: **Required**. Name of the file that should be mapped. +: **Required**. Url of the file that should be mapped. Corresponds to the +`abs_path` property inside a stack frame. `debug_id` : **Required**. Identifier of the file that will be used to resolve the source -file (`source_filename`). +file. ```json { "type": "sourcemap", - "source_filename": "https://example.com/static/js/main.js", + "url": "https://example.com/static/js/main.js", "debug_id": "395835f4-03e0-4436-80d3-136f0749a893" } ``` From b66608ee95786d9355144df4a3da11e737b37d5a Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Tue, 14 Feb 2023 10:19:27 +0100 Subject: [PATCH 6/6] code file instead of url --- src/docs/sdk/event-payloads/debugmeta.mdx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/docs/sdk/event-payloads/debugmeta.mdx b/src/docs/sdk/event-payloads/debugmeta.mdx index 0fa8a84710..b322d0cf98 100644 --- a/src/docs/sdk/event-payloads/debugmeta.mdx +++ b/src/docs/sdk/event-payloads/debugmeta.mdx @@ -375,8 +375,9 @@ Example: Source Map images are used to provide information about which artifact (i.e. source map) should be used to resolve a particular JavaScript file to its -original source. We use the `abs_path` property of a stack frame and the `url` -field in the image to query for a source map file via the `debug_id` field. +original source. We use the `abs_path` property of a stack frame and the +`code_file` field in the image to query for a source map file via the `debug_id` +field. Attributes: @@ -384,9 +385,9 @@ Attributes: : **Required**. Type of the debug image. Must be `"sourcemap"`. -`url` +`code_file` -: **Required**. Url of the file that should be mapped. Corresponds to the +: **Required**. Path/Url of the file that should be mapped. Corresponds to the `abs_path` property inside a stack frame. `debug_id` @@ -397,7 +398,7 @@ file. ```json { "type": "sourcemap", - "url": "https://example.com/static/js/main.js", + "code_file": "https://example.com/static/js/main.js", "debug_id": "395835f4-03e0-4436-80d3-136f0749a893" } ```