mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-11-24 07:45:41 +01:00
Fix issues with Windows dump_syms_unittest
* Turn DumpSymsRegressionTest into a parameterized test so it's easier to see which test file is failing * Convert dump_syms_regtest.sym to DOS line endings, being careful to preserve the required spaces at the end of 'STACK WIN' lines * In test #4 (omap_reorder_bbs), since the .exe corresponding to the .pdb is not present, no INFO line is generated in the .sym file. Update .sym file. * Stop collecting stderr from dump_syms. Future work: perhaps it's worth collecting stderr to compare with a different file to verify that "Couldn't locate EXE or DLL file" is output when expected? * Regenerate testdata for test #5 (dump_syms_regtest64), which currently does not pass, seemingly due a mis-match in the PDB age between the .pdb file and the .sym file. Also add the .exe corresponding to the .pdb present, to provide CFI BUG= Change-Id: I54fab866437c9e1bad3a5534cef4fe4b6ae47cd2 Reviewed-on: https://chromium-review.googlesource.com/453178 Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
796a6c9baf
commit
4bb0cd4743
@ -121,7 +121,7 @@ void RunCommand(const std::wstring& command_line,
|
|||||||
STARTUPINFO startup_info = {};
|
STARTUPINFO startup_info = {};
|
||||||
PROCESS_INFORMATION process_info = {};
|
PROCESS_INFORMATION process_info = {};
|
||||||
startup_info.cb = sizeof(STARTUPINFO);
|
startup_info.cb = sizeof(STARTUPINFO);
|
||||||
startup_info.hStdError = child_stdout_write;
|
startup_info.hStdError = NULL;
|
||||||
startup_info.hStdInput = child_stdin_read;
|
startup_info.hStdInput = child_stdin_read;
|
||||||
startup_info.hStdOutput = child_stdout_write;
|
startup_info.hStdOutput = child_stdout_write;
|
||||||
startup_info.dwFlags = STARTF_USESTDHANDLES;
|
startup_info.dwFlags = STARTF_USESTDHANDLES;
|
||||||
@ -162,7 +162,7 @@ void GetFileContents(const std::wstring& path, std::string* content) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class DumpSymsRegressionTest : public testing::Test {
|
class DumpSymsRegressionTest : public testing::TestWithParam<const wchar_t *> {
|
||||||
public:
|
public:
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
std::wstring self_dir;
|
std::wstring self_dir;
|
||||||
@ -179,9 +179,8 @@ class DumpSymsRegressionTest : public testing::Test {
|
|||||||
|
|
||||||
} //namespace
|
} //namespace
|
||||||
|
|
||||||
TEST_F(DumpSymsRegressionTest, EnsureDumpedSymbolsMatch) {
|
TEST_P(DumpSymsRegressionTest, EnsureDumpedSymbolsMatch) {
|
||||||
for (size_t i = 0; i < sizeof(kRootNames) / sizeof(kRootNames[0]); ++i) {
|
const wchar_t* root_name = GetParam();
|
||||||
const wchar_t* root_name = kRootNames[i];
|
|
||||||
std::wstring root_path = testdata_dir + L"\\" + root_name;
|
std::wstring root_path = testdata_dir + L"\\" + root_name;
|
||||||
|
|
||||||
std::wstring sym_path = root_path + L".sym";
|
std::wstring sym_path = root_path + L".sym";
|
||||||
@ -195,9 +194,12 @@ TEST_F(DumpSymsRegressionTest, EnsureDumpedSymbolsMatch) {
|
|||||||
ASSERT_NO_FATAL_FAILURE(RunCommand(command_line, &symbols));
|
ASSERT_NO_FATAL_FAILURE(RunCommand(command_line, &symbols));
|
||||||
|
|
||||||
EXPECT_EQ(expected_symbols, symbols);
|
EXPECT_EQ(expected_symbols, symbols);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_CASE_P(DumpSyms, DumpSymsRegressionTest,
|
||||||
|
testing::ValuesIn(kRootNames));
|
||||||
|
|
||||||
|
|
||||||
} // namespace dump_syms
|
} // namespace dump_syms
|
||||||
} // namespace windows
|
} // namespace windows
|
||||||
} // namespace tools
|
} // namespace tools
|
||||||
|
@ -27,9 +27,15 @@
|
|||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
// with 32-bit cl
|
||||||
// cl /Zi dump_syms_regtest.cc /link /PROFILE
|
// cl /Zi dump_syms_regtest.cc /link /PROFILE
|
||||||
// dump_syms dump_syms_regtest.pdb > dump_syms_regtest.sym
|
// dump_syms dump_syms_regtest.pdb > dump_syms_regtest.sym
|
||||||
|
|
||||||
|
// with 64-bit cl
|
||||||
|
// cp dump_syms_regtest.cc dump_syms_regtest64.cc
|
||||||
|
// cl /Zi dump_syms_regtest64.cc /link /PROFILE
|
||||||
|
// dump_syms dump_syms_regtest64.pdb > dump_syms_regtest64.sym
|
||||||
|
|
||||||
namespace google_breakpad {
|
namespace google_breakpad {
|
||||||
|
|
||||||
class C {
|
class C {
|
||||||
|
File diff suppressed because it is too large
Load Diff
BIN
src/tools/windows/dump_syms/testdata/dump_syms_regtest64.exe
vendored
Executable file
BIN
src/tools/windows/dump_syms/testdata/dump_syms_regtest64.exe
vendored
Executable file
Binary file not shown.
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
MODULE windows x86_64 72E103A85CB249078B76B2E7C06257B13 dump_syms_regtest64.pdb
|
MODULE windows x86_64 72E103A85CB249078B76B2E7C06257B13 dump_syms_regtest64.pdb
|
||||||
INFO CODE_ID 5357F5C01A000 dump_syms_regtest64.exe
|
INFO CODE_ID 589DFD111A000 dump_syms_regtest64.exe
|
||||||
FILE 1 d:\src\breakpad\src\tools\windows\dump_syms\testdata\dump_syms_regtest64.cc
|
FILE 1 c:\cygwin64\wip\breakpad-depot\src\src\tools\windows\dump_syms\testdata\dump_syms_regtest.cc
|
||||||
FILE 2 f:\dd\vctools\crt\crtw32\misc\amd64\amdsecgs.asm
|
FILE 2 f:\dd\vctools\crt\crtw32\misc\amd64\amdsecgs.asm
|
||||||
FILE 3 f:\dd\ExternalAPIs\Windows\WinBlue\sdk\inc\ksamd64.inc
|
FILE 3 f:\dd\ExternalAPIs\Windows\WinBlue\sdk\inc\ksamd64.inc
|
||||||
FILE 4 f:\dd\ExternalAPIs\Windows\WinBlue\sdk\inc\kxamd64.inc
|
FILE 4 f:\dd\ExternalAPIs\Windows\WinBlue\sdk\inc\kxamd64.inc
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
MODULE windows x86 99302CF6F3C244F2B8E048BA0268A12F1 omap_reorder_bbs.pdb
|
MODULE windows x86 99302CF6F3C244F2B8E048BA0268A12F1 omap_reorder_bbs.pdb
|
||||||
INFO CODE_ID 517C17D711000 omap_reorder_bbs.exe
|
|
||||||
FILE 1 c:\src\breakpad\src\src\tools\windows\dump_syms\testdata\dump_syms_regtest.cc
|
FILE 1 c:\src\breakpad\src\src\tools\windows\dump_syms\testdata\dump_syms_regtest.cc
|
||||||
FILE 2 f:\dd\public\sdk\inc\internal\pebteb.h
|
FILE 2 f:\dd\public\sdk\inc\internal\pebteb.h
|
||||||
FILE 3 f:\dd\public\sdk\inc\internal\ntldr.h
|
FILE 3 f:\dd\public\sdk\inc\internal\ntldr.h
|
||||||
|
Loading…
Reference in New Issue
Block a user