summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSwift Kim <swift.kim@samsung.com>2019-11-18 16:38:56 +0900
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>2019-11-21 07:56:58 +0900
commitedfccc15cc34faeb13fecbb5993833f92d5cd18c (patch)
treed7b135fbf88bcf167c6bbd4efe0bd688d4eae92d
parented7d6a105350afe04ffc0d02e5dd6eea4bc3e180 (diff)
downloadcoreclr-edfccc15cc34faeb13fecbb5993833f92d5cd18c.tar.gz
coreclr-edfccc15cc34faeb13fecbb5993833f92d5cd18c.tar.bz2
coreclr-edfccc15cc34faeb13fecbb5993833f92d5cd18c.zip
[Tizen] Use PTRACE_GETREGSET for any arch when creating dumpsubmit/tizen/20191120.225954accepted/tizen/unified/20191121.073401
Also ignore ptrace NT_FPREGSET failures for arm processes on aarch64 kernels. Fixes #25707.
-rw-r--r--src/debug/createdump/threadinfo.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/debug/createdump/threadinfo.cpp b/src/debug/createdump/threadinfo.cpp
index 8af76477b7..685f9e64c0 100644
--- a/src/debug/createdump/threadinfo.cpp
+++ b/src/debug/createdump/threadinfo.cpp
@@ -198,7 +198,6 @@ ThreadInfo::UnwindThread(CrashInfo& crashInfo, IXCLRDataProcess* pClrDataProcess
bool
ThreadInfo::GetRegistersWithPTrace()
{
-#if defined(__aarch64__)
struct iovec gpRegsVec = { &m_gpRegisters, sizeof(m_gpRegisters) };
if (ptrace((__ptrace_request)PTRACE_GETREGSET, m_tid, NT_PRSTATUS, &gpRegsVec) == -1)
{
@@ -210,21 +209,15 @@ ThreadInfo::GetRegistersWithPTrace()
struct iovec fpRegsVec = { &m_fpRegisters, sizeof(m_fpRegisters) };
if (ptrace((__ptrace_request)PTRACE_GETREGSET, m_tid, NT_FPREGSET, &fpRegsVec) == -1)
{
+#if defined(__arm__)
+ // Some aarch64 kernels may not support NT_FPREGSET for arm processes. We treat this failure as non-fatal.
+#else
fprintf(stderr, "ptrace(PTRACE_GETREGSET, %d, NT_FPREGSET) FAILED %d (%s)\n", m_tid, errno, strerror(errno));
return false;
+#endif
}
assert(sizeof(m_fpRegisters) == fpRegsVec.iov_len);
-#else
- if (ptrace((__ptrace_request)PTRACE_GETREGS, m_tid, nullptr, &m_gpRegisters) == -1)
- {
- fprintf(stderr, "ptrace(GETREGS, %d) FAILED %d (%s)\n", m_tid, errno, strerror(errno));
- return false;
- }
- if (ptrace((__ptrace_request)PTRACE_GETFPREGS, m_tid, nullptr, &m_fpRegisters) == -1)
- {
- fprintf(stderr, "ptrace(GETFPREGS, %d) FAILED %d (%s)\n", m_tid, errno, strerror(errno));
- return false;
- }
+
#if defined(__i386__)
if (ptrace((__ptrace_request)PTRACE_GETFPXREGS, m_tid, nullptr, &m_fpxRegisters) == -1)
{
@@ -243,7 +236,6 @@ ThreadInfo::GetRegistersWithPTrace()
return false;
}
#endif
-#endif
return true;
}
void ThreadInfo::SetRegisters(elf_prstatus *prstatus)