aboutsummaryrefslogtreecommitdiff
path: root/src/tools/linux/md2core/minidump-2-core.cc
Commit message (Collapse)AuthorAgeFilesLines
* fix pointer style to match the style guideMike Frysinger2020-07-151-6/+6
| | | | | | | | | | 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>
* Use ULONG_MAX instead of __WORDSIZE to determine native ELF architectureMichael Forney2020-03-171-1/+2
| | | | | | | | | | | | | | __WORDSIZE is an internal libc definition. Instead, we can use ULONG_MAX from limits.h, whose value corresponds to the machine's native word size. This allows us to remove the fallback definition of __WORDSIZE in the Android compatibility headers. Bug: google-breakpad:631 Change-Id: I7b9e6f3b2121f78ccad9e32bf26acac518aefd8f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2107100 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Define and use a a new MDRawContextARM64Joshua Peraza2018-08-011-11/+22
| | | | | | | | | | | This struct matches the layout defined by Microsoft and replaces Breakpad's MDRawContextARM64_Old. This CL updates the processor to understand either the old or new structs, but clients continue to write the old structs. Change-Id: I8dedd9ddb2ec083b802723b9ac87beb18d98edbd Reviewed-on: https://chromium-review.googlesource.com/1155938 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Rename MDRawContextARM64 and its context flagsJoshua Peraza2018-08-011-2/+2
| | | | | | | | | | This makes way for the addition of a struct matching Microsoft's layout for ARM64. Change-Id: I115f25290863e7438852691d1ec3c9324a42f7a5 Reviewed-on: https://chromium-review.googlesource.com/1152158 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Provide helper wrappers for basename(3) and dirname(3)Tobias Sargeant2017-10-181-4/+4
| | | | | | | | | | This hides the need to provide mutable C strings, and unifies existing basename calls and variations in a single location. Change-Id: Idfb449c47b1421f1a751efc3d7404f15f8b369ca Reviewed-on: https://chromium-review.googlesource.com/725731 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* minidump-2-core: add more control over filenamesMike Frysinger2016-11-011-24/+93
| | | | | | | | | | | | | | | | | The code has been rewriting the location of the shared lib lookup completely which breaks normal sysroot usage with gdb. Split out the behavior into dedicated flags so people can opt into it. You can see examples of -i/-f in the usage() text. We also change the -S behavior so that it's no longer enabled by default -- if people want /var/lib/breakpad/, they can pass the -S flag explicitly. BUG=chromium:598947 Change-Id: Ic81726c27b4ad6c271c70696f2ac62798f07ccfb Reviewed-on: https://chromium-review.googlesource.com/402909 Reviewed-by: Mark Mentovai <mark@chromium.org>
* minidump-2-core: add an -o flag for controlling core outputMike Frysinger2016-10-261-24/+46
| | | | | | | | | | | Always writing to stdout makes it hard to debug, and hard to use in some script environments. Add an explicit -o flag to make it easier. BUG=chromium:598947 Change-Id: I79667d033c8bdc8412d3a44fe3557d65f704968f Reviewed-on: https://chromium-review.googlesource.com/403988 Reviewed-by: Mark Mentovai <mark@chromium.org>
* minidump-2-core: rewrite argument processingMike Frysinger2016-10-261-85/+134
| | | | | | | | | | | | | | | | This uses the same general framework as other minidump tools by using getopt to parse command line options, and then passing the parsed state around as a struct rather than via globals. This does change the --sobasedir flag to -S because we don't support getopt_long anywhere in the tree. Unfortunate, but better to match all the other breakpad tools which only accept short options. BUG=chromium:598947 Change-Id: I473081a29a8e3ef07a370848343f1a9e6681fd4e Reviewed-on: https://chromium-review.googlesource.com/402908 Reviewed-by: Mark Mentovai <mark@chromium.org>
* This change allows compiling the google-breakpad code using a global ↵Ivan Penkov2016-08-301-17/+18
| | | | | | | | | | | | ::string class instead of std::string. For more details take a look at common/using_std_string.h BUG= Change-Id: I11f1ce697be23e13f12ea8f0468bbe02fa63c967 Reviewed-on: https://chromium-review.googlesource.com/378159 Reviewed-by: Mark Mentovai <mark@chromium.org>
* [mips64] Support for mips n64Mike Frysinger2016-02-061-1/+13
| | | | | | | | | | Adding remaining mips n64 support including stackwalker. BUG=None TEST=manually tested on Linux/Android R=vapier@chromium.org Review URL: https://codereview.chromium.org/1418453011 .
* Make minidump-2-core.cc build with -Wformat.Lei Zhang2016-01-061-1/+1
| | | | | | | | | | A=thakis@chromium.org BUG=chromium:574817 Original Review: https://codereview.chromium.org/1562983002/ R=thakis@chromium.org Review URL: https://codereview.chromium.org/1563043002 .
* add aarch64 support to minidump-2-corevapier@chromium.org2015-07-201-7/+34
| | | | | | | | | | | | | | | | | The thread info expects the struct names as they expect in asm/ptrace.h, but the header doesn't include that, it includes sys/user.h. Rename the reg structs to match that header. Rename the elf_siginfo to _elf_siginfo to avoid conflicting with the one in the sys/procfs.h. It is only used locally in one place, so we don't need to update any callers. Otherwise, drop in aarch64 support into the minidump-2-core file. BUG=chromium:334368 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1474 4c0a9323-5329-0410-9bdc-e9ce6186880e
* [MIPS]: Use mcontext_t structure for MIPSrmcilroy@chromium.org2015-04-211-14/+32
| | | | | | | | | | | | | | This change removes user_regs_struct and user_fpregs_struct structures for mips and uses mcontext_t instead. R=fdegans@chromium.org, mark@chromium.org, rmcilroy@chromium.org Review URL: https://breakpad.appspot.com/3744002 Patch from Gordana Cmiljanovic <Gordana.Cmiljanovic@imgtec.com>. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1452 4c0a9323-5329-0410-9bdc-e9ce6186880e
* MIPS64: Initial MIPS64 related change.mark@chromium.org2015-04-151-0/+2
| | | | | | | | | | | With this change Breakpad can be compiled for MIPS64, but it is not yet functional. Patch by Gordana Cmiljanovic <Gordana.Cmiljanovic@imgtec.com> Review URL: https://breakpad.appspot.com/6824002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1446 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Remove pointers from serialized file formatmdempsky@chromium.org2014-12-111-8/+15
| | | | | | | | | BUG=breakpad:621 R=thestig@chromium.org Review URL: https://breakpad.appspot.com/1764002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1410 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Chrome on Android now supports loading the shared library directly from the ↵rmcilroy@chromium.org2014-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | APK file. This patch makes two changes to breakpad to enable crash reporting to work correctly when the library is inside another file (an archive): - Do not filter mappings which map an executable at a non-zero offset. - If such an executable is mapped look in the ELF information for the shared object name and use that name in the minidump. Note this change doesn't care about the archive format and isn't Android specific (though loading the shared library this way is currently only done on Android). BUG=390618 R=thestig@chromium.org Review URL: https://breakpad.appspot.com/7684002 Patch from Anton Carver <anton@chromium.org>. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1355 4c0a9323-5329-0410-9bdc-e9ce6186880e
* minidump-2-core: Allow user to override shared lib basedir.thestig@chromium.org2014-04-181-5/+19
| | | | | | | | | | | | | | | | | | | | | | | This CL introduces "--sobasedir" command-line option to minidump-2-core. By default, paths to shared lib files included in generated core file are formatted as "/var/lib/breakpad/[GUID]libFoobar.so". By using "--sobasedir", this will be "[user-supplied-path]libFoobar.so". This option can be used to ease debugging minidump files from developer's local builds. By specifying "minidump-2-core --sobasedir `pwd`/out/Debug/lib/ foobar.mdmp", user can load the generated core file in gdb without setting up the symlinks for "/var/lib/breakpad". BUG=None A=kouhei@chromium.org Original code review: https://breakpad.appspot.com/1214002/ R=kouhei@chromium.org Review URL: https://breakpad.appspot.com/1584002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1317 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Adding support for mips.gordana.cmiljanovic@imgtec.com2013-09-111-1/+31
| | | | | | | | | | | | | Support for mips cpu is added to all breakapad targets including unittests. BUG=none TEST=unittests Review URL: https://breakpad.appspot.com/614002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1212 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix erronoius address of crashinfo.auxv in minidump-2-core.thestig@chromium.org2013-07-191-1/+1
| | | | | | | | | | | | BUG=537 A=ajwong@chromium.org Original review: https://breakpad.appspot.com/615002/ R=ajwong@chromium.org Review URL: https://breakpad.appspot.com/616002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1203 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add MD_OS_NACL platform_id value for identifying NaCl minidumpsmseaborn@chromium.org2013-05-061-2/+3
| | | | | | | | | | | | | | Change minidump-2-core to accept minidumps with this platform_id value rather than rejecting them as non-Linux dumps. Add a missing "break" for a MD_OS_PS3 case. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3424 TEST= tested with work-in-progress NaCl minidump generator Review URL: https://breakpad.appspot.com/590002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1172 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Use stdint types everywhereted.mielczarek@gmail.com2013-03-061-2/+2
| | | | | | R=mark at https://breakpad.appspot.com/535002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1121 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Move scoped_ptr.h to commonted.mielczarek@gmail.com2013-01-171-1/+1
| | | | | | R=mark at https://breakpad.appspot.com/509002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1096 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
* Fix the tools and processor build for Androiddigit@chromium.org2012-08-211-3/+48
| | | | | | | | | | | | | | | | | | This small patch allows the build of the tools and processor when targetting Android with the Automake/Autconf build. Not that these necessarily work correctly at the moment, but there is no need for --disable-tools --disable-processor now when using --host=arm-linux-androideabi or --host=i686-linux-android. + Modify android/run-checks.sh to build all binaries with the Automake build. + Tiny fix for --abi=x86 in android/run-checks.sh Review URL: https://breakpad.appspot.com/438002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1018 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Move minidump_extension_linux.h contents into minidump_format.hted.mielczarek2012-07-201-1/+0
| | | | | | R=mark at https://breakpad.appspot.com/415002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@991 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fixing various compiler warnings and applying minor tweaks to allow running ofivan.penkov@gmail.com2012-07-021-4/+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
* Remove redundant include of CPP specific header filested.mielczarek@gmail.com2012-04-031-1/+0
| | | | | | | Patch by Chris Dearman <chris@mips.com> R=ted at http://breakpad.appspot.com/372001/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@944 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Replace MMappedRange with MinidumpMemoryRange.benchan@chromium.org2011-12-211-114/+52
| | | | | | | | | | | | | | | | | | | | | | | This patch is part of a bigger patch that helps merging the breakpad code with the modified version in Chromium OS. The MemoryRange class was added in r895 (http://breakpad.appspot.com/332001), which is largely based on MMappedRange but generalized to be used in other code. However, MemoryRange does not support minidump data structures. This patch adds a MinidumpMemoryRange class that extends MemoryRange to handle minidump data structures, which can then replace MMappedRange. As with MemoryRange, MinidumpMemoryRange is unit tested. 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/335001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@898 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Refactor code in preparation of merging with the fork in Chromium OS.benchan@chromium.org2011-12-161-17/+7
| | | | | | | | | | | | | | | | | | | | | | 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 MemoryRange class for encapsulating and checking read access to a contiguous range of memory. 2. Add a MemoryMappedFile class for mapping a file into memory for read-only access. 3. Refactor other source code to use MemoryMappedFile. 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/332001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@895 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix some shadow variables, including one in file_id.cc that causes all files ↵thestig@chromium.org2011-10-201-4/+4
| | | | | | | | 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
* Fix breakpad compilation on ubuntu 10.10.mmentovai2011-02-181-0/+1
| | | | | | | | | Patch by Marc-Antoine Ruel <maruel@chromium.org> Review URL: http://breakpad.appspot.com/264001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@774 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Import linux_syscall_support.h from linux-syscall-support.googlecode.com ↵thestig@chromium.org2010-09-151-2/+2
| | | | | | | | instead of using our own copy. Review URL: http://breakpad.appspot.com/192001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@686 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Miscellaneous improvements to minidump-2-core.thestig@chromium.org2010-08-141-72/+661
| | | | | | | | Patch by Markus Gutschke <markus@chromium.org>. R=agl See http://breakpad.appspot.com/148002 and http://codereview.chromium.org/3152010. Review URL: http://breakpad.appspot.com/152001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@648 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Upstreaming several patches from Chrome:nealsid2009-12-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Build fix for systems where sys/user.h needs sys/types.h.... http://breakpad.appspot.com/40002 MDRawSystemInfo.processor_level refers to the CPU family, not the cpuid level.. http://breakpad.appspot.com/40003 Use MD_MODULE_SIZE in place of sizeof(MDRawModule). http://breakpad.appspot.com/39003 Linux x64 compile fix. http://breakpad.appspot.com/40004 Include linux_syscall_support.h to get definition of NT_PRXFPREG. This is Chromium commit 23659. http://breakpad.appspot.com/40005 Build breakpad / crash reporting on Linux 64-bit. This is Chromium commit 23396. http://breakpad.appspot.com/40006 Fix #includes in a couple unit tests. http://breakpad.appspot.com/41001 Clean up unused headers / files for Linux dump_syms. http://breakpad.appspot.com/40002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@432 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Merge of Breakpad Chrome Linux forknealsid2009-08-171-0/+602
A=agl, Lei Zhang R=nealsid, agl git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@384 4c0a9323-5329-0410-9bdc-e9ce6186880e