1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-19 04:11:46 +02:00

* Added breakpad support for Linux.

This commit is contained in:
Christian Muehlhaeuser
2011-09-15 07:27:31 +02:00
parent d8b07cee9c
commit d8d7347394
1163 changed files with 465521 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,82 @@
// Copyright (c) 2009, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Breakpad test application for Linux. When run, it generates one on-demand
// minidump and then crashes, which should generate an on-crash minidump.
// dump_syms can be used to extract symbol information for use in processing.
// To build:
// g++ -g -o linux_test_app -I ../../ -L../../client/linux linux_test_app.cc \
// -lbreakpad
// Add -m32 to build a 32-bit executable, or -m64 for a 64-bit one
// (assuming your environment supports it). Replace -g with -gstabs+ to
// generate an executable with STABS symbols (needs -m32), or -gdwarf-2 for one
// with DWARF symbols (32- or 64-bit)
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <string>
#include "client/linux/handler/exception_handler.h"
#include "third_party/lss/linux_syscall_support.h"
namespace {
// google_breakpad::MinidumpCallback to invoke after minidump generation.
static bool callback(const char *dump_path, const char *id,
void *context,
bool succeeded) {
if (succeeded) {
printf("dump guid is %s\n", id);
} else {
printf("dump failed\n");
}
fflush(stdout);
return succeeded;
}
static void CrashFunction() {
int *i = reinterpret_cast<int*>(0x45);
*i = 5; // crash!
}
} // namespace
int main(int argc, char **argv) {
google_breakpad::ExceptionHandler eh(".", NULL, callback, NULL, true);
if (!eh.WriteMinidump()) {
printf("Failed to generate on-demand minidump\n");
}
CrashFunction();
printf("did not crash?\n");
return 0;
}

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,21 @@
OS|Windows NT|5.1.2600 Service Pack 2
CPU|x86|GenuineIntel family 6 model 13 stepping 8|1
Crash|EXCEPTION_ACCESS_VIOLATION_WRITE|0x45|0
Module|test_app.exe||test_app.pdb|5A9832E5287241C1838ED98914E9B7FF1|0x00400000|0x0042cfff|1
Module|dbghelp.dll|5.1.2600.2180|dbghelp.pdb|39559573E21B46F28E286923BE9E6A761|0x59a60000|0x59b00fff|0
Module|imm32.dll|5.1.2600.2180|imm32.pdb|2C17A49C251B4C8EB9E2AD13D7D9EA162|0x76390000|0x763acfff|0
Module|psapi.dll|5.1.2600.2180|psapi.pdb|A5C3A1F9689F43D8AD228A09293889702|0x76bf0000|0x76bfafff|0
Module|ole32.dll|5.1.2600.2726|ole32.pdb|683B65B246F4418796D2EE6D4C55EB112|0x774e0000|0x7761cfff|0
Module|version.dll|5.1.2600.2180|version.pdb|180A90C40384463E82DDC45B2C8AB76E2|0x77c00000|0x77c07fff|0
Module|msvcrt.dll|7.0.2600.2180|msvcrt.pdb|A678F3C30DED426B839032B996987E381|0x77c10000|0x77c67fff|0
Module|user32.dll|5.1.2600.2622|user32.pdb|EE2B714D83A34C9D88027621272F83262|0x77d40000|0x77dcffff|0
Module|advapi32.dll|5.1.2600.2180|advapi32.pdb|455D6C5F184D45BBB5C5F30F829751142|0x77dd0000|0x77e6afff|0
Module|rpcrt4.dll|5.1.2600.2180|rpcrt4.pdb|BEA45A721DA141DAA3BA86B3A20311532|0x77e70000|0x77f00fff|0
Module|gdi32.dll|5.1.2600.2818|gdi32.pdb|C0EA66BE00A64BD7AEF79E443A91869C2|0x77f10000|0x77f56fff|0
Module|kernel32.dll|5.1.2600.2945|kernel32.pdb|BCE8785C57B44245A669896B6A19B9542|0x7c800000|0x7c8f3fff|0
Module|ntdll.dll|5.1.2600.2180|ntdll.pdb|36515FB5D04345E491F672FA2E2878C02|0x7c900000|0x7c9affff|0
0|0|test_app.exe|`anonymous namespace'::CrashFunction|c:\test_app.cc|58|0x3
0|1|test_app.exe|main|c:\test_app.cc|65|0x4
0|2|test_app.exe|__tmainCRTStartup|f:\sp\vctools\crt_bld\self_x86\crt\src\crt0.c|327|0x11
0|3|kernel32.dll|BaseProcessStart|||0x22

View File

@@ -0,0 +1,39 @@
Operating system: Windows NT
5.1.2600 Service Pack 2
CPU: x86
GenuineIntel family 6 model 13 stepping 8
1 CPU
Crash reason: EXCEPTION_ACCESS_VIOLATION_WRITE
Crash address: 0x45
Thread 0 (crashed)
0 test_app.exe!`anonymous namespace'::CrashFunction [test_app.cc : 58 + 0x3]
eip = 0x0040429e esp = 0x0012fe84 ebp = 0x0012fe88 ebx = 0x7c80abc1
esi = 0x00000002 edi = 0x00000a28 eax = 0x00000045 ecx = 0x0012fe94
edx = 0x0042bc58 efl = 0x00010246
Found by: given as instruction pointer in context
1 test_app.exe!main [test_app.cc : 65 + 0x4]
eip = 0x00404200 esp = 0x0012fe90 ebp = 0x0012ff70
Found by: call frame info
2 test_app.exe!__tmainCRTStartup [crt0.c : 327 + 0x11]
eip = 0x004053ec esp = 0x0012ff78 ebp = 0x0012ffc0
Found by: call frame info
3 kernel32.dll!BaseProcessStart + 0x22
eip = 0x7c816fd7 esp = 0x0012ffc8 ebp = 0x0012fff0
Found by: call frame info
Loaded modules:
0x00400000 - 0x0042cfff test_app.exe ??? (main)
0x59a60000 - 0x59b00fff dbghelp.dll 5.1.2600.2180
0x76390000 - 0x763acfff imm32.dll 5.1.2600.2180
0x76bf0000 - 0x76bfafff psapi.dll 5.1.2600.2180
0x774e0000 - 0x7761cfff ole32.dll 5.1.2600.2726
0x77c00000 - 0x77c07fff version.dll 5.1.2600.2180
0x77c10000 - 0x77c67fff msvcrt.dll 7.0.2600.2180
0x77d40000 - 0x77dcffff user32.dll 5.1.2600.2622
0x77dd0000 - 0x77e6afff advapi32.dll 5.1.2600.2180
0x77e70000 - 0x77f00fff rpcrt4.dll 5.1.2600.2180
0x77f10000 - 0x77f56fff gdi32.dll 5.1.2600.2818
0x7c800000 - 0x7c8f3fff kernel32.dll 5.1.2600.2945
0x7c900000 - 0x7c9affff ntdll.dll 5.1.2600.2180

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
MODULE windows x86 111111111111111111111111111111111 module1.pdb
INFO CODE_ID FFFFFFFF module1.exe
FILE 1 file1_1.cc
FILE 2 file1_2.cc
FILE 3 file1_3.cc
FUNC 1000 c 0 Function1_1
1000 4 44 1
1004 4 45 1
1008 4 46 1
FUNC 1100 8 4 Function1_2
1100 4 65 2
1104 4 66 2
FUNC 1200 100 8 Function1_3
FUNC 1300 100 c Function1_4
FUNC 2000 0 0 Test_Zero_Size_Function_Is_Ignored
2000 4 88 2
PUBLIC 2800 0 PublicSymbol
FUNC 3000 7000 42 LargeFunction
3000 7000 4098359 3
STACK WIN 4 1000 c 1 0 0 0 0 0 1 $eip 4 + ^ = $esp $ebp 8 + = $ebp $ebp ^ =
STACK WIN 4 1100 8 1 0 0 0 0 0 1 $eip 4 + ^ = $esp $ebp 8 + = $ebp $ebp ^ =
STACK WIN 4 1100 100 1 0 0 0 0 0 1 $eip 4 + ^ = $esp $ebp 8 + = $ebp $ebp ^ =
STACK WIN 4 1300 100 1 0 0 0 0 0 1 $eip 4 + ^ = $esp $ebp 8 + = $ebp $ebp ^ =
STACK CFI INIT 3d40 af .cfa: $esp 4 + .ra: .cfa 4 - ^
STACK CFI 3d41 .cfa: $esp 8 +
STACK CFI 3d43 .cfa: $ebp 8 + $ebp: .cfa 8 - ^
STACK CFI 3d54 $ebx: .cfa 20 - ^
STACK CFI 3d5a $esi: .cfa 16 - ^
STACK CFI 3d84 $edi: .cfa 12 - ^

