-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathFakeTrackedStackFrameNode.cs
More file actions
46 lines (40 loc) · 1.54 KB
/
FakeTrackedStackFrameNode.cs
File metadata and controls
46 lines (40 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// <copyright file="FakeTrackedStackFrameNode.cs" company="Datadog">
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Datadog.Trace.Debugger.Expressions;
using Datadog.Trace.Debugger.Instrumentation.Collections;
using Datadog.Trace.Debugger.Snapshots;
#nullable enable
namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation
{
internal sealed class FakeTrackedStackFrameNode(TrackedStackFrameNode? parent, MethodBase method)
: TrackedStackFrameNode(parent, method, isInvalidPath: false)
{
protected override int ComputeEnterSequenceHash()
{
return Parent!.EnterSequenceHash;
}
protected override int ComputeLeaveSequenceHash()
{
lock (this)
{
ClearNonRelevantChildNodes();
if (ActiveChildNodes?.Count > 0)
{
var firstChild = ActiveChildNodes.First();
return firstChild.LeaveSequenceHash;
}
return SimpleHash.Combine(Method.MetadataToken, SimpleHash.FnvOffsetBias);
}
}
public override string ToString()
{
return $"{nameof(FakeTrackedStackFrameNode)}(Child Count = {ActiveChildNodes?.Count})";
}
}
}