Skip to content

[Symbol] Add manifest generator - #4693

Merged
mikem8361 merged 9 commits into
dotnet:mainfrom
mdh1418:add_symbol_manifest_generator
Jun 6, 2024
Merged

mikem8361 merged 9 commits into
dotnet:mainfrom
mdh1418:add_symbol_manifest_generator

Conversation

@mdh1418

@mdh1418 mdh1418 commented May 29, 2024 •

Copy link
Copy Markdown
Member

This PR aims to generate a manifest of additional debug entries for symbols uploaded through symbol.exe specific to .NET diagnostic scenarios. Manifest generation should occur prior to uploading symbols, and recursively iterates through a provided directory to generate a single manifest detailing additional debug entries applicable to .NET diagnostic scenarios. Following the same manifest format understood by symbol.exe, manifest data entries are constructed using information from accessible files in conjunction with the runtime modules' index they should be reindexed under.

Note:
As there is a breaking change in manifest format parsed by consecutive versions of symbol.exe, a legacy field is introduced to generate both a DebugInformationLevel in addition to debugInformationLevel so symbol.exe can parse the field regardless of whether it uses the PascalCase or camelCase property.


Testing

Directory Structure
Screenshot 2024-06-06 141305

Test program

using Microsoft.SymbolManifestGenerator;
DirectoryInfo symbolsDir = new DirectoryInfo(<path_to_symbols_directory>);
ITracer tracer = Tracer.Instance;
string manifestFilePath = Path.Combine(<path_to_symbols_directory>, "manifest.json");
SymbolManifestGenerator.GenerateManifest(tracer, symbolsDir, manifestFilePath);

Manifest file generated

{
  "entries": [
    {
      "basedirRelativePath": "binaries.arm64ret\\sos_amd64_arm64_4.8.9231.00.dll",
      "symbolKey": "<clientKey>",
      "sha512": "<fileHash>",
      "debugInformationLevel": 340,
      "DebugInformationLevel": 340
    },
    {
      "basedirRelativePath": "binaries.arm64ret\\sos_arm64_arm64_4.8.9231.00.dll",
      "symbolKey": "<clientKey>",
      "sha512": "<fileHash>",
      "debugInformationLevel": 340,
      "DebugInformationLevel": 340
    },
    {
      "basedirRelativePath": "binaries.arm64ret\\mscordacwks.dll",
      "symbolKey": "<clientKey>",
      "sha512": "<fileHash>",
      "debugInformationLevel": 340,
      "DebugInformationLevel": 340
    },
    {
      "basedirRelativePath": "binaries.arm64ret\\mscordbi.dll",
      "symbolKey": "<clientKey>",
      "sha512": "<fileHash>",
      "debugInformationLevel": 340,
      "DebugInformationLevel": 340
    },
    {
      "basedirRelativePath": "binaries.arm64ret\\mscordacwks_amd64_arm64_4.8.9231.00.dll",
      "symbolKey": "<clientKey>",
      "sha512": "<fileHash>",
      "debugInformationLevel": 340,
      "DebugInformationLevel": 340
    },
    {
      "basedirRelativePath": "binaries.arm64ret\\mscordacwks_arm64_arm64_4.8.9231.00.dll",
      "symbolKey": "<clientKey>",
      "sha512": "<fileHash>",
      "debugInformationLevel": 340,
      "DebugInformationLevel": 340
    }
  ],
  "version": "1"
}

Manually tested with symbol.exe, and uploaded 34 debug entries.

Further tested with a nupkg from .NET Core and generated the following manifest

{
  "entries": [
    {
      "basedirRelativePath": "runtimes\\win-arm64\\native\\mscordaccore.dll",
      "symbolKey": "<clientKey>",
      "sha512": "<fileHash>",
      "debugInformationLevel": 340,
      "DebugInformationLevel": 340
    },
    {
      "basedirRelativePath": "runtimes\\win-arm64\\native\\mscordbi.dll",
      "symbolKey": "<clientKey>",
      "sha512": "<fileHash>",
      "debugInformationLevel": 340,
      "DebugInformationLevel": 340
    },
    {
      "basedirRelativePath": "tools\\x64_arm64\\mscordaccore_amd64_arm64_9.0.24.28006.dll",
      "symbolKey": "<clientKey>",
      "sha512": "<fileHash>",
      "debugInformationLevel": 340,
      "DebugInformationLevel": 340
    },
    {
      "basedirRelativePath": "runtimes\\win-arm64\\native\\mscordaccore_arm64_arm64_9.0.24.28006.dll",
      "symbolKey": "<clientKey>",
      "sha512": "<fileHash>",
      "debugInformationLevel": 340,
      "DebugInformationLevel": 340
    }
  ],
  "version": "1"
}

@mdh1418
mdh1418 force-pushed the add_symbol_manifest_generator branch from 87fa73a to 214af60 Compare May 29, 2024 23:22
@mdh1418
mdh1418 requested a review from mikem8361 May 29, 2024 23:22
@mdh1418
mdh1418 marked this pull request as ready for review May 30, 2024 00:33
@mdh1418
mdh1418 requested a review from a team as a code owner May 30, 2024 00:33