View File

@@ -0,0 +1,23 @@
MODULE windows x86 222222222 module2.pdb
FILE 1 file2_1.cc
FILE 2 file2_2.cc
FILE 3 file2_3.cc
FUNC 2000 c 4 Function2_1
1000 4 54 1
1004 4 55 1
1008 4 56 1
PUBLIC 2160 0 Public2_1
FUNC 2170 14 4 Function2_2
2170 6 10 2
2176 4 12 2
217a 6 13 2
2180 4 21 2
PUBLIC 21a0 0 Public2_2
STACK WIN 4 2000 c 1 0 0 0 0 0 1 $eip 4 + ^ = $esp $ebp 8 + = $ebp $ebp ^ =
STACK WIN 4 2170 14 1 0 0 0 0 0 1 $eip 4 + ^ = $esp $ebp 8 + = $ebp $ebp ^ =
STACK CFI INIT 3df0 af .cfa: $esp 4 + .ra: .cfa 4 - ^
STACK CFI 3df1 .cfa: $esp 8 +
STACK CFI 3df3 .cfa: $ebp 8 + $ebp: .cfa 8 - ^
STACK CFI 3e04 $ebx: .cfa 20 - ^
STACK CFI 3e0a $esi: .cfa 16 - ^
STACK CFI 3e34 $edi: .cfa 12 - ^

