aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux/dump_writer_common
Commit message (Collapse)AuthorAgeFilesLines
* fix pointer style to match the style guideMike Frysinger2020-07-152-8/+8
| | | | | | | | | | 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 public fpregset_t type to define fpstate_tMichael Forney2020-03-102-3/+4
| | | | | | | | | | | | | | | The _libc_fpstate struct tag is an implementation detail of glibc, and musl uses a different struct tag, _fpstate. Unfortunately, the public type fpregset_t is a pointer type, so is not suitable for allocating storage, or referring to constant storage. Instead, we can use std::remove_pointer<fpregset_t>::type to refer to the pointed-to type, regardless of the struct tag. Bug: google-breakpad:631 Change-Id: Iaf47f15b2d834dd8de839431f65a481e9b0c7f9e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2096171 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Rename MDRawContextARM64 and its context flagsJoshua Peraza2018-08-013-3/+3
| | | | | | | | | | 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>
* Rename src/common/memory.h to memory_allocator.h.Ted Mielczarek2017-10-172-2/+2
| | | | | | | | | | | | memory.h shadows a system header which normally isn't a problem because of the include paths in Breakpad, but the Firefox build system winds up with src/common in the include path so we've had a workaround for this for years. Renaming the file lets us get rid of that workaround and shouldn't hurt anything. Change-Id: I3b7c4239dc77f3b2b7cf2b572a0cad88cd7e8522 Reviewed-on: https://chromium-review.googlesource.com/723261 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Replace remaining references to 'struct ucontext' with 'ucontext_t'Mark Mentovai2017-09-202-23/+23
| | | | | | | | | | | | | | | | | This relands https://chromium.googlesource.com/breakpad/breakpad/src/+/e3035bc406cee8a4d765e59ad46eb828705f17f4, which was accidentally committed to breakpad/breakpad/src, the read-only mirror of src in breakpad/breakpad. (Well, it should have been read-only.) See https://crbug.com/766164. This fixes issues with glibc-2.26. See https://bugs.gentoo.org/show_bug.cgi?id=628782 , https://sourceware.org/git/?p=glibc.git;h=251287734e89a52da3db682a8241eb6bccc050c9 , and https://sourceware.org/ml/libc-alpha/2017-08/msg00010.html for context. Change-Id: Id66f474d636dd2afa450bab925c5514a800fdd6f Reviewed-on: https://chromium-review.googlesource.com/674304 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add API to skip dump if crashing thread doesn't reference a given moduleTobias Sargeant2017-01-181-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | This CL makes it possible to skip a dump if the crashing thread doesn't have any pointers to a given module. The concrete use case is WebView where we would like to skip generating microdump output when webview is unreferenced by the stack and thus cannot be responsible for the crash in a way that would be debuggable. The range of interesting addresses is chosen by examining the process mappings to find the one that contains a pointer that is known to be in the right shared object (i.e. an appropriately chosen function pointer) passed from the client. If the extracted stack does not contain a pointer in this range, then we do not generate a microdump. If the stack extraction fails, we still generate a microdump (without a stack). BUG=664460 Change-Id: If19406a13168264f7751245fc39591bd6cdbf5df Reviewed-on: https://chromium-review.googlesource.com/419476 Reviewed-by: Robert Sesek <rsesek@chromium.org> Reviewed-by: Primiano Tucci <primiano@chromium.org>
* [mips64] Support for mips n64Mike Frysinger2016-02-062-0/+12
| | | | | | | | | | 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 .
* Remove obsolete seccomp_unwinder for legacy (pre-BPF) sandboxprimiano@chromium.org2015-08-182-204/+0
| | | | | | | | | | | | | | | | | | | | | The PopSeccompStackFrame was introduced to deal with stack frames originated in the legacy seccomp sandbox. The only user of that sandbox was Google Chrome, but the legacy sandbox has been deprecated in 2013 (crrev.com/1290643003) in favor of the new bpf sandbox. Removing this dead code as it has some small bound checking bug which causes occasional crashes in WebView (which are totally unrelated to the sandbox). Note: this will require a corresponding change in the chromium GYP/GN build files to roll. BUG=665,chromium:477444 R=jln@chromium.org, mark@chromium.org, torne@chromium.org Review URL: https://codereview.chromium.org/1299593003 . git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1492 4c0a9323-5329-0410-9bdc-e9ce6186880e
* add aarch64 support to minidump-2-corevapier@chromium.org2015-07-201-3/+3
| | | | | | | | | | | | | | | | | 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-212-21/+57
| | | | | | | | | | | | | | 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-152-0/+4
| | | | | | | | | | | 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
* Fix compilation with gcc --std=c++11ted.mielczarek@gmail.com2015-03-242-7/+7
| | | | | | | | | Patch by Jon Turney <jon.turney.1111@gmail.com> R=ted at https://breakpad.appspot.com/7824002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1435 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix compatibility with Android NDK r10d.primiano@chromium.org2015-03-161-15/+0
| | | | | | | | | | | | | | | | This is a reland of the previous CL (r1433). r1433 did not achieve what intended and failed the x86_64 build of Chrome with NDK r10c. The workaround logic in this CL is identical to r1433, but the #define magic is applied in a more appropriate proper place this time. Turns out Breakpad already has an Android compatibility layer, which is common/android/include. Piggybacking the fix there. BUG=breakpad:642 R=fdegans@chromium.org, rmcilroy@chromium.org Review URL: https://breakpad.appspot.com/3794002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1434 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Make breakpad compatible with Android NDK r10d.primiano@chromium.org2015-03-102-5/+16
| | | | | | | | | | | | | | | | | | | | | r1397 did introduce a workaround to deal with a typo in sys/user.h in the Android NDK. The typo has been fixed in [1]. However, breakpad cannot just switch to the fixed version as this would require atomic rolls of Breakpad and NDK in chromium, which would make reverts hard to handle. This change introduces an inelegant yet functional hack which makes breakpad compatible with both versions of the NDK, with and without the typo. It can be reverted once Chrome has stably rolled to NDK r10d. [1] https://android.googlesource.com/platform/bionic/+/f485547b BUG=breakpad:642 R=fdegans@chromium.org, rmcilroy@chromium.org Review URL: https://breakpad.appspot.com/7814002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1433 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix overflow error in breakpad for linuxmark@chromium.org2015-02-051-4/+4
| | | | | | | | | | | | | | | A computation in the stack unwind algorithm could cause an overflow if a base pointer read from crashed process is sufficiently close to top of address space. This causes a memory read that causes the dump thread to crash, resulting in a failure to generate crash dump. Check fixed to properly detect that this pointer is greater than actual memory range of current stack. Patch by Kyle Joswiak <kjoswiak@chromium.org> Review URL: https://breakpad.appspot.com/3754003/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1425 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Introduce microdump writer class.primiano@chromium.org2014-10-281-0/+12
| | | | | | | | | | | | | | | | | | | Microdumps are a very lightweight variant of minidumps. They are meant to dump a minimal crash report on the system log (logcat on Android), containing only the state of the crashing thread. This is to deal with cases where the user has opted out from crash uploading but we still want to generate meaningful information on the device to pull a stacktrace for development purposes. Conversely to conventional stack traces (e.g. the one generated by Android's debuggerd or Chromium's base::stacktrace) microdumps do NOT require unwind tables to be present in the target binary. This allows to save precious binary size (~1.5 MB for Chrome on Arm, ~10 MB on arm64). More information and design doc on crbug.com/410294 BUG=chromium:410294 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1398 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix breakpad on mips and x86_64 for the NDK r10c update.primiano@chromium.org2014-10-242-4/+5
| | | | | | | | | | | | | | This change introduces the necessary glue typedefs to deal with the mismatch introduced by the latest Android NDK (w.r.t. desktop Linux): - [x86_64] Rename fpregs mxcr_mask -> .mxcsr_mask - [mips] uc_mcontext.fpregs.fp_r.fp_dregs -> uc_mcontext.fpreg - [mips] restore the forked user.h Submitting this on behalf of fdegans@chromium.org TBR=mark@chromium.org git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1397 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Microdumps: refactor out common parts of minidump_writer.ccprimiano@chromium.org2014-10-018-0/+976
This change is a pure refactoring of the common bits of minidump_writer.cc that will be shared soon with the upcoming microdump_writer.cc. In particular, this CL is extracting the following classes: - ThreadInfo: handles the state of the threads in the crashing process. - RawContextCPU: typedef for arch-specific CPU context structure. - UContextReader: Fills out a dump RawContextCPU structure from the ucontext struct provided by the kernel (arch-dependent). - SeccompUnwinder: cleans out the stack frames of the Seccomp sandbox on the supported architectures. - MappingInfo: handles information about mappings BUG=chromium:410294 R=mmandlis@chromium.org Review URL: https://breakpad.appspot.com/4684002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1388 4c0a9323-5329-0410-9bdc-e9ce6186880e