Add basic PDB reading capability (and vendor-in dnlib)#2592
Conversation
89fd9fe to
9391b09
Compare
9391b09 to
0bf3b1e
Compare
tonyredondo
left a comment
There was a problem hiding this comment.
LGTM, just a comment about the native nuget dependency
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" /> | ||
| <PackageReference Include="Microsoft.DiaSymReader.Native" Version="1.7.0" /> |
There was a problem hiding this comment.
this is not required in this PR right?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| public static DatadogPdbReader CreatePdbReader(string assemblyFullPath) | ||
| { | ||
| var module = ModuleDefMD.Load(File.OpenRead(assemblyFullPath)); |
There was a problem hiding this comment.
According to the documentation of ModuleDefMD, the stream is owned by the caller, so you need to dispose it.
There was a problem hiding this comment.
Great catch, thank you! Fixed in 303ff50
This comment has been minimized.
This comment has been minimized.
Code Coverage Report 📊✔️ Merging #2592 into master will not change line coverage
View the full report for further details: Datadog.Trace Breakdown ✔️
The following classes have significant coverage changes.
The following classes were added in #2592:
View the full reports for further details: |
Benchmarks Report 🐌Benchmarks for #2592 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Unknown 🤷 Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️Raw results
|
Summary of changes
DatadogPdbReaderclass (will be extended further in debugger slydog repo)For convenience's sake it's recommended to review this PR per commit, as some commits introduce renames which change many files.
Reason for change
Live Debugger, CI Visibility, and Continuous Profiler all require the ability to read PDB files.
Implementation details
For insight into why we chose
dnlibspecifically for reading PDBs, see https://github.com/OmerRaviv/PdbBenchmarksNote that we are currently using
dnlib's managed reader for Windows PDBs. A future PR will add a dependency on theMicrosoft.DiaSymReader.Nativenuget package, which would then be picked up automatically bydnliband improve the performance considerably.Test coverage
A very basic integration test was added. This should be sufficient for now as very exhaustive tests for both the Windows PDB and Portable PDB scenarios are being added in the debugger slydog repo.