aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux/file_id_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* file_id_unittest: avoid system()Mike Frysinger2020-09-081-7/+16
| | | | | | | | | | | | We have API's for copying files & changing file modes, so there's no sense in using system() to run programs to do that. For the strip call, do the minimal spawn+wait dance. This avoids weird quoting string issues at least. Change-Id: Ibda117f243e886c0c7fcf8076fb8602b8d3ba42d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2396558 Reviewed-by: Mark Mentovai <mark@chromium.org>
* fix pointer style to match the style guideMike Frysinger2020-07-151-2/+2
| | | | | | | | | | We do this in a lot of places, but we're inconsistent. Normalize the code to the Google C++ style guide. Change-Id: Ic2aceab661ce8f6b993dda21b1cdf5d2198dcbbf Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2262932 Reviewed-by: Sterling Augustine <saugustine@google.com> Reviewed-by: Mark Mentovai <mark@chromium.org>
* Replace TYPED_TEST_CASE with TYPED_TEST_SUITE.Lei Zhang2019-02-281-1/+1
| | | | | | | | | | TYPED_TEST_CASE is deprecated in modern googletest. BUG=chromium:936654 Change-Id: I08004ffbb26089ebe17302934ed6d3268220d151 Reviewed-on: https://chromium-review.googlesource.com/c/1493423 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Teach the ELF parser to handle multiple PT_NOTE phdrs.Peter Collingbourne2017-05-261-0/+34
| | | | | | | | | | | | | | | It is legal for an ELF to contain multiple PT_NOTEs, and that is in fact what lld's output looks like. Testing: "make check" and breakpad_unittests when patched into chromium. Bug: chromium:716484 Change-Id: I01d3f8679961e2cb7e789d4007de8914c6af357d Reviewed-on: https://chromium-review.googlesource.com/513512 Reviewed-by: Primiano Tucci <primiano@chromium.org> Reviewed-by: Ted Mielczarek <ted@mielczarek.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
* Dump INFO CODE_ID containing Build ID in Linux dump_symsTed Mielczarek2016-06-101-0/+17
| | | | | | | | | | | | | I'd like to have the Build ID available for our symbol server uploading, and this will make it easy. Most of this change is me rewriting dump_symbols_unittest to be typed tests so I could add a new test there. R=mark@chromium.org BUG= Review URL: https://codereview.chromium.org/2052263002 .
* Switch the Linux minidump writer to use MDCVInfoELF for CV data.Ted Mielczarek2016-04-051-59/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | This preserves full build ids in minidumps, which are useful for tracking down the right version of system libraries from Linux distributions. The default build id produced by GNU binutils' ld is a 160-bit SHA-1 hash of some parts of the binary, which is exactly 20 bytes: https://sourceware.org/binutils/docs-2.26/ld/Options.html#index-g_t_002d_002dbuild_002did-292 The bulk of the changes here are to change the signatures of the FileID methods to use a wasteful_vector instead of raw pointers, since build ids can be of arbitrary length. The previous change that added support for this in the processor code preserved the return value of `Minidump::debug_identifier()` as the current `GUID+age` treatment for backwards-compatibility, and exposed the full build id from `Minidump::code_identifier()`, which was previously stubbed out for Linux dumps. This change keeps the debug ID in the `dump_syms` output the same to match. R=mark@chromium.org, thestig@chromium.org BUG= Review URL: https://codereview.chromium.org/1688743002 .
* Misc Android-related fixes.digit@chromium.org2013-12-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - src/common/android/testing/mkdtemp.h: Fixes a compilation error when using the (recent) NDK r9b, see comments in the source file for details. - android/test-driver, Makefile.am, Makefile.in: Autotools 1.12 changed the way tests are run during "make check" so add a new "custom test driver" to run tests on Android, and modify Makefile.am / Makefile.in accordingly. Otherwise, 'make check' tried to run the tests on the host. - android/test-shell.sh: Allow several tests to run in parallel on the device, by creating a custom test directory for each test process. This allows running "make check -j8" reliably. - src/common/linux/file_id_unittest.cc: Disable the SelfStrip test on Android, since it assumes a 'strip' executable is available on the target system where the test runs. BUG=NONE R=mark@chromium.org, ted.mielczarek@gmail.com TEST=android/run-checks.sh --ndk-dir=/path/to/android-ndk-r9b Review URL: https://breakpad.appspot.com/904003 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1259 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix build on Android - put the missing NT_GNU_BUILD_ID #define in ↵thestig@chromium.org2013-04-101-0/+1
| | | | | | | | elf_gnu_compat.h and use it where needed. Review URL: https://breakpad.appspot.com/554004 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1146 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Try to find a build-id through PT_NOTE program headersted.mielczarek@gmail.com2013-04-041-0/+35
| | | | | | | A=Mike Hommey <mh@glandium.org> R=ted at https://breakpad.appspot.com/544003/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1143 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Support generic Elf notes, with unit teststed.mielczarek@gmail.com2013-04-041-4/+5
| | | | | | | A=Mike Hommey <mh@glandium.org> R=ted at https://breakpad.appspot.com/546002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1142 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Refactor file_id_unittestted.mielczarek@gmail.com2013-03-291-102/+35
| | | | | | | A=Mike Hommey <mh@glandium.org> R=ted at https://breakpad.appspot.com/543003/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1138 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Cleaning up google-breakpad source code of signed-unsigned comparison warningsivan.penkov@gmail.com2012-11-211-1/+1
| | | | | | | | http://breakpad.appspot.com/488002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1083 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fixing various compiler warnings and applying minor tweaks to allow running ofivan.penkov@gmail.com2012-07-021-2/+4
| | | | | | | | | | the mojority of breakpad unittests in Google. http://breakpad.appspot.com/399002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@978 4c0a9323-5329-0410-9bdc-e9ce6186880e
* This change allows compiling the google-breakpad code using a global ↵ivan.penkov@gmail.com2012-06-281-1/+4
| | | | | | ::string class instead of std::string. For more details take a look at common/using_std_string.h git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@974 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Replace readlink calls with a safer version that guarantees NULL-termination.benchan@chromium.org2011-12-211-3/+3
| | | | | | | | | | | | | | | | | | | | | 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 a SafeReadLink function that wraps sys_readlink() to resolve a symbolic link but guarantees the result is NULL-terminated on success. 2. Refactor other source code to use SafeReadLink instead of readlink() or sys_readlink(). 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. 4. Run minidump-2-core to covnert a minidump file to a core file. Review URL: http://breakpad.appspot.com/334001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@896 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Correct compilation warning.qsr@chromium.org2011-11-231-6/+6
| | | | | | | | | 1) Modify src/common/mac/macho_walker.cc to remove a signed vs unsigned comparison. 2) Replace mktemp in test using AutoTmpDir that has been moved from client/mac/tests to common/tests. Review URL: http://breakpad.appspot.com/328001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@888 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix some shadow variables, including one in file_id.cc that causes all files ↵thestig@chromium.org2011-10-201-0/+101
| | | | | | | | to generate the same hash. Add a test to make sure this doesn't happen again. Review URL: http://breakpad.appspot.com/316002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@875 4c0a9323-5329-0410-9bdc-e9ce6186880e
* issue 243 - Linux dumper should use build id produced by ld --build-id if ↵ted.mielczarek2011-08-301-55/+95
| | | | | | | | available R=thestig at http://breakpad.appspot.com/185001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@830 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix compilation of file_id_unittest.thestig@chromium.org2010-09-161-5/+5
| | | | | | Review URL: http://breakpad.appspot.com/198001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@689 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux FileID should work with ELFCLASS32 and ELFCLASS64 regardless of what'smark@chromium.org2010-08-271-0/+67
| | | | | | | | | | native. BUG=399 TEST=none Review URL: http://breakpad.appspot.com/178001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@677 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 357: New Linux file_id code doesn't persist across strip. ↵ted.mielczarek2009-12-231-0/+76
r=agl,nealsid at http://breakpad.appspot.com/49008 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@461 4c0a9323-5329-0410-9bdc-e9ce6186880e