Commit graph

984 commits

Author SHA1 Message Date
ted.mielczarek@gmail.com
3e3324b06b Fix processor to build with clang
R=mark at http://breakpad.appspot.com/451002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1035 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-09-10 19:46:19 +00:00
thestig@chromium.org
44c27420e2 Fix compiler warnings on Ubuntu Precise. Pull in gmock r408 in the process.
BUG=490
Review URL: https://breakpad.appspot.com/448002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1034 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-09-10 18:26:31 +00:00
ted.mielczarek@gmail.com
ba7e0d9657 Use sys_fstat64 on Android
R=digit at https://breakpad.appspot.com/414002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1033 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-09-10 13:14:48 +00:00
ivan.penkov@gmail.com
d6a10e6fbb Fix of a race condition during Crash Generation Server startup
https://breakpad.appspot.com/445002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1031 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-09-07 18:01:26 +00:00
digit@chromium.org
b6514a8133 Fix the Linux build on Ubuntu 12.04 LTS
This fixes the build, which fails because the initialization values
for an array of struct sigaction cannot be { 0 }.

+ Get rid of warning related to unused return value for ftruncate()

BUG=492
Review URL: https://breakpad.appspot.com/447002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1027 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-09-06 14:24:05 +00:00
digit@chromium.org
f792eecd1e Fix README.ANDROID + formatting
This patch updates README.ANDROID, since the client library
now supports directly generating a minidump without raising
a signal, and that it builds and runs fine on Android/x86.

+ Formatting fixes in minidump_writer_unittest.cc
Review URL: https://breakpad.appspot.com/446002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1026 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-09-05 08:08:53 +00:00
mark@chromium.org
343ce73b73 Properly redeliver (or don't) signals to the previous handlers.
If none of the installed ExceptionHandlers handle a signal (their
FilterCallbacks or HandlerCallbacks all return false), then the signal
should be delivered to the signal handlers that were previously
installed.

This requires that old_handlers_ become a static vector so that we can
restore the handlers in the static HandleSignal.

Currently it is also restoring signals in ~ExceptionHandler (if there
are no others). This should not be required since our documentation
states that a process can only have one ExceptionHandler for which
install_handlers is true (and so we get the correct behavior if we
simply leave our handlers installed forever), but even the tests
themselves violate that.

Patch by Chris Hopman <cjhopman@chromium.org>

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1025 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-09-04 22:38:41 +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
02f664dbf4 Fix minidump_writer_unittest on Android
Android doesn't have /bin/cp, so instead do the copy
manually with CopyFile()
Review URL: https://breakpad.appspot.com/442002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1022 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-30 12:04:52 +00:00
digit@chromium.org
0efce7d2a8 Fix Linux/ARM GetInstructionPointer() in minidump_writer.cc
On ARM, the 'ip' register (a.k.a. r12) is not the same than 'pc'
(a.k.a. r15) which holds the real instruction pointer.
Review URL: https://breakpad.appspot.com/443002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1021 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-30 12:01:43 +00:00
digit@chromium.org
13d9e27ef0 Fix Breakpad unit tests build for Android.
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
2012-08-23 15:45:01 +00:00
digit@chromium.org
690e294ece Fix the tools and processor build for Android
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
2012-08-21 17:55:47 +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
digit@chromium.org
d270dcfa18 Fix Android build.
This patch fixes the Android build, and updates the NDK test
application to use the new Linux ExceptionHandler API.

+ Use string insted of std::string in minidump_descriptor.h
Review URL: https://breakpad.appspot.com/433002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1016 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-20 20:22:05 +00:00
qsr@chromium.org
5f57e963d0 Getting context information from the kernel when catching a SIGABRT on iOS.
Until now, the context information was the current one when receiving a
SIGABRT. This is mainly wrong because the signal handler start in a new
context. This instead use the context passed to the signal handler.
Review URL: https://breakpad.appspot.com/435002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1015 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-20 13:42:09 +00:00
ivan.penkov@gmail.com
e050c46a53 Fixing a Windows compiler warning in src/client/windows/crash_generation/minidump_generator.cc
http://breakpad.appspot.com/432002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1014 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-17 01:41:05 +00:00
ivan.penkov@gmail.com
d7de392b05 Fixing a race condition in the Crash Generation Server which has to
do with simultaneous handling of dump requests and client process
termination events.

http://breakpad.appspot.com/430002/ 



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1013 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-15 22:09:42 +00:00
jessicag.feedback
f8c1de5643 Fix narrowing conversion from -1 to size_t
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1010 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-14 01:03:14 +00:00
mark@chromium.org
066d09538f Make ExceptionHandler::HandleSignal() public.
Patch by Alexander Potapenko <glider@chromium.org>

Review URL: https://codereview.appspot.com/6461052/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1008 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-10 15:41:19 +00:00
jcivelli@chromium.org
43c933d7f8 Adding a way to create an ExceptionHandler that takes in a file descriptor
where the minidump should be created, without the need of opening any other
file.

BUG=None
TEST=Run unit-tests.



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1007 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-09 22:59:58 +00:00
jessicag.feedback
1c3f79dfeb Clean up warnings about narrowing conversion
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1006 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-07 21:00:36 +00:00
ivan.penkov@gmail.com
5ad99ac174 Prepending file names with "src/" in #include directives is undesirable.
Committed: http://breakpad.appspot.com/427003/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1005 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-06 23:30:37 +00:00
ivan.penkov@gmail.com
fd7870028f Conditionally compiling a unittest - based on whether AddressSanitizer is used.
http://breakpad.appspot.com/428002



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1004 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-06 21:44:25 +00:00
digit@chromium.org
e0555f5bdf SORRY. It seems I've screwed up my commit for http://breakpad.appspot.com/411002/, since revision 1001 only contains the new src/client/linux/linux_libc_support.cc and none of the other required files.
I'm not sure what happened, but I'm re-uploading the patch has another issue.

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

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1002 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-03 15:01:52 +00:00
digit@chromium.org
7475fb4bb4 Remove some linux libc calls from client library.
This patch removes a few libc calls from the client library
when generating a minidump.

+ Move the static inlined functions from linux_libc_support.h
  into their own source file to avoid code duplication.

Tested on linux-x86_64 with 'make check' and 'android/run-checks.sh'
Review URL: https://breakpad.appspot.com/411002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1001 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-01 17:37:44 +00:00
digit@chromium.org
8f59faffd1 Android ucontext_t handling refinement.
This is a forward-compatible patch to prepare for future versions
of the Android C library headers that define ucontext_t.

When this patch is applied, Google Breakpad will build and work
properly against any version of the NDK or platform headers.

See http://code.google.com/p/android/issues/detail?id=34784 for
more context.
Review URL: https://breakpad.appspot.com/416002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1000 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-08-01 17:36:59 +00:00
mark@chromium.org
c578271545 Speculatively back out r984. See http://codereview.chromium.org/10805065/
and
http://build.chromium.org/p/chromium/builders/NACL%20Tests%20%28x64%29/builds/34563

chrome src/native_client/tests/inbrowser_crash_test/crash_dump_tester.py says
that the observed failures are a symptom of crash_service.exe itself crashing.


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@999 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-25 15:34:00 +00:00
mark@chromium.org
3279794487 Speculatively back out r989 per http://codereview.chromium.org/10805065/ :
Ted Mielczarek:
> You could try backing out r989, although Mozilla has been running with that
> patch for months without issue.

Me:
> src/client/windows/handler/exception_handler.cc in r989 appears to have
> formatting problems, an unwanted property change, and no real Breakpad review
> history, so maybe we should back it out anyway until the proper process is
> followed.

NACL Tests nacl_integration failures:
http://build.chromium.org/p/chromium/builders/NACL%20Tests/builds/30138
chrome src/native_client/tests/inbrowser_crash_test/crash_dump_tester.py says
that the observed failures are a symptom of crash_service.exe itself crashing.


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@998 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-24 22:45:30 +00:00
mark@chromium.org
28970fab19 Back out r996, reinstating r985. That wasn't it.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@997 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-24 20:33:12 +00:00
mark@chromium.org
febb444dcd Speculatively back out r985 because it may be causing crash_service problems
for Chrome. See http://codereview.chromium.org/10805065/ . I'll recommit this
if it wasn't the problem.


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@996 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-24 19:36:34 +00:00
thestig@chromium.org
6b563c50dd Linux: Fix a bunch of clang errors from not handling return values.
Review URL: https://breakpad.appspot.com/421002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@995 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-24 00:15:53 +00:00
mark@chromium.org
63c7f7d7d7 Fix a Windows compiler warning with a cast:
minidump_generator.cc(423) : warning C4267: '=' : conversion from 'size_t' to
'ULONG', possible loss of data

Patch by Robert Sesek <rsesek@chromium.org>
Review URL: https://breakpad.appspot.com/420002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@994 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-23 21:35:52 +00:00
mark@chromium.org
5d8db68b51 Ignore -Wdeprecated-declarations for bootstrap_create_service in
OnDemandServer.mm.

BUG=crbug.com/137676
TEST=compiles

Patch by Robert Sesek <rsesek@chromium.org>
Review URL: https://breakpad.appspot.com/419002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@993 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-23 19:09:25 +00:00
ted.mielczarek
cd77197264 Fix sizeof bug in HTTPUpload::SendRequest
A=Himanshu <only4coding@gmail.com> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=710993

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@992 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-20 17:54:32 +00:00
ted.mielczarek
da1568ac03 Move minidump_extension_linux.h contents into minidump_format.h
R=mark at https://breakpad.appspot.com/415002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@991 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-20 12:38:31 +00:00
ted.mielczarek
b6b4451142 Add a filter callback to CrashGenerationServer on mac
A=Rafael Ávila de Espíndola <respindola@mozilla.com> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=732173

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@990 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-20 12:24:25 +00:00
ted.mielczarek
2f56276fbf Allow adding extra memory regions to minidump on linux/windows
A=Bill McCloskey <wmccloskey@mozilla.com> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=662646

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@989 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-19 22:03:39 +00:00
ted.mielczarek
72542b052d Add some more DWARF ARM register numbers to the DWARF CFI register maps
R=jimb at https://breakpad.appspot.com/418002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@988 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-18 18:13:29 +00:00
ted.mielczarek
4116671cbf Rework dump_symbols.cc using templates and traits classes to handle cross-word-size symbol dumping
R=mark at https://breakpad.appspot.com/393002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@987 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-18 17:55:08 +00:00
ted.mielczarek
972be40f1f Move some ELF-handling bits from file_id.cc to elfutils.{h,cc}
R=mark at https://breakpad.appspot.com/392002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@986 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-18 13:44:34 +00:00
ted.mielczarek
534189b735 Allow the crash generation server to be initialized with a handle instead of a pipe name
A=bsmedberg R=ted at http://breakpad.appspot.com/406002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@985 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-16 15:16:01 +00:00
cdn@chromium.org
e05aab7b6b Add the capability to include an arbitrary data stream within minidumps
This is supplied via a custom field "custom-data-stream"
Review URL: https://breakpad.appspot.com/408002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@984 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-10 18:52:07 +00:00
qsr@chromium.org
47e34e6f07 Fix compilation for iOS on XCode 4.5
Compilation directive for PPC was using MAC_OS_X_VERSION_MIN_REQUIRED.

 This is not correct, as the latest SDKs allow to compile for older version of
Mac OS, but don't contain the ppc headers. Changing the directive to use
MAC_OS_X_VERSION_MAX_ALLOWED instead.

 Moreover, uploader.mm was including pwd.h that was not used and doesn't exist
on the latest iOS SDK.
Review URL: https://breakpad.appspot.com/412002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@982 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-09 12:38:15 +00:00
digit@chromium.org
8d96707553 Add MD_OS_ANDROID definition.
In order to better distinguish Android and Linux minidumps, introduce
a new MD_OS_ANDROID definition, and modify related source code accordingly.

Also append the build-fingerprint to the minidump location descriptor.
This gives more information about the system image the device runs on.
Review URL: https://breakpad.appspot.com/405002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@981 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-04 11:56:26 +00:00
mark@chromium.org
7db2fb7b93 Do not fail crash dump generation if handle operations tracing is not enabled
and yet the fatal exception was STATUS_INVALID_HANDLE.

BUG=131699

Patch by Alex Pakhunov <alexeypa@chromium.org>

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@980 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-03 18:31:08 +00:00
mark@chromium.org
a15a2a6811 Allow the minidump writer to collect handle data so that resulting dump contains
information about opened handles (!handle) and handle operations trace
(!htrace).

Depending on the dump type different amount of data is collected. For a full
dump all handles and complete handle trace are included to the dump. In the case
of a minidump the list of handle operations for a single handle value (the last
handle value that caused STATUS_INVALID_HANDLE exception) is recorded. In either
case the handle trace should be explicitly enabled by the client process (or by
a debugger) in order to produce any handle trace data.

BUG=131699

Patch by Alex Pakhunov <alexeypa@chromium.org>

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@979 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-03 16:44:49 +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
mark@chromium.org
eb3bf49197 Change #imports that should have been #includes to #include.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@977 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-02 15:34:15 +00:00
mark@chromium.org
0866e8254d Remove 1 static initializer.
Patch by Nico Weber <thakis@chromium.org>

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@976 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-07-02 15:33:37 +00:00
ivan.penkov@gmail.com
1a7a0a4d4b Fixing a mem leak in test code
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@975 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-06-29 22:34:04 +00:00
ivan.penkov@gmail.com
6de969a304 This change allows compiling the google-breakpad code using a global ::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
2012-06-28 22:46:01 +00:00
digit@chromium.org
93cebf538e Fix Android build of client library
http://breakpad.appspot.com/401002/



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@973 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-06-27 14:04:52 +00:00
thestig@chromium.org
5f4fd97781 Fix a race condition in AutoCriticalSection.
CID=104232
Review URL: https://breakpad.appspot.com/398002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@972 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-06-19 23:42:18 +00:00
ivan.penkov@gmail.com
1208a8e369 This is a fix for a stackwalker_x86 issue which has to
do with FPO (frame-pointer-omission) optimized context
frames where the context frame represents a Windows
System call stub.



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@971 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-06-12 21:18:45 +00:00
mark@chromium.org
c50346b341 CrashGenerationServer's state machine can be invoked from both the application
thread and thread pool threads. This CL serializes access to the FSM state.
Handling of crash dump and client shutdown requests is still done
asynchronously.

Patch by Alex Pakhunov <alexeypa@chromium.org>

BUG=132164
TEST=remoting_unittests.BreakpadWinDeathTest.*

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@970 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-06-12 21:06:11 +00:00
qsr@chromium.org
fd67ff286e Fix uploader so that it send the guid to the server.
Review URL: https://breakpad.appspot.com/391002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@969 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-06-06 08:02:48 +00:00
mkrebs@chromium.org
d6b6959e0e sym_upload: Show failure if symbol server gives redirect response
Add a "response_code" parameter to Linux's HTTPUpload::SendRequest() that,
if non-NULL, will be set to the response code of the HTTP request.  Using
that, sym_upload will print a failure message on Linux if the response code
is not 200.  This is in line with the change made by
http://breakpad.appspot.com/77001/ for the Mac version.

BUG=google-breakpad:480, chromium-os:30032
TEST=Ran "sym_upload powertop.sym http://test.webdav.org/redir-tmp/"
     Ran "sym_upload powertop.sym http://clients2.google.com/cr/staging_symbol"
Review URL: https://breakpad.appspot.com/388002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@968 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-05-24 20:22:48 +00:00
thestig@chromium.org
4191cae361 Initialize a CustomClientInfo variable. (Coverity)
Review URL: https://breakpad.appspot.com/390003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@967 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-05-15 22:33:29 +00:00
mark@chromium.org
df8d4f964f Increase kMinidumpFileLengthLimit from 800000 to 2MB.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@966 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-05-15 22:30:15 +00:00
qsr@chromium.org
d3ad7c4c99 Fixing HTTPMultipartUpload.
The ending boundary for multipart must replace the last boundary, not added
after it.
Review URL: https://breakpad.appspot.com/390002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@965 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-05-15 15:41:08 +00:00
qsr@chromium.org
bbc3789df1 Unprotect the allocator before trying to create a minidump from a signal.
It is impossible to write a minidump with memory protected. This means that
before this change, no minidump were created when a signal was caught, instead
the application froze.
Review URL: https://breakpad.appspot.com/389002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@964 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-05-14 11:34:01 +00:00
mark@chromium.org
05d61dfd83 Bits necessary to send the reports along with the minidumps.
Currently the log file and the minidump are uploaded in two consequent requests,
thus they get different report ids and it's hard to associate them to each
other.
This CL makes the crash uploader send the minidump and the log file together in
a single multipart request, so that they have the same report id and are
accessible from the same landing page.

Patch by Alexander Potapenko <glider@chromium.org>

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@963 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-05-11 14:12:43 +00:00
jessicag.feedback
daf16276b4 Fix warning in r961 - C4800
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@962 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-05-07 21:31:31 +00:00
cdn@chromium.org
fa31053b42 wires up the crash client side so that the deferred upload callback can be used.
TEST=N/A 
Review URL: https://breakpad.appspot.com/384001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@961 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-05-03 18:15:11 +00:00
jimblandy
d1118d6e14 In the AMD64 stackwalker, use heuristics to provide %rbp more often, as
subsequent frames are usually unable to use CFI if they don't have an %rbp
value.

a=mrmiller, r=jimb


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@960 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-25 21:11:10 +00:00
ted.mielczarek
e6e778f635 Fix race in VerifyStackReadWithMultipleThreads
Patch by Chris Dearman <chris@mips.com>
R=ted at http://breakpad.appspot.com/377002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@959 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-25 11:42:52 +00:00
ted.mielczarek
e8dbecb42c Fix compiler warning from format string
Patch by Chris Dearman <chris@mips.com>
R=ted at http://breakpad.appspot.com/369002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@958 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-25 11:42:33 +00:00
ted.mielczarek
24c3c97633 Fix compilation warnings related to unchecked return values
Patch by Chris Dearman <chris@mips.com>
R=benchan at http://breakpad.appspot.com/377001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@957 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-25 11:22:09 +00:00
ted.mielczarek
258f2459fc Reap child in VerifyStackReadWithMultipleThreads
Patch by Chris Dearman <chris@mips.com>
R=benchan at http://breakpad.appspot.com/378001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@956 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-25 11:21:45 +00:00
benchan@chromium.org
fb7dbb4c28 Fix file descriptor leak in GetThreadInfoByIndex
Patch by Chris Dearman <chris@mips.com>
Review URL: http://breakpad.appspot.com/376001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@954 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-18 15:33:54 +00:00
cdn@chromium.org
05f02b46ed Set limit on the number of custom client info entries that can be sent with a crash dump.
BUG=123709
TEST=N/A
Review URL: https://breakpad.appspot.com/377004

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@953 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-17 18:20:22 +00:00
cdn@chromium.org
9a3de4160b Expose a callback to allow crash server implementations to defer the uploading of crash dumps to a later time. The client can provide a crash_id when the dump is performed and then at a later time connect again and request that the crash id be uploaded triggering an implementation defined callback.
BUG=473
TEST=CrashGenerationServerTest.*
Review URL: https://breakpad.appspot.com/379001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@952 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-13 22:20:30 +00:00
ted.mielczarek
789eac95fd Fix file descriptor leaks in ExternalDumper test
Patch by Chris Dearman <chris@mips.com>
R=ted at http://breakpad.appspot.com/372002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@951 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-11 20:44:09 +00:00
ted.mielczarek
de8292b1d4 Fix crash_generator error message
Patch by Chris Dearman <chris@mips.com>
R=ted at http://breakpad.appspot.com/374001/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@950 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-11 20:39:35 +00:00
thestig@chromium.org
88ccbb4804 vectors are cleared with "clear()", not with "empty()
A=thakis@chromium.org
R=thestig@chromium.org

Original code review: https://breakpad.appspot.com/377003/
Review URL: https://breakpad.appspot.com/380001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@949 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-11 03:47:07 +00:00
qsr@chromium.org
a66d4b272a Fixed "unused method" warning, reported by Xcode 4.2 on simulator.
Patch by tball@google.com
Review URL: https://breakpad.appspot.com/371002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@948 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-04 11:06:35 +00:00
jimblandy
c6485cb937 Accept version 3 .eh_frame unwinding data, as well as version 1.
a=michaelrmmiller
r=jimblandy


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@947 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-03 23:12:34 +00:00
mark@chromium.org
4f291f0307 Changes to get the breakpad client compiling and running on Android using
ndk-7b.

Patch by Carlos Valdivia <carlosvaldivia@google.com>

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@945 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-03 16:38:53 +00:00
ted.mielczarek@gmail.com
ae38954f50 Remove redundant include of CPP specific header files
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
2012-04-03 12:54:37 +00:00
ted.mielczarek@gmail.com
7585a27356 Fix several issues in linux_dumper_unittest_helper
Patch by Chris Dearman <chris@mips.com>
R=ted at http://breakpad.appspot.com/369001/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@943 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-04-03 12:48:43 +00:00
mkrebs@chromium.org
78373e45c5 Fix for putting main module as first one in minidump
The first module in a minidump is expected to be for the main executable.
We used to assume that /proc/<pid>/maps always showed that one first, but in
some cases that is no longer true (see comment #7 of the bug).  So this
change makes use of the entry point stored in auxv to make sure we put the
correct module first.

BUG=chromium-os:25355
TEST=Ran Breakpad tests
Review URL: https://breakpad.appspot.com/366002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@942 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-30 23:53:32 +00:00
mkrebs@chromium.org
70f5af9444 Fix GetMainModule() to properly get first module
Change MinidumpModuleList::GetMainModule() to use GetModuleAtIndex() instead
of GetModuleAtSequence() because the former gets the first module that was
in the minidump file, while the latter actually gets the first module when
sorted by address.  While this is pretty much the same thing at the moment,
I have another change in the works that can sometimes affect the module
order in the file.

BUG=chromium-os:25355
TEST=Ran Breakpad tests
Review URL: https://breakpad.appspot.com/366001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@941 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-30 21:59:16 +00:00
benchan@chromium.org
1d8752bf0f Fix memory leak in DisassemblerX86.
A memory leak in DisassemblerX86 is detected by valgrind. This patch
fixes the DisassemblerX86 destructor to properly free the |current_instr_|
variable.

BUG=471
TEST=Run valgrind on disassembler_x86_unittest to verify the leak is gone.
Review URL: https://breakpad.appspot.com/371001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@940 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-30 21:01:09 +00:00
mark@chromium.org
f6147a6460 Fix one more -Wnull-conversion warning.
Patch by Nico Weber <thakis@chromium.org>

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@939 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-30 20:36:32 +00:00
mark@chromium.org
07b3445bf1 Fix -Wnull-conversion warnings in breakpad.
Patch by Nico Weber <thakis@chromium.org>

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@938 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-30 14:30:06 +00:00
benchan@chromium.org
a5477bbfab Fix class/struct mismatches in forward declarations.
This patch fixes some compiler warnings when compiling with clang.

BUG=none
TEST=Compile with clang and run unit tests.
Review URL: https://breakpad.appspot.com/368001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@937 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-30 05:01:50 +00:00
cdn@chromium.org
e89a7747b8 Unregister waits when a client shuts down so that no further callback events can
fire for that client.

BUG=117890
TEST=N/A
Review URL: https://breakpad.appspot.com/365001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@936 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-22 18:01:50 +00:00
qsr@chromium.org
1e8d2d5a4c Add high level API for breakpad on iOS.
The new API allows to automatically upload repports to the crash server when the application restarts.

 This change also:
 - Correct a bug on the test for correct alignment of the abrt signal handler
 - Add user friendly information on crashes for SIGABRT and NSException
Review URL: https://breakpad.appspot.com/361001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@935 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-13 20:02:40 +00:00
qsr@chromium.org
7facb6a6fb Change iOS implementation to not use exc_server
Instead of using exc_server, the message is parsed directly, and the minidump
is created, then the app is killed.

 Moreover, the only catch exception is exception_raise. This patch remove all
 rereference to exception_raise_state and exception_raise_state_identity.
Review URL: https://breakpad.appspot.com/358001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@934 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-09 19:22:10 +00:00
qsr@chromium.org
b1f858f26b Add SIGABRT handler for mac and iOS.
SIGABRT were not handled while in process. This change add a signal handler to
handle this.
Review URL: https://breakpad.appspot.com/360001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@933 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-09 19:11:58 +00:00
nealsid
61b5dcb168 Add COPYING file per libcurl distribution requirements
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@932 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-09 16:15:20 +00:00
qsr@chromium.org
fe7f63632f Remove static initializer in linux/guid_creator.cc.
There was a static initializer generated for this file in Chrome for Android.

 Patch by pliard@chromium.org
 Original review: http://breakpad.appspot.com/359001/
Review URL: https://breakpad.appspot.com/359002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@931 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-08 18:47:26 +00:00
qsr@chromium.org
76acc0edcd Removing breakpad_exc_server and all references.
This was aimed at replacing exc_server, but was not used.
Review URL: https://breakpad.appspot.com/357001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@930 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-08 00:02:58 +00:00
qsr@chromium.org
af7d5ccf7b Correct various compilation warnings.
- Cast result of _dyld_image_count to prevent compilation warning: The 2 int
   in both side of the ? operator should have the same type.
 - Remove unused variable for return values.
 - Remove unused NSUserDefaults.
Review URL: https://breakpad.appspot.com/354001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@929 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-07 00:18:29 +00:00
qsr@chromium.org
04548babac Send uptime as milliseconds for Mac and iOS.
All other platform are sending uptime as milliseconds. Changing the
implementation to do the same on Mac and iOS.
Review URL: https://breakpad.appspot.com/355001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@928 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-03-02 08:27:20 +00:00
mark@chromium.org
84a55c5a72 Support for .raSearch in the x86 stackwalker
Patch by Benjamin Smedberg <bsmedberg@gmail.com>


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@927 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-23 22:56:53 +00:00
mark@chromium.org
26c31918f7 Handle program strings with the assignment operator smashed against the next
token.

Patch by Benjamin Smedberg <bsmedberg@gmail.com>


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@926 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-23 22:41:36 +00:00
benchan@chromium.org
907f95c5bd Modify CrashGenerator::CreateChildCrash to copy proc files.
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
2012-02-23 18:50:08 +00:00
mark@chromium.org
7caf87236a Fix an invalid cast in PostfixEvaluator<ValueType>::EvaluateInternal().
This patch fixes a compilation error with gcc / clang on Linux / Mac OS.

BUG=none
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.

Patch by Ben Chan <benchan@chromium.org>


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@924 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-23 18:44:45 +00:00
ted.mielczarek
f2e937f1cb Add support for @ operator to PostfixEvaluator
R=mark at http://breakpad.appspot.com/349002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@923 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-21 23:15:30 +00:00
mark@chromium.org
80bcce941e Move away from the 10.4 SDK.
Review URL: https://breakpad.appspot.com/351001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@922 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-21 21:33:09 +00:00
mark@chromium.org
6fbc102794 Funnel all bootstrap_register calls through a routine that doesn't care that
it's deprecated. Apple marked bootstrap_register as deprecated on 10.5 but
it's actually still needed on that OS release. There isn't a way to get the
functionality Breakpad needs from it without calling it until 10.6.
Review URL: https://breakpad.appspot.com/350001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@921 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-21 21:24:43 +00:00
ted.mielczarek
430c0a371a Add some missing #includes
P=Albert Zeyer
R=ted at http://breakpad.appspot.com/289001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@920 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-15 16:26:32 +00:00
ted.mielczarek
11ee73fc55 Add filename to error message when PDBSourceLineWriter::Open fails
P=Albert Zeyer
R=ted at http://breakpad.appspot.com/286002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@919 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-15 15:29:44 +00:00
ted.mielczarek
87063908ad Avoid setting an alternative stack for signals if there is already one
P=Mike Hommey <mh@glandium.org>
R=ted at http://codereview.appspot.com/5573054/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@918 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-14 13:21:39 +00:00
qsr@chromium.org
199703cbff Add missing include.
As the include define some method to be inlined, not having the include breaks the compilation of optimized builds.
Review URL: https://breakpad.appspot.com/347002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@917 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-14 12:14:31 +00:00
qsr@chromium.org
5d7f694f27 Creating minidump for uncaught exception on iOS.
This CL adds a minidump_generator that can write a minidump from a NSException
on iOS on an ARM cpu.

 This CL also install an uncaught exception handler on iOS, and use the
previous generator to write minidumps for any uncaught exception.
Review URL: https://breakpad.appspot.com/347001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@916 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-14 08:46:26 +00:00
mark@chromium.org
8e3dcd5a02 createDirectoryAtPath:attributes: is deprecated, use the suggested (10.5+)
replacement.

Patch by Nico Weber <thakis@chromium.org>

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@915 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-09 20:31:08 +00:00
mark@chromium.org
a4c66ebff5 Fix clang warning about format string.
Patch by Nico Weber <thakis@chromium.org>.

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


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@914 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-09 20:30:31 +00:00
mark@chromium.org
3aa10d2a87 NXSwapBigIntToHost is deprecated, use CFSwapInt32BigToHost instead.
Patch by Nico Weber <thakis@chromium.org>


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@913 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-06 17:33:12 +00:00
jimblandy
5e4f6feaf6 Breakpad DWARF: Add support for DWARF 4 attribute forms.
This patch allows Breakpad's DWARF reader to at least read or skip
attributes using the new forms defined in version 4 of the DWARF
specification, instead of crashing.

Attributes encoded using DW_FORM_flag_present, DW_FORM_sec_offset, and
DW_FORM_exprloc should work fine now. However, compilation units using
DW_FORM_ref_sig8 to refer to types in .debug_types will need further work
to support. (GCC 4.6.2 does not emit .debug_types sections.)

Specifically:

- dwarf2reader::DwarfForm gets new values.
- dwarf2reader::Dwarf2Handler and dwarf2reader::DIEHandler get new handler
  methods, named ProcessAttributeSignature, for DW_FORM_ref_sig8 attributes.
- dwarf2reader::CompilationUnit reads DW_FORM_ref_sig8 attributes, and
  passes them to ProcessAttributeSignature. It also gets support for
  DW_FORM_sec_offset, DW_FORM_exprloc, and DW_FORM_flag_present, using the
  existing appropriate ProcessAttribute* methods.
- dwarf2reader::DIEDispatcher passes through ProcessAttributeSignature
  attributes to its DIEHandler.
- Unit tests are updated.

a=jimb, r=ted.mielczarek
Review URL: http://breakpad.appspot.com/343003/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@912 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-01 15:01:54 +00:00
jimblandy
08b912f1ed Breakpad DWARF support: Remove extraneous breaks following returns in dwarf2reader.cc.
a=jimb, r=ted.mielczarek
Review URL: http://breakpad.appspot.com/343002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@911 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-01 15:00:43 +00:00
jimblandy
6eccfe32b1 Add partial unit tests for dwarf2reader::CompilationUnit.
This is really incomplete --- it's just what's needed to get started
testing support for the DWARF 4 attribute forms.


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@910 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-02-01 14:57:58 +00:00
ted.mielczarek
e06ebb4817 Change some functions in linux_libc_support.h to use intmax_t instead of int.
A=Benjamin Smedberg <benjamin@smedbergs.us>
R=ted
Review URL: https://bugzilla.mozilla.org/show_bug.cgi?id=716638

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@909 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-01-27 12:51:07 +00:00
benchan@chromium.org
403124f9e2 Fix test addresses to use uintptr_t instead of u_int64_t.
When a variable is used to set (and lookup) MappingInfo's "start_addr"
field, it needs to match types -- which is "uintptr_t".  When Chrome OS
updated the 'make' that's used for building, the 32-bit "char *" had
sign-extended when cast up to a u_int64_t -- maybe because pointers were
unsigned before and then changed to be signed -- and that caused the address
lookup to fail.

BUG=chromium-os:25355
TEST=Ran Breakpad unittests
A=mkrebs@chromium.org
Review URL: http://breakpad.appspot.com/345001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@908 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-01-27 05:23:23 +00:00
mark@chromium.org
1197f761a4 Fix several clang warnings in breakpad.
uploader.mm:549:5: warning: instance method '-uploadData:name:url:' not found (return type defaults to 'id')
[self uploadData:logFileData_ name:@"log" url:url];
=> it looks like this method does in fact not exist, the last parameter
needs to be removed.

breakpad_nlist_64.cc:193:59: warning: '&&' within '||' [-Wlogical-op-parentheses]
=> Just add parentheses, no functionality change.

Patch by Nico Weber <thakis@chromium.org>

BUG=none
TEST=breakpad stil works.


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@907 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-01-26 19:05:31 +00:00
thestig@chromium.org
4ab7db99c1 Use sys_prctl instead of prctl.
http://breakpad.appspot.com/339002


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@906 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-01-24 00:46:54 +00:00
benchan@chromium.org
30566abed8 Implement core dump to minidump conversion.
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. Turn the LinuxDumper class into a base class and move ptrace related
   code into a new derived class, LinuxPtraceDumper.
2. Add a LinuxCoreDumper class, which is derived from LinuxDumper, to
   extract information from a crashed process via a core dump file instead
   of ptrace.
3. Add a WriteMinidumpFromCore function to
     src/client/linux/minidump_writer/minidump_writer.h,
   which uses LinuxCoreDumper to extract information from a core dump file.
4. Add a core2md utility, which simply wraps WriteMinidumpFromCore, for
   converting a core dump to a minidump.

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 Chromium OS tests to test core2md.
Review URL: http://breakpad.appspot.com/343001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@905 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-01-19 07:14:51 +00:00
benchan@chromium.org
3822e36b20 Skip ElfCoreDumpTest.ValidCoreFile test if no core dump is generated.
CrashGenerator::CreateChildCrash() may have some flakiness. This patch
changes ElfCoreDumpTest to temporarily skip the ValidCoreFile test if
no core dump is generated by CrashGenerator::CreateChildCrash(), but
print out the error message to help debug the flakiness.

BUG=chromium-os:24982
TEST=Tested the following:
1. Build on 32-bit and 64-bit Linux with gcc 4.6.
2. All unit tests pass.
Review URL: http://breakpad.appspot.com/342001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@904 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-01-11 22:19:38 +00:00
thestig@chromium.org
03c31f2100 Build LinuxLibcSupportTest and make it pass.
Review URL: http://breakpad.appspot.com/341001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@903 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-01-11 20:35:18 +00:00
benchan@chromium.org
577304f02a Refactor LinuxDumper and MinidumpWriter.
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 two convenient methods, back() and empty(), to the wasteful_vector
   class.
2. Refactor the LinuxDumper class such that it can later be splitted into
   a base class and two derived classes, one uses the current ptrace
   implementation and one uses a core file.
3. Refactor the MinidumpWriter class such that it can later use different
   derived implementations of LinuxDumper.

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/340001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@902 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-01-11 01:31:35 +00:00
benchan@chromium.org
384c078d2e Clear error state flags in binarystream::rewind().
This patch is taken from the downstream google-breakpad in Chromium OS
(https://gerrit.chromium.org/gerrit/#change,7797), which makes
binarystream::rewind() properly clear error state flags.

BUG=460
TEST=Tested in downstream google-breakpad in Chromium OS.
A=asharif@chromium.org
Review URL: http://breakpad.appspot.com/339001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@901 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-01-09 19:43:11 +00:00
benchan@chromium.org
07e521c396 Add utilities for processing Linux core dump files.
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
2012-01-07 02:25:22 +00:00
thestig@chromium.org
33f62804fd Send crash dumps to Google via HTTPS instead of HTTP, since they might
contain sensitive information.

BUG=none
TEST=crash dumps still arrive
A=palmer@chromium.org

Original code review: http://breakpad.appspot.com/338001
Review URL: http://breakpad.appspot.com/334002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@899 4c0a9323-5329-0410-9bdc-e9ce6186880e
2012-01-04 00:13:49 +00:00
benchan@chromium.org
33c135a16f Replace MMappedRange with MinidumpMemoryRange.
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
2011-12-21 22:33:21 +00:00
mark@chromium.org
5951dd28af Eliminate another source of UnspecifiedStackSignature crash dumps.
Manufacturing an exception record improves the crash reporting, since then
the crashes get bucketed by the call stack leading to the dump, instead of 
all falling into a misc bucket that nobody ever looks at.
Currently these are occuring through e.g. dumps from the base watchdog.

Link against RtlCaptureContext, as the function has been documented as
available
from Windows XP
[http://msdn.microsoft.com/en-us/library/windows/desktop/ms680591(v=vs.85).aspx].

Patch by Siggi Asgeirsson <siggi@chromium.org>


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@897 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-12-21 22:09:56 +00:00
benchan@chromium.org
ae5193c24e Replace readlink calls with a safer version that guarantees NULL-termination.
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
2011-12-21 17:51:40 +00:00
benchan@chromium.org
f044345c23 Refactor code in preparation of merging with the fork in Chromium OS.
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
2011-12-16 16:42:59 +00:00
benchan@chromium.org
25b886a7fd Fix ContextDeathTest.X86BadFlags unit test on Mac OS X.
The assertion (context.context_flags & MD_CONTEXT_X86) in synth_minidump.cc
produces a different message on Mac OS X than other platforms. This patch
changes the ContextDeathTest.X86BadFlags test to handle both message patterns.

BUG=424
TEST=Verified ContextDeathTest.X86BadFlags on Windows, Linux and Mac OS X.
Review URL: http://breakpad.appspot.com/333001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@894 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-12-16 02:15:11 +00:00
qsr@chromium.org
a42704eccc Add API on iOS to generate dump on demand.
Review URL: http://breakpad.appspot.com/331001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@893 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-12-09 08:21:26 +00:00
stuartmorgan
50cfc4a091 Fix a missed include path change from r889. (r=qsr in person)
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@892 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-12-02 10:35:19 +00:00
mark@chromium.org
06c856fd67 Speculative back-out of r883, which may have broken Windows crash reporting.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@891 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-11-28 19:17:41 +00:00
jimblandy
29138814cc Fix some comments and parameter names.
Trivial changes; committing for post-facto review.



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@890 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-11-23 23:03:30 +00:00
qsr@chromium.org
e6a2f54c4d Create a static library to use Breakpad on iOS.
This obliged me to move BreakpadDefines.h to src/client/apple/Framework/BreakpadDefines.h
Review URL: http://breakpad.appspot.com/329001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@889 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-11-23 16:14:35 +00:00
qsr@chromium.org
bad70be095 Correct compilation warning.
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
2011-11-23 14:22:05 +00:00
ted.mielczarek
84571a2b91 Rename md5.c to md5.cc, put its contents inside the google_breakpad namespace.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@887 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-11-18 21:40:27 +00:00
qsr@chromium.org
d529b2d0a0 Correct bug introduced by last commit: Interface on Breakpad is incorrect.
R=mark@chromium.org


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@886 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-11-16 17:42:49 +00:00
qsr@chromium.org
976930db64 Add an API to Breakpad to upload custom file to the crash server.
On iOS, sending logs using the usual breakpad behavior is not possible, because
tar is not available. This allow to use Breakpad to send any file to the crash
server.

R=mark@chromium.org
Review URL: http://breakpad.appspot.com/327001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@885 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-11-16 17:04:28 +00:00
stuartmorgan
b2196565bd Fix several error-case leaks on the Mac found by clang analysis
Review URL: http://breakpad.appspot.com/325001


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@884 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-11-14 13:16:19 +00:00
ted.mielczarek
06cede988b Allow CrashGenerationClient to request that a dump of the parent process be written.
A=Jim Mathies <jmathies@mozilla.com> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=679238

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@883 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-11-11 19:05:51 +00:00
qsr@chromium.org
a8d599dc00 Correct leak.
Uploaders were never released.
Review URL: http://breakpad.appspot.com/326001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@882 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-11-10 16:28:20 +00:00
kmixter@chromium.org
efcd534bd2 Fix problem with not NULL terminating mapping name.
BUG=453
Review URL: http://breakpad.appspot.com/323001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@881 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-11-09 22:39:26 +00:00
qsr@chromium.org
ec24b1b19e Add mach_vm_deallocate to the set of function not available on iOS5.
Review URL: http://breakpad.appspot.com/318003

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@880 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-10-24 15:16:10 +00:00
qsr@chromium.org
09de69eca1 Do not use mach_vm.h on iOS.
mach_vm.h has been removed from iOS5. Use #define to use vm_ replacement of
mach_vm_ functions on iOS.

 Do not use mach_vm_allocate -> use a stack variable instead.
Review URL: http://breakpad.appspot.com/321001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@879 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-10-24 14:58:12 +00:00
mark@chromium.org
64b18d123a Upstream fix for compiling of breakpad with gcc-4.6. Remove an unnecessary
"const" that causes an error with the newer gcc.

BUG=chromium-os:14973
TEST=Built CrOS's google-breakpad

Patch by Michael Krebs <mkrebs@chromium.org>


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@878 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-10-22 16:57:10 +00:00
thestig@chromium.org
11582abc27 Fix some shadow variables, including one in file_id.cc that causes all files 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
2011-10-20 18:23:01 +00:00
qsr@chromium.org
70698339f6 Correct incorrect bounds checking.
Review URL: http://breakpad.appspot.com/319002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@874 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-10-20 15:39:57 +00:00
qsr@chromium.org
446616ee22 Allow to retrieve id of a module from memory instead of going to disk for iOS.
Allow macho_id and macho_walker to read data from memory.
 Wire up this when reading module on iOS.
Review URL: http://breakpad.appspot.com/319001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@873 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-10-20 15:22:48 +00:00
mark@chromium.org
05829315f0 Fix svn:executable and svn:eol-style properties in src/client/windows.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@872 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-10-20 13:18:59 +00:00
qsr@chromium.org
38e7f8b51b Changing declaration order of field to correct compilation warnings.
Review URL: http://breakpad.appspot.com/316001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@871 4c0a9323-5329-0410-9bdc-e9ce6186880e
2011-10-18 07:35:46 +00:00