aboutsummaryrefslogtreecommitdiff
path: root/src/common/tests/file_utils.cc
Commit message (Collapse)AuthorAgeFilesLines
* CopyFile: add a C++ APIMike Frysinger2020-09-071-0/+4
| | | | | | | | Having to swizzle to C strings all the time is a bit annoying. Change-Id: I0b80877706e32e873e567685f6b471745da70311 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2396557 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close.mark@chromium.org2013-12-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | It is incorrect to wrap close in HANDLE_EINTR on Linux. Unnecessary #includes of eintr_wrapper.h are also removed. The variable naming within the macro is also updated per Chromium r178174. einter_wrapper.h contains a non-mechanical change. Mechanical changes were generated by running: sed -E -i '' \ -e 's/((=|if|return|CHECK|EXPECT|ASSERT).*)HANDLE(_EINTR\(.*close)/\1IGNORE\3/' \ -e 's/(ignore_result|void ?)\(HANDLE_EINTR\((.*close\(.*)\)\)/\2/' \ -e 's/(\(void\) ?)?HANDLE_EINTR\((.*close\(.*)\)/\2/' \ $(grep -rl HANDLE_EINTR.*close . --exclude-dir=.svn) sed -E -i '' -e '/#include.*eintr_wrapper\.h"/d' \ $(grep -EL '(HANDLE|IGNORE)_EINTR' \ $(grep -Elr '#include.*eintr_wrapper\.h"' . --exclude-dir=.svn)) BUG=chromium:269623 R=ted.mielczarek@gmail.com Review URL: https://breakpad.appspot.com/784002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1239 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix Breakpad unit tests build for Android.digit@chromium.org2012-08-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains the source-related fixes to ensure that the Breakpad unit tests build properly when targetting Android. Calling 'make check' still fails because there is still no way to run the unit test programs on a device. This will be addressed by a future patch. Important notes: - You must target Android API level 9 (Gingerbread) or higher to build the unit tests. This requirement is due to the current GTest revision used in the breakpad source tree. - This patch adds headers providing inlined C library functions missing from the NDK (see src/common/android/testing). They are inlined to avoid modifying Makefile.am and other build files. - Similarly, the <wchar.h> header-fix under src/common/android/testing/include is only required by GTest's current revision. E.g. it's not needed when building Breakpad as part of Chromium which uses a more up-to-date revision. Review URL: https://breakpad.appspot.com/439002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1020 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Modify CrashGenerator::CreateChildCrash to copy proc files.benchan@chromium.org2012-02-231-0/+55
| | | | | | | | | | | | | | | | | | | | | This patch is taken from the downstream version of breakpad in Chromium OS: https://gerrit.chromium.org/gerrit/15148 LinuxCoreDumperTest previously assumes the proc files of the child process created by CrashGenerator::CreateChildCrash() have the same content as its parent process, which may not be true. This CL modifies CrashGenerator to copy the proc files of the child process, created by CreateChildCrash(), before crashing that process. BUG=chromium-os:25252 TEST=Verified the following: TEST=Tested the following: 1. Build on 32-bit and 64-bit Linux with gcc 4.4.3 and gcc 4.6. 2. Build on Mac OS X 10.6.8 with gcc 4.2 and clang 3.0 (with latest gmock). 3. All unit tests pass. Review URL: https://breakpad.appspot.com/353001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@925 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add utilities for processing Linux core dump files.benchan@chromium.org2012-01-071-0/+97
This patch is part of a bigger patch that helps merging the breakpad code with the modified version in Chromium OS. Specifically, this patch makes the following changes: 1. Add an ElfCoreDump class for processing Linux core dump files, which will later be used to implement the core dump to minidump conversion. 2. Add a CrashGenerator class for generating a crash with a core dump file for testing the functionalities of ElfCoreDump. 3. Move some utility functions for reading/writing files to file_utils.h. BUG=455 TEST=Tested the following: 1. Build on 32-bit and 64-bit Linux with gcc 4.4.3 and gcc 4.6. 2. Build on Mac OS X 10.6.8 with gcc 4.2 and clang 3.0 (with latest gmock). 3. All unit tests pass. Review URL: http://breakpad.appspot.com/337001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@900 4c0a9323-5329-0410-9bdc-e9ce6186880e