View File

@@ -0,0 +1,3 @@
MODULE windows x86 333333333333333333333333333333333 module3.pdb
FILE 1 file1.cc
FUNC 1000

View File

@@ -0,0 +1,5 @@
MODULE windows x86 444444444444444444444444444444444 module4.pdb
FILE 1 file4_1.cc
FILE 2 file4_2.cc
1000 4 44 1
1004 4 45 1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,69 @@
// Copyright (c) 2006, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file is used to generate minidump2.dmp and minidump2.sym.
// cl /Zi test_app.cc /Fetest_app.exe /I google_breakpad/src \
// google_breakpad/src/client/windows/releasestaticcrt/exception_handler.lib
// Then run test_app to generate a dump, and dump_syms to create the .sym file.
#include <stdio.h>
#include "client/windows/handler/exception_handler.h"
namespace {
static bool callback(const wchar_t *dump_path, const wchar_t *id,
void *context, EXCEPTION_POINTERS *exinfo,
MDRawAssertionInfo *assertion,
bool succeeded) {
if (succeeded) {
printf("dump guid is %ws\n", id);
} else {
printf("dump failed\n");
}
fflush(stdout);
return succeeded;
}
static void CrashFunction() {
int *i = reinterpret_cast<int*>(0x45);
*i = 5; // crash!
}
} // namespace
int main(int argc, char **argv) {
google_breakpad::ExceptionHandler eh(
L".", NULL, callback, NULL,
google_breakpad::ExceptionHandler::HANDLER_ALL);
CrashFunction();
printf("did not crash?\n");
return 0;
}

Binary file not shown.