Commit graph

50 commits

Author SHA1 Message Date
Gabriele Svelto
16e08520e6 Add support for parsing the DW_AT_ranges attributes
This enables the DWARF reader to properly parse DW_AT_ranges attributes
in compilation units and functions. Code covered by a function is now
represented by a vector of ranges instead of a single contiguous range
and DW_AT_ranges entries are used to populate it. All the code and tests
that assumed functions to be contiguous entities has been updated to
reflect the change. DW_AT_ranges attributes found in compilation units
are parsed but no data is generated for them as it is not currently needed.

BUG=754

Change-Id: I310391b525aaba0dd329f1e3187486f2e0c6d442
Reviewed-on: https://chromium-review.googlesource.com/1124721
Reviewed-by: Ted Mielczarek <ted.mielczarek@gmail.com>
2018-08-13 19:12:00 +00:00
Lars Volker
49907e1c34 Fix Travis build by running tests as root
A recent configuration change made it necessary to run our tests on
Travis as root.

This change also increases the timeout of ParallelChildCrashesDontHang
to make it pass in Travis virtualized containers.

Bug: google-breakpad:753
Change-Id: I6ca8ff4513c6ea3e0646f22457f28b5c4fca6654
Reviewed-on: https://chromium-review.googlesource.com/890564
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2018-02-20 11:08:52 +00:00
Lars Volker
ffe3e47865 Only use O_CLOEXEC on platforms that support it
Change a9fca58 made use of the O_CLOEXEC flag, which is not supported on
older Linux kernels. This change makes the use contingent on kernel
support.

Testing: I manually compiled breakpad on CentOS 5.8 running kernel
2.6.18-308.8.2.el5.centos.plusxen.

Bug: 730
Change-Id: I21dff928cfba3c156a56708913f65a0c7b5396a6
Reviewed-on: https://chromium-review.googlesource.com/498528
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2017-05-10 21:32:37 +00:00
Gabriele Svelto
a9fca58305 Make minidump name generation on Linux as random as possible
This patch ensures that two crashes taken within the same second have
different minidump names. The random characters used in the minidump
filename are now read from /dev/urandom where possible or generated via
arc4random(). If neither is available we fall back to regular rand() but
mixing the address of an object to the current time when generating the
random seed to make it slightly less predictable.

BUG=681

Change-Id: I2e97454859ed386e199b2628d6b7e87e16481b75
Reviewed-on: https://chromium-review.googlesource.com/445784
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2017-04-12 18:51:24 +00:00
Tobias Sargeant
b37547bc70 add -Wunused-local-typedefs to the set of warning flags
This helps catch issues when rolling in Chromium.

Change-Id: I2e3f33df4a69b501d8c04799ee0ac03a4bed9ac9
Reviewed-on: https://chromium-review.googlesource.com/459477
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2017-03-24 16:13:31 +00:00
Mike Frysinger
6cc037526e autotools: move -W flags to configure detection
This lets us use the flags with clang, and to add more flags easily.

Change-Id: I51bb53ffd5ab6da769cdfb422a2c88442f1ff9ad
Reviewed-on: https://chromium-review.googlesource.com/441864
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
2017-02-16 22:48:56 +00:00
Mike Frysinger
333ed18eb0 aclocal: regenerate properly
Rather than manually include m4 files in configure.ac, let aclocal
do its thing and manage aclocal.m4 automatically for us.

Change-Id: I50689ec78a85651949aab104e7f4de46b14bca5a
Reviewed-on: https://chromium-review.googlesource.com/438544
Reviewed-by: Mark Mentovai <mark@chromium.org>
2017-02-08 19:52:52 +00:00
Ted Mielczarek
2ecb2baba8 Don't demangle Rust symbols by default, but allow linking to rust-demangle.
The Rust compiler uses GCC C++ name mangling, but it has another layer of
encoding so abi::cxa_demangle doesn't produce great results. This patch
changes dump_syms to dump unmangled names by default so that consumers can
demangle them after-the-fact.

It also adds a tiny bit of support for linking against a Rust library I wrote
that can demangle Rust symbols nicely:
https://github.com/luser/rust-demangle-capi

BUG=

Change-Id: I63a425035ebb7ac516f067fed2aa782849ea9604
Reviewed-on: https://chromium-review.googlesource.com/402308
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-10-25 10:43:00 +00:00
Mike Frysinger
3f736ce086 only build dump_syms_mac for x86 hosts
The dump_syms_mac tool only works for the system it is being built for
(it doesn't support running on ELFs for a diff target), and it builds
only for x86 currently.

If you look at the mac header:
	src/third_party/mac_headers/mach/machine/vm_types.h
it will #error for non x86/arm systems, and the arm header is not in
our source tree.

Tweak the build so it's only compiled when targetting x86 systems.

BUG=chromium:579384
TEST=`make check` pass
R=ted.mielczarek@gmail.com

Review URL: https://codereview.chromium.org/1645673002 .
2016-01-27 16:45:21 -05:00
Mike Frysinger
f820ead901 test: allow use of system gmock/gtest libs
Some systems provide prebuilt copies of gmock/gtest (such as Chromium
OS).  Add a configure flag so they can take advantage of that.  This
allows for a smaller checkout as they don't need to include the full
testing/ tree.

BUG=chromium:579384
TEST=`make check` passes w/--enable-system-test-libs
TEST=`make check` passes w/--disable-system-test-libs
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1638653002 .
2016-01-25 19:27:56 -05:00
Lei Zhang
728bcdff61 Check for C++11 support in the configure script.
R=mark@chromium.org

Review URL: https://codereview.chromium.org/1570013002 .
2016-01-08 00:27:48 -08:00
Mike Frysinger
f217ae431f build: detect the right ar tool
Use automake's AM_PROG_AR helper instead of the default of hardcoding
`ar` all the time.  When cross-compiling, this can often be the wrong
one to use.

BUG=google-breakpad:519
R=ted.mielczarek@gmail.com

Review URL: https://codereview.chromium.org/1435813002 .
2015-11-11 13:43:14 -05:00
Mark Mentovai
f74c85df88 Update configure to look for README.md instead of README
This is required after daed3a43836e. configure won't run as-is, reported
in https://codereview.chromium.org/1357773004/.

R=andybons@chromium.org

Review URL: https://codereview.chromium.org/1361993002 .
2015-09-23 10:46:55 -04:00
ted.mielczarek@gmail.com
591ba326b3 Remove some old unused code, add a missing include
R=lei at https://codereview.chromium.org/1211963002



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1484 4c0a9323-5329-0410-9bdc-e9ce6186880e
2015-08-13 16:38:19 +00:00
vapier@chromium.org
1b309ed007 make "make install" also install headers and pkgconfig files
See https://code.google.com/p/google-breakpad/issues/detail?id=219

R=vapier@chromium.org

Review URL: https://breakpad.appspot.com/1114002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1364 4c0a9323-5329-0410-9bdc-e9ce6186880e
2014-08-27 02:10:55 +00:00
ted.mielczarek@gmail.com
07bb2311f8 Use AM_MAINTAINER_MODE so configure supports --enable-maintainer-mode
A=mcgrathr
R=bradnelson at https://breakpad.appspot.com/864003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1251 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-10 12:28:11 +00:00
vapier@chromium.org
302124aff1 check for and enable Large File Support automatically
If you try to process a file using a 32bit build that is larger than
2GiB in size, the linux kernel will reject things:
$ strace -eopen dump_syms ./chrome ./ > chrome.sym
...
open(".//chrome.debug", O_RDONLY)       = -1 EOVERFLOW (Value too large for defined data type)

So let's use the existing autoconf macro to check for and enable support
as need be.

We have to shift the existing m32 logic up to before we start doing
feature test macros though otherwise a simple configure won't work:
$ ./configure --enable-m32
This is because it first tests LFS and such w/out the -m32 flags.

BUG=chromium:266064
TEST=`./configure --enable-m32 && make && make check` passes
R=benchan@chromium.org

Review URL: https://breakpad.appspot.com/619002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1250 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-12-10 06:28:08 +00:00
mark@chromium.org
e9165f4353 Process minidumps generated on ARM64 in iOS apps.
Patch by Colin Blundell <blundell@chromium.org>

BUG=542

Review URL: https://breakpad.appspot.com/704002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1236 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-11-23 01:45:20 +00:00
digit@chromium.org
5bce3b4d77 Fix the Android/MIPS build.
This patch fixes the build for Android on MIPS when
using the latest official Android NDK (r9):

- Update src/common/android/include/elf.h to add a missing
  definition for SHT_MIPS_DWARF.

- Add src/common/android/include/sgidefs.h required by LSS
  when compiling for MIPS.

- Update android/run-checks.sh to work properly with
  the --abi=mips option. All tests were passed succesfully
  with an emulator system image running Android 4.2.

- Update other Android-specific files.

R=Petar.Jovanovic@imgtec.com, mark@chromium.org

Review URL: https://breakpad.appspot.com/633002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1216 4c0a9323-5329-0410-9bdc-e9ce6186880e
2013-09-25 13:47:44 +00:00
SiyangXie@gmail.com
bab770045b Refactor the logic of resolving source line info into helper class.
http://breakpad.appspot.com/459002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1068 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-10-10 21:41:52 +00:00
ted.mielczarek@gmail.com
0e91d185ca Minidumps never contain MD_LINUX_DSO_DEBUG info when breakpad is in a shared library
A=Mike Hommey <mh@glandium.org>
R=ted at http://breakpad.appspot.com/422002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1044 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-09-19 12:55:16 +00:00
ted.mielczarek@gmail.com
a8e7e18656 Fix compilation of crash_generation_server.cc, and add it to the client library sources so it actually gets built.
R=mark at https://breakpad.appspot.com/446003/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1036 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-09-17 14:00:36 +00:00
digit@chromium.org
7e3c538af1 Add custom getcontext() implementation for Android.
This adds a minimalistic implementation of getcontext()
for Android/ARM and Android/x86. The provided code is
in assembly and only implements the bare minimum required
by Breakpad to get the current processor state.

Note that:

- The FPU state is not saved to the ucontext_t on ARM.
  (that's actually the main difference with a normal
   getcontext() implementation).

  This is normal. On Linux/ARM, such state must be
  obtained with PTRACE_GETVFPREGS instead. This will
  be implemented in a future patch.

- On x86, only the 'regular' FPU state is saved, to
  mimic the GLibc/i386 implementation. The state of
  SSE/SSE2/etc registers is not part of the upstream
  getcontext() implementation.
Review URL: https://breakpad.appspot.com/444002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1024 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-31 18:38:29 +00:00
digit@chromium.org
62d486be7c Improve Android support
This patch remove many Android-specific #ifdefs from the Breakpad
source code. This is achieved by providing "fixed-up" platform
headers (e.g. <signal.h> or <sys/user,h>), in the new directory
src/common/android/include/, which masks differences between
the NDK and GLibc headers.

The old "android_link.h" and "android_ucontext.h" are moved
and renamed.

This also requires putting this directory as the first
include path during Android-hosted builds, hence the
modification of Makefile.am and configure.ac
Review URL: https://breakpad.appspot.com/434002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1017 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-21 14:34:48 +00:00
ivan.penkov@gmail.com
5f6e1f0fe7 Fixing various compiler warnings and applying minor tweaks to allow running of
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
2012-07-02 22:55:57 +00:00
ted.mielczarek
69607b678f Remove NetworkSourceLine{Resolver,Server} and related code. It never wound up being useful enough to use in production, so let's drop the maintenence burden
R=jessicag at http://breakpad.appspot.com/292001/show

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@795 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-07-07 20:53:52 +00:00
ted.mielczarek
dbf409ca20 Make programs in src/tools/linux build via the automake build system
R=jimb at http://breakpad.appspot.com/265001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@775 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-02-28 14:05:22 +00:00
thestig@chromium.org
43e6db7e72 Change the bug reporting email address.
Review URL: http://breakpad.appspot.com/226001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@728 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-11-08 19:49:41 +00:00
ted.mielczarek
cfc8628092 Add support for building the Linux client code using the Android NDK
r=mwu at http://breakpad.appspot.com/212001/show

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@716 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-10-20 15:51:38 +00:00
ted.mielczarek
d192a71e24 ditch libtool, only build static libs
R=mark at http://breakpad.appspot.com/210001/show

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@709 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-10-05 19:38:51 +00:00
ted.mielczarek
e574a2adc6 add a --disable-processor configure arg to skip building processor libs and just build client libs
R=nealsid at http://breakpad.appspot.com/209001/show

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@708 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-10-05 19:38:22 +00:00
cdn@chromium.org
2b4274afc4 Added libdisasm to the repository. This library is no longer under development so there
is no reason not to keep it locally. Implemented a basic disassembler which can be used
to scan bytecode for interesting conditions. This should be pretty easy to add to for
things other than exploitability if there is a desire. This also adds several tests to
the windows exploitability ranking code to take advantage of the disassembler for x86
code.

BUG=None
TEST=DisassemblerX86Test.*

Review URL: http://breakpad.appspot.com/203001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@705 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-10-01 22:38:10 +00:00
ted.mielczarek
efa30c13f2 Write a window of memory around the instruction pointer from the crashing thread to the minidump on Linux.
R=nealsid at http://breakpad.appspot.com/194001/show

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@693 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-09-17 13:36:11 +00:00
thestig@chromium.org
c40bcc74d9 Fix ./configure --enable-m32
Review URL: http://breakpad.appspot.com/197001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@692 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-09-16 23:29:13 +00:00
ted.mielczarek
53a8b1a204 Issue 378 - Don't compile Linux client libraries on non-Linux systems
R=nealsid at http://breakpad.appspot.com/173001/show

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@679 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-08-31 15:09:01 +00:00
ted.mielczarek
b223627d81 provide a network source line resolver + server. r=mark,jimb at http://breakpad.appspot.com/36001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@569 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-04-08 23:06:23 +00:00
nealsid
de545c09d0 ARM support, with some build system changes to support x86-64, arm, and i386 in an autoconf style build in Linux. The O2 build for the unit tests is still broken but I'm checking this in to unblock people
A=nealsid
R=ajwong, hannahtang, ted.mielczarek



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@541 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-03-02 00:39:48 +00:00
jimblandy
dc4029a5c2 Regenerate using automake-1.11.1, autoconf 2.65, and libtool 2.2.6b,
to provide a fix for Breakpad issue 365:

http://code.google.com/p/google-breakpad/issues/detail?id=365


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@506 4c0a9323-5329-0410-9bdc-e9ce6186880e
2010-02-02 17:39:51 +00:00
jimblandy
92b1f834d1 Breakpad: Regenerate build files with latest versions of autotools.
This patch refreshes the build system files to those generated by:
- Libtool 2.2.6
- Automake 1.11
- Autoconf 2.64

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@470 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-23 22:23:49 +00:00
ted.mielczarek
1adb184d42 fix a badly-applied patch, and also re-run automake which I forgot to do
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@455 4c0a9323-5329-0410-9bdc-e9ce6186880e
2009-12-21 13:12:20 +00:00
mmentovai
af3c43f00e Add logging to minidump processor (#82). First part: logging infrastructure
and messages for minidump.cc and minidump_processor.cc.  r=bryner.

http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/b056994d675f623c


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@169 4c0a9323-5329-0410-9bdc-e9ce6186880e
2007-05-17 18:34:37 +00:00
mmentovai
e5dc60822e Rename Airbag to Breakpad.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@122 4c0a9323-5329-0410-9bdc-e9ce6186880e
2007-02-14 19:51:05 +00:00
mmentovai
db3342a10e Module API (#32). r=waylonis, bryner
- Introduces a standard API for dealing with modules.  MinidumpModule
   is now a concrete implementation of this API.  Code may interact with
   single modules using the CodeModule interface, and collections of
   modules using its container, the CodeModules interface.
 - CodeModule is used directly by SymbolSupplier implementations and
   SourceLineResolver.  Reliance on the specific implementation in
   MinidumpModule has been eliminated.
 - Module lists are now added to ProcessState objects.  Module references
   in each stack frame are now pointers to objects in these module lists.
 - The sample minidump_stackwalk tool prints the module list after printing
   all threads' stacks.

http://groups.google.com/group/airbag-dev/browse_frm/thread/a9c0550edde54cf8


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@74 4c0a9323-5329-0410-9bdc-e9ce6186880e
2006-12-05 22:52:28 +00:00
mmentovai
0dbedc973d Better testing for Stackwalker (#18). r=bryner
- Test StackwalkerX86 and StackwalkerPPC on the current process, if built
   by a supported compiler (gcc) on a supported (walkable) CPU (x86, ppc).
 - This test is not enabled by default because of certain optimizations
   that interfere with it (stack frame reuse, frame pointer omission).  See
   the comments at the top of stackwalker_selftest.cc.  To enable this
   test in the standard "make check" suite, configure with --enable-selftest.

http://groups.google.com/group/airbag-dev/browse_thread/thread/2ca1c8e72c809bec


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@35 4c0a9323-5329-0410-9bdc-e9ce6186880e
2006-09-25 21:16:15 +00:00
mmentovai
8c2a4def4e Handle frame pointer omission (#21), part 1: ContainedRangeMap. r=bryner.
- ContainedRangeMap is the data structure that will be used to store and
   look up debugging information for frames by instruction address.  The
   debugging information includes a way to locate the calling frame in
   the absence of a saved frame pointer.
 - Restructure RangeMap into an -inl file to match ContainedRangeMap.

http://groups.google.com/group/airbag-dev/browse_thread/thread/c5823bfc1828ed42


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@29 4c0a9323-5329-0410-9bdc-e9ce6186880e
2006-09-20 16:20:15 +00:00
bryner
d5e66382d1 Add support to the StackWalker for resolving symbols, using a
caller-implemented SymbolSupplier object to get a symbol file.

Add a CrashReportProcessor object which provides a simple API for processing
a CrashReport struct, given a SymbolSupplier and a minidump file.

r=mmentovai (#17))


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@18 4c0a9323-5329-0410-9bdc-e9ce6186880e
2006-09-08 02:35:53 +00:00
mmentovai
3261e8b6ea Initial implementation of minidump reader (#6). r=bryner
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@11 4c0a9323-5329-0410-9bdc-e9ce6186880e
2006-09-06 02:56:44 +00:00
bryner
07f8ef56ac Change header paths and include guards to be relative to the "src" directory. r=mmentovai.
http://groups.google.com/group/airbag-dev/msg/cbe061dd563e9d17



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@10 4c0a9323-5329-0410-9bdc-e9ce6186880e
2006-09-05 19:42:57 +00:00
mmentovai
425d256321 Make build system less annoying (#8) r=bryner
- Place objects in the appropriate directories, instead of filling up
   the root directory.
 - Remove namespace macros, which made maintenance troublesome and which
   created a dependency on config.h in public headers
 - Skip useless Fortran checks at configure time


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@8 4c0a9323-5329-0410-9bdc-e9ce6186880e
2006-08-30 20:05:05 +00:00
bryner
cb91a2f879 Initial import, which includes the Windows client-side dump_syms tool, and
part of the server-side dump processor.



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@4 4c0a9323-5329-0410-9bdc-e9ce6186880e
2006-08-25 21:14:45 +00:00