@hoyosjs hoyosjs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

runtime packs don't have DAC colocation for cross arch long names

@mdh1418
mdh1418 force-pushed the add_symbol_manifest_generator branch from b163606 to 0bb7e14 Compare May 31, 2024 16:57
@mdh1418
mdh1418 requested a review from hoyosjs May 31, 2024 17:38
@mdh1418
mdh1418 force-pushed the add_symbol_manifest_generator branch from 6c3bbbc to af74a5f Compare June 4, 2024 14:58
@mdh1418
mdh1418 force-pushed the add_symbol_manifest_generator branch from 8b75069 to 2241025 Compare June 4, 2024 19:45
@mdh1418

mdh1418 commented Jun 6, 2024

Copy link
Copy Markdown
Member Author

Failures seem unrelated: #4718

@mdh1418
mdh1418 enabled auto-merge (squash) June 6, 2024 19:37
@mikem8361
mikem8361 disabled auto-merge June 6, 2024 19:55
@mikem8361
mikem8361 merged commit bca8344 into dotnet:main Jun 6, 2024
hoyosjs added a commit that referenced this pull request Jun 8, 2024
- Update Alpine versions (#4589)
- Followup 1ES template changes (#4596)
- Fix Test Results tab in github UI (#4607)
- Move the symstore repo to diagnostics (#4603)
- Fix recent Alpine repo build (#4612)
- Fix issue #4611 - Switch to cross build for Alpine (#4621)
- Add waithandle to --clrevents option (#4624)
- Fix SOS unit tests dump generation fixture (#4636)
- Fix CONTRACT return type (#4649)
- [SymbolStore] Add support to index .NET Framework Runtime debugging
modules (#4616)
- [test][SOS] Disable OtherCommands Dumpmt test on Alpine (#4656)
- Supports collecting GCSettingsEvent for gc-collect profile (#4615)
- Update ipc-protocol.md (#4658)
- Fixing a case where we should set the RundownKeyword (#4662)
- Fix versioning of symstore ported assets (#4670)
- Add ubuntu 22.04 testing. Update 6,7 and 8 runtime versions (#4676)
- Update locker action version to update node version (#4682)
- Use managed identity for blob upload of release assets (#4680)
- Remove the symweb symbol server support (#4694)
- [RISC-V] Add gcinfodumper implementation. (#4703)
- Fix `pathto` SOS command. (#4706)
- Add support for new exception trace storage format (#4635)
- Change SOS breaking change from warning to error; better dotnet-dump
target errors (#4713)
- [Symbol] Add manifest generator (#4693)
- Remove references to obsolete storage account variables (#4719)
- Update DIA to 17.10.0-beta1.24272.1 (#4683)
- Reenable SDL requirements (#4722)

---------

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rich Lander <[email protected]>
Co-authored-by: Mike McLaughlin <[email protected]>
Co-authored-by: Jan Vorlicek <[email protected]>
Co-authored-by: Grégoire <[email protected]>
Co-authored-by: Tom McDonald <[email protected]>
Co-authored-by: Mitchell Hwang <[email protected]>
Co-authored-by: Andrew Au <[email protected]>
Co-authored-by: Noah Falk <[email protected]>
Co-authored-by: Mikhail Kurinnoi <[email protected]>
Co-authored-by: Matt Mitchell <[email protected]>
hoyosjs added a commit that referenced this pull request Jun 12, 2024
- Update Alpine versions (#4589)
- Followup 1ES template changes (#4596)
- Fix Test Results tab in github UI (#4607)
- Move the symstore repo to diagnostics (#4603)
- Fix recent Alpine repo build (#4612)
- Fix issue #4611 - Switch to cross build for Alpine (#4621)
- Add waithandle to --clrevents option (#4624)
- Fix SOS unit tests dump generation fixture (#4636)
- Fix CONTRACT return type (#4649)
- [SymbolStore] Add support to index .NET Framework Runtime debugging
modules (#4616)
- [test][SOS] Disable OtherCommands Dumpmt test on Alpine (#4656)
- Supports collecting GCSettingsEvent for gc-collect profile (#4615)
- Update ipc-protocol.md (#4658)
- Fixing a case where we should set the RundownKeyword (#4662)
- Fix versioning of symstore ported assets (#4670)
- Add ubuntu 22.04 testing. Update 6,7 and 8 runtime versions (#4676)
- Update locker action version to update node version (#4682)
- Use managed identity for blob upload of release assets (#4680)
- Remove the symweb symbol server support (#4694)
- [RISC-V] Add gcinfodumper implementation. (#4703)
- Fix `pathto` SOS command. (#4706)
- Add support for new exception trace storage format (#4635)
- Change SOS breaking change from warning to error; better dotnet-dump
target errors (#4713)
- [Symbol] Add manifest generator (#4693)
- Remove references to obsolete storage account variables (#4719)
- Update DIA to 17.10.0-beta1.24272.1 (#4683)
- Reenable SDL requirements (#4722)
- Disable CG on musl leg due to lack of proper support (#4726)
- Update SOS breaking change version for Exception's _stackTrace changes
in .NET 9 (#4733)
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants