mirror of
https://github.com/yuzu-emu/breakpad
synced 2024-11-26 16:58:10 +00:00
Fix ElfCoreDumpTest.ValidCoreFile unit test.
The ElfCoreDumpTest.ValidCoreFile unit test assumed that the number of NT_FPREGSET / NT_PRXFPREG notes in the core dump file equals to the number of threads of the crashed process. This assumption isn't always true as the kernel skips filling the NT_FPREGSET / NT_PRXFPREG note of a thread if the FPU state isn't available. The kernel indicates the availability of NT_FPREGSET / NT_PRXFPREG via the pr_fpvalid field of the NT_PRSTATUS note. This CL modifies the ElfCoreDumpTest.ValidCoreFile unit test to verify the number of NT_FPREGSET and NT_PRXFPREG notes based on the pr_fpvalid field of the NT_PRSTATUS notes. BUG=577 TEST=Run unit tests on x86 and x86_64 Linux platform. R=vapier@chromium.org Review URL: https://breakpad.appspot.com/1404002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1303 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
410b7024e3
commit
66460ce1d9
1 changed files with 5 additions and 2 deletions
|
@ -176,6 +176,7 @@ TEST(ElfCoreDumpTest, ValidCoreFile) {
|
|||
|
||||
size_t num_nt_prpsinfo = 0;
|
||||
size_t num_nt_prstatus = 0;
|
||||
size_t num_pr_fpvalid = 0;
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
size_t num_nt_fpregset = 0;
|
||||
#endif
|
||||
|
@ -207,6 +208,8 @@ TEST(ElfCoreDumpTest, ValidCoreFile) {
|
|||
EXPECT_EQ(kCrashSignal, status->pr_info.si_signo);
|
||||
}
|
||||
++num_nt_prstatus;
|
||||
if (status->pr_fpvalid)
|
||||
++num_pr_fpvalid;
|
||||
break;
|
||||
}
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
@ -235,9 +238,9 @@ TEST(ElfCoreDumpTest, ValidCoreFile) {
|
|||
EXPECT_EQ(1U, num_nt_prpsinfo);
|
||||
EXPECT_EQ(kNumOfThreads, num_nt_prstatus);
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
EXPECT_EQ(kNumOfThreads, num_nt_fpregset);
|
||||
EXPECT_EQ(num_pr_fpvalid, num_nt_fpregset);
|
||||
#endif
|
||||
#if defined(__i386__)
|
||||
EXPECT_EQ(kNumOfThreads, num_nt_prxfpreg);
|
||||
EXPECT_EQ(num_pr_fpvalid, num_nt_prxfpreg);
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue