-
Notifications
You must be signed in to change notification settings - Fork 90
Implements #70: Provide Q# call stack information with source locations in case Q# program fails #79
Conversation
avasch01
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
anpaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. I do have some comments but nothing major. Thanks!
anpaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks
| /// https://github.com/dotnet/designs/blob/master/accepted/diagnostics/source-link.md#source-link-json-schema | ||
| /// </summary> | ||
| [Serializable] | ||
| public class SourceLinkPathRemapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if this should just be called SourceLink or SourceLinkData or SourceLinkInfo.
| #region Stack trace collection support | ||
| private StackTraceCollector stackTraceCollector = null; | ||
|
|
||
| public void EnableStackTrace() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see if we can instead enabling by default and just disabling it explicitly.
…crosoft/qsharp-runtime into vadym-kl/70-qsharp-call-stack
Includes the following changes:
Microsoft.Quantum.Simulation.CommonStackTrace.cs: Q# specificStackFrameandStackTraceCollectorthat listens toSimulatorBaseevents to keep track of stack trace.PortablePDBReader.csto access SourceLink and source code information from PortablePDBs.SimulatorBase.cs: ModifiedRunmethod to dump Q# stack trace in case of unhandled exception, addedEnableStackTrace()method andCallStackproperty.Microsoft.Quantum.Simulation.Common.csproj: added dependency onSystem.Reflection.Metadatato read PortablePDBs.Microsoft.Quantum.Simulation.CoreIWrappedOperationinterface, so there is an easy uniform way to get to operation being wrapped byAdjointedOperation,ControlledOperationand other similar wrappers. This is necessary to get to the attributes that contain source file and line numbers ofICallables.This affects several files in
src/Simulation/Core/Genericsandsrc/Simulation/Core/Operations.UnwrapCallableto assist with unwrapping usingIWrappedOperationinterface.Microsoft.Quantum.QsCompiler.CsharpGenerationIncludes @bettinaheim's fix in
src/Simulation/CsharpGeneration/SimulationCode.fsto use base one line numbers uniformly in all C# generated code; inside#linedirectives and inSourceLocationattributes.Microsoft.Quantum.Simulation.Simulators.Tests