summaryrefslogtreecommitdiff
path: root/src/vm
diff options
context:
space:
mode:
authorAlexandre Teoi <ateoi@users.noreply.github.com>2018-02-21 20:32:46 -0300
committerDan Moseley <danmose@microsoft.com>2018-02-21 15:32:46 -0800
commitba1d5b2de899bf6e09702f70c28e85b527bd1ea9 (patch)
tree194d624f6af3e767f81eebcc3a58992183b10ee9 /src/vm
parent17541a4655715b68219ca974a07af5e6a985acb1 (diff)
downloadcoreclr-ba1d5b2de899bf6e09702f70c28e85b527bd1ea9.tar.gz
coreclr-ba1d5b2de899bf6e09702f70c28e85b527bd1ea9.tar.bz2
coreclr-ba1d5b2de899bf6e09702f70c28e85b527bd1ea9.zip
Show the expected stack trace from a rethrown exception. (#16464)
* Show the expected stack trace from a rethrown exception. Fix #15780 * Remove now unused methods - StackTraceArray::AppendSkipLast - StackTraceElement::PartiallyEqual - StackTraceElement::PartialAtomicUpdate
Diffstat (limited to 'src/vm')
-rw-r--r--src/vm/clrex.h10
-rw-r--r--src/vm/excep.cpp4
-rw-r--r--src/vm/object.cpp49
-rw-r--r--src/vm/object.h1
4 files changed, 1 insertions, 63 deletions
diff --git a/src/vm/clrex.h b/src/vm/clrex.h
index 12eb702be1..a550a71874 100644
--- a/src/vm/clrex.h
+++ b/src/vm/clrex.h
@@ -42,16 +42,6 @@ struct StackTraceElement
{
return !(*this == rhs);
}
-
- bool PartiallyEqual(StackTraceElement const & rhs) const
- {
- return pFunc == rhs.pFunc;
- }
-
- void PartialAtomicUpdate(StackTraceElement const & rhs)
- {
- ip = rhs.ip;
- }
};
class StackTraceInfo
diff --git a/src/vm/excep.cpp b/src/vm/excep.cpp
index 35a207457c..09283f7839 100644
--- a/src/vm/excep.cpp
+++ b/src/vm/excep.cpp
@@ -2428,9 +2428,7 @@ void StackTraceInfo::SaveStackTrace(BOOL bAllowAllocMem, OBJECTHANDLE hThrowable
}
}
- if (bSkipLastElement && gc.stackTrace.Size() != 0)
- gc.stackTrace.AppendSkipLast(m_pStackTrace, m_pStackTrace + m_dFrameCount);
- else
+ if (!bSkipLastElement)
gc.stackTrace.Append(m_pStackTrace, m_pStackTrace + m_dFrameCount);
//////////////////////////////
diff --git a/src/vm/object.cpp b/src/vm/object.cpp
index 8659084647..374fe192f2 100644
--- a/src/vm/object.cpp
+++ b/src/vm/object.cpp
@@ -1970,55 +1970,6 @@ void StackTraceArray::Append(StackTraceElement const * begin, StackTraceElement
#endif
}
-void StackTraceArray::AppendSkipLast(StackTraceElement const * begin, StackTraceElement const * end)
-{
- CONTRACTL
- {
- THROWS;
- GC_TRIGGERS;
- MODE_COOPERATIVE;
- PRECONDITION(IsProtectedByGCFrame((OBJECTREF*)this));
- }
- CONTRACTL_END;
-
- // to skip the last element, we need to replace it with the first element
- // from m_pStackTrace and do it atomically if possible,
- // otherwise we'll create a copy of the entire array, which is bad for performance,
- // and so should not be on the main path
- //
-
- // ensure that only one thread can write to the array
- EnsureThreadAffinity();
-
- assert(Size() > 0);
-
- StackTraceElement & last = GetData()[Size() - 1];
- if (last.PartiallyEqual(*begin))
- {
- // fast path: atomic update
- last.PartialAtomicUpdate(*begin);
-
- // append the rest
- if (end - begin > 1)
- Append(begin + 1, end);
- }
- else
- {
- // slow path: create a copy and append
- StackTraceArray copy;
- GCPROTECT_BEGIN(copy);
- copy.CopyFrom(*this);
- copy.SetSize(copy.Size() - 1);
- copy.Append(begin, end);
- this->Swap(copy);
- GCPROTECT_END();
- }
-
-#if defined(_DEBUG)
- CheckState();
-#endif
-}
-
void StackTraceArray::CheckState() const
{
CONTRACTL
diff --git a/src/vm/object.h b/src/vm/object.h
index 3ffbf792a3..e6e0c02041 100644
--- a/src/vm/object.h
+++ b/src/vm/object.h
@@ -2910,7 +2910,6 @@ public:
StackTraceElement & operator[](size_t index);
void Append(StackTraceElement const * begin, StackTraceElement const * end);
- void AppendSkipLast(StackTraceElement const * begin, StackTraceElement const * end);
I1ARRAYREF Get() const
{