Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Add symbol support helper class for mscorlib's StackTrace. #8670

Merged
merged 1 commit into from
May 21, 2016

Conversation

mikem8361
Copy link
Member

This new helper class uses the portable pdb reader in System.Reflection.Metadata
to read the source/line number information for stack frames.

@mikem8361
Copy link
Member Author

@ellismg, @stephentoub @jkotas @noahfalk I addressed all the code review feedback.

  1. removed all the catch-all try/catches
  2. added some recursion protection
  3. updated to the proper coding convention
  4. moved the code in the new assembly to System.Diagnostics.StackTrace
  5. added caching of metadata readers using the loaded PE image address
  6. misc cleanup.

@@ -27,6 +32,18 @@
<ItemGroup>
<Compile Include="System\Diagnostics\StackFrameExtensions.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == ''">
<Compile Include="System\Diagnostics\StackTraceSymbols.CoreCLR.cs" />
Copy link
Contributor

Choose a reason for hiding this comment

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

@weshaggard This project compiles for three target groups. I think we only need this for .NET Core (since CoreCLR will use it) but can you confirm this is the right thing to do?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess I only waiting for feedback from Wes on this issue. I’ve addressed got an ok from the rest of the reviewers.

From: Matt Ellis [mailto:notifications@github.com]
Sent: Wednesday, May 18, 2016 6:26 PM
To: dotnet/corefx corefx@noreply.github.com
Cc: Mike McLaughlin mikem@microsoft.com; Assign assign@noreply.github.com
Subject: Re: [dotnet/corefx] Add symbol support helper class for mscorlib's StackTrace. (#8670)

In src/System.Diagnostics.StackTrace/src/System.Diagnostics.StackTrace.csprojhttps://github.com//pull/8670#discussion_r63810461:

@@ -27,6 +32,18 @@

 <Compile Include="System\Diagnostics\StackFrameExtensions.cs" />
- -

@weshaggardhttps://github.com/weshaggard This project compiles for three target groups. I think we only need this for .NET Core (since CoreCLR will use it) but can you confirm this is the right thing to do?


You are receiving this because you were assigned.
Reply to this email directly or view it on GitHubhttps://github.com//pull/8670/files/46ebb77cdef1f2c23a599e5f0dbd2e0cb7fa9d59#r63810461

@jkotas
Copy link
Member

jkotas commented May 19, 2016

LGTM

{
public class StackTraceSymbols : IDisposable
{
Dictionary<IntPtr, Tuple<MetadataReaderProvider, MetadataReader>> _readerCache;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: private readonly

@stephentoub
Copy link
Member

A few nits, otherwise LGTM.

@mikem8361
Copy link
Member Author

@dotnet-bot test Innerloop Windows_NT Release Build and Test

@mikem8361
Copy link
Member Author

@dotnet-bot test Innerloop Windows_NT Debug Build and Test

@mikem8361
Copy link
Member Author

@dotnet-bot test Innerloop CentOS7.1 Debug Build and Test

@mikem8361
Copy link
Member Author

@dotnet-bot test Innerloop CentOS7.1 Release Build and Test

@ericstj
Copy link
Member

ericstj commented May 19, 2016

Windows_NT build failed because you are missing OSGroup from your project reference between System.Diagnostics.StackTrace.csproj and System.Threading.Overlapped.csproj.

<ItemGroup Condition="'$(TargetGroup)' == ''">
<Compile Include="System\Diagnostics\StackTraceSymbols.CoreCLR.cs" />
<ProjectReference Include="..\..\System.Collections\src\System.Collections.csproj" />
<ProjectReference Include="..\..\System.Threading.Overlapped\src\System.Threading.Overlapped.csproj" />
Copy link
Member

Choose a reason for hiding this comment

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

This requires an Windows_NT.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I don’t understand exactly. Are you saying that I need to exclude building StackTraceSymbols.CoreCLR.cs for the Windows_NT with a conditional like ‘$(OSGroup)’ != ‘Windows_NT’?

We want this code on Windows too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ping.

Copy link
Contributor

Choose a reason for hiding this comment

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

Eric, just so I understand as well, the feedback is to guard the P2P reference to System.Threading.Overlapped to happen only when $(TargetGroup) == '' and $(OSGroup) == 'Windows_NT'?

Copy link
Member

Choose a reason for hiding this comment

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

If you build locally with build.cmd you'll see the failure.

System.Threading.Overlapped only builds with Windows_NT. You need to add that metadata here to the project reference so that you don't build that project with different global properties. It's more about not introducing a race condition in the build than actually building for Windows. You may not even need the overlapped reference at all, so if you can remove it that'd be better.

@ellismg
Copy link
Contributor

ellismg commented May 20, 2016

Mike, can you pick up ellismg/corefx@3fa755c? I worked with Eric to clean up the bin clashes, and we believe this should work.

@@ -0,0 +1,34 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you just delete this SLN? We usually put slns up a level and they include everything.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. I didn’t really mean to add it.

From: Matt Ellis [mailto:notifications@github.com]
Sent: Friday, May 20, 2016 11:50 AM
To: dotnet/corefx corefx@noreply.github.com
Cc: Mike McLaughlin mikem@microsoft.com; Assign assign@noreply.github.com
Subject: Re: [dotnet/corefx] Add symbol support helper class for mscorlib's StackTrace. (#8670)

In src/System.Diagnostics.StackTrace/src/System.Diagnostics.StackTrace.slnhttps://github.com//pull/8670#discussion_r64089807:

@@ -0,0 +1,34 @@

+

Can you just delete this SLN? We usually put slns up a level and they include everything.


You are receiving this because you were assigned.
Reply to this email directly or view it on GitHubhttps://github.com//pull/8670/files/c97f9137ba65fbbaff6850d558df7778d201df70#r64089807

This new helper class uses the portable pdb reader in System.Reflection.Metadata
to read the source/line number information for stack frames.
@mikem8361
Copy link
Member Author

Thanks for your time and patience. It works!!

From: Matt Ellis [mailto:notifications@github.com]
Sent: Friday, May 20, 2016 11:39 AM
To: dotnet/corefx corefx@noreply.github.com
Cc: Mike McLaughlin mikem@microsoft.com; Assign assign@noreply.github.com
Subject: Re: [dotnet/corefx] Add symbol support helper class for mscorlib's StackTrace. (#8670)

Mike, can you pick up ellismg/corefx@3fa755chttps://github.com/ellismg/corefx/commit/3fa755c1decc94148ee1ab51cfaedeeacf77b05d? I worked with Eric to clean up the bin clashes, and we believe this should work.


You are receiving this because you were assigned.
Reply to this email directly or view it on GitHubhttps://github.com//pull/8670#issuecomment-220685639

@mikem8361
Copy link
Member Author

@dotnet-bot test Innerloop OSX Debug Build and Test

@mikem8361 mikem8361 merged commit 77dddc7 into dotnet:master May 21, 2016
@mikem8361 mikem8361 deleted the symbols branch May 21, 2016 00:02
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Add symbol support helper class for mscorlib's StackTrace.

Commit migrated from dotnet/corefx@77dddc7
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.

7 participants