From 0d5285a658678c04a341ee5542c0ca85cf551188 Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Tue, 4 Oct 2022 17:41:51 +0200 Subject: [PATCH 1/2] feat: Add support for portable pdb debug files --- src/sentry/api/endpoints/chunk.py | 1 + src/sentry/constants.py | 1 + src/sentry/models/debugfile.py | 3 ++- static/app/views/settings/projectDebugFiles/index.tsx | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sentry/api/endpoints/chunk.py b/src/sentry/api/endpoints/chunk.py index ac75f2b980998a..799fabb513a627 100644 --- a/src/sentry/api/endpoints/chunk.py +++ b/src/sentry/api/endpoints/chunk.py @@ -30,6 +30,7 @@ "sources", # Source artifact bundle upload "bcsymbolmaps", # BCSymbolMaps and associated PLists/UuidMaps "il2cpp", # Il2cpp LineMappingJson files + "portablepdbs", # Portable PDB debug file ) diff --git a/src/sentry/constants.py b/src/sentry/constants.py index 3b8aac31cd462a..ddaac1fd22721c 100644 --- a/src/sentry/constants.py +++ b/src/sentry/constants.py @@ -291,6 +291,7 @@ def get_all_languages() -> List[str]: "application/x-bcsymbolmap": "bcsymbolmap", "application/x-debugid-map": "uuidmap", "application/x-il2cpp-json": "il2cpp", + "application/x-portable-pdb": "portablepdb", } NATIVE_UNKNOWN_STRING = "" diff --git a/src/sentry/models/debugfile.py b/src/sentry/models/debugfile.py index c117c73a8ab238..43532404173e0f 100644 --- a/src/sentry/models/debugfile.py +++ b/src/sentry/models/debugfile.py @@ -184,7 +184,7 @@ def file_extension(self) -> str: return "" if self.file_type == "exe" else ".debug" if self.file_format == "pe": return ".exe" if self.file_type == "exe" else ".dll" - if self.file_format == "pdb": + if self.file_format == "pdb" or self.file_format == "portablepdb": return ".pdb" if self.file_format == "sourcebundle": return ".src.zip" @@ -275,6 +275,7 @@ def create_dif_from_id( "elf", "pdb", "pe", + "portablepdb", "wasm", "sourcebundle", "bcsymbolmap", diff --git a/static/app/views/settings/projectDebugFiles/index.tsx b/static/app/views/settings/projectDebugFiles/index.tsx index 933c3fe01e73f5..b0c9fb7c29c799 100644 --- a/static/app/views/settings/projectDebugFiles/index.tsx +++ b/static/app/views/settings/projectDebugFiles/index.tsx @@ -72,6 +72,7 @@ class ProjectDebugSymbols extends AsyncView { 'bcsymbolmap', 'uuidmap', 'il2cpp', + 'portablepdb', ], }, }, From 5a6d6d9b95363caa1229b8ab7d5fafa1eb9ec3d6 Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Wed, 12 Oct 2022 11:40:36 +0200 Subject: [PATCH 2/2] send pe_dotnet images to symbolicator --- src/sentry/lang/native/processing.py | 2 ++ src/sentry/lang/native/utils.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sentry/lang/native/processing.py b/src/sentry/lang/native/processing.py index 72a52fb8b0ab11..821c56523907d6 100644 --- a/src/sentry/lang/native/processing.py +++ b/src/sentry/lang/native/processing.py @@ -52,6 +52,8 @@ def _merge_frame(new_frame, symbolicated, platform="native"): new_frame["function"] = func if symbolicated.get("instruction_addr"): new_frame["instruction_addr"] = symbolicated["instruction_addr"] + if symbolicated.get("function_id"): + new_frame["function_id"] = symbolicated["function_id"] if symbolicated.get("symbol"): new_frame["symbol"] = symbolicated["symbol"] if symbolicated.get("abs_path"): diff --git a/src/sentry/lang/native/utils.py b/src/sentry/lang/native/utils.py index e15fb26c2d1254..767623e5c0b277 100644 --- a/src/sentry/lang/native/utils.py +++ b/src/sentry/lang/native/utils.py @@ -12,8 +12,9 @@ WINDOWS_PATH_RE = re.compile(r"^([a-z]:\\|\\\\)", re.IGNORECASE) # Event platforms that could contain native stacktraces -# il2cpp events have the "csharp" platform, and we do need to run those -# through symbolicator to correctly symbolicate il2cpp stack frames. +# "csharp" events are also considered "native" as they are processed by symbolicator. +# This includes il2cpp events that are symbolicated using native debug files, +# as well as .NET with Portable PDB files which are handled by symbolicator. NATIVE_PLATFORMS = ("cocoa", "native", "csharp") # Debug image types that can be handled by the symbolicator @@ -23,6 +24,7 @@ "elf", # Linux "macho", # macOS, iOS "pe", # Windows + "pe_dotnet", # Portable PDB "wasm", # WASM )