Skip to content

Commit acc4c72

Browse files
committed
Update vendor/google-breakpad to ecbbfbeb9dee9de92f6dac680e20c63ba9406426
1 parent bc3b800 commit acc4c72

File tree

214 files changed

+10043
-1707
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+10043
-1707
lines changed

vendor/google-breakpad/appveyor.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
version: '{build}'
2+
3+
environment:
4+
GYP_MSVS_VERSION: 2013
5+
6+
platform:
7+
- Win32
8+
9+
configuration:
10+
- Debug
11+
- Release
12+
13+
# Use the source dir expected by gclient.
14+
clone_folder: c:\projects\breakpad\src
15+
16+
# Before checkout.
17+
init:
18+
- cd %APPVEYOR_BUILD_FOLDER%\..\..
19+
- appveyor DownloadFile https://storage.googleapis.com/chrome-infra/depot_tools.zip
20+
- 7z -bd x depot_tools.zip -odepot_tools
21+
- depot_tools\update_depot_tools
22+
- cd %APPVEYOR_BUILD_FOLDER%
23+
24+
# After checkout.
25+
install:
26+
- PATH C:\projects\depot_tools;%PATH%
27+
- cd %APPVEYOR_BUILD_FOLDER%\..
28+
- gclient config https://%APPVEYOR_REPO_PROVIDER%.com/%APPVEYOR_REPO_NAME% --unmanaged --name=src
29+
- gclient sync
30+
31+
build_script:
32+
- cd %APPVEYOR_BUILD_FOLDER%
33+
- msbuild src\client\windows\breakpad_client.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /m /verbosity:normal
34+
- msbuild src\tools\windows\tools_windows.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /m /verbosity:normal
35+
36+
test_script:
37+
- src\client\windows\%CONFIGURATION%\client_tests.exe
38+
- src\tools\windows\%CONFIGURATION%\dump_syms_unittest.exe
39+
40+
artifacts:
41+
- path: '**\*.exe'
42+
- path: '**\*.lib'

vendor/google-breakpad/default.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<!-- AUTOGENERATED BY deps-to-manifest.py; DO NOT EDIT -->
3+
<manifest>
4+
5+
<default revision='refs/heads/master'
6+
remote='chromium'
7+
sync-c='true'
8+
sync-j='8' />
9+
10+
<remote name='github'
11+
fetch='https://github.com/'
12+
review='' />
13+
14+
<remote name='chromium'
15+
fetch='https://chromium.googlesource.com/'
16+
review='https://chromium-review.googlesource.com' />
17+
18+
<project path='src'
19+
name='breakpad/breakpad'
20+
revision='refs/heads/master'
21+
remote='chromium' />
22+
23+
<project path='src/src/tools/gyp'
24+
name='external/gyp/'
25+
revision='324dd166b7c0b39d513026fa52d6280ac6d56770'
26+
remote='chromium' />
27+
28+
<project path='src/src/testing'
29+
name='google/googletest.git'
30+
revision='refs/tags/release-1.8.0'
31+
remote='github' />
32+
33+
<project path='src/src/third_party/lss'
34+
name='linux-syscall-support/'
35+
revision='a89bf7903f3169e6bc7b8efc10a73a7571de21cf'
36+
remote='chromium' />
37+
38+
<project path='src/src/third_party/protobuf/protobuf'
39+
name='google/protobuf.git'
40+
revision='cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac'
41+
remote='github' />
42+
43+
</manifest>

vendor/google-breakpad/src/build/common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@
894894
],
895895
'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
896896
'msvs_disabled_warnings': [
897-
4100, 4127, 4396, 4503, 4512, 4819, 4995, 4702
897+
4091, 4100, 4127, 4366, 4396, 4503, 4512, 4819, 4995, 4702
898898
],
899899
'msvs_settings': {
900900
'VCCLCompilerTool': {

vendor/google-breakpad/src/client/ios/Breakpad.mm

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,22 @@
3636
#include <pthread.h>
3737
#include <sys/stat.h>
3838
#include <sys/sysctl.h>
39+
#include <TargetConditionals.h>
40+
41+
#include <string>
3942

4043
#import "client/ios/handler/ios_exception_minidump_generator.h"
4144
#import "client/mac/crash_generation/ConfigFile.h"
42-
#import "client/mac/handler/exception_handler.h"
4345
#import "client/mac/handler/minidump_generator.h"
44-
#import "client/mac/sender/uploader.h"
4546
#import "client/mac/handler/protected_memory_allocator.h"
46-
#import "common/simple_string_dictionary.h"
47+
#import "client/mac/sender/uploader.h"
48+
#import "common/long_string_dictionary.h"
49+
50+
#if !TARGET_OS_TV && !TARGET_OS_WATCH
51+
#import "client/mac/handler/exception_handler.h"
52+
#else
53+
#import "client/ios/exception_handler_no_mach.h"
54+
#endif // !TARGET_OS_TV && !TARGET_OS_WATCH
4755

4856
#if !defined(__EXCEPTIONS) || (__clang__ && !__has_feature(cxx_exceptions))
4957
// This file uses C++ try/catch (but shouldn't). Duplicate the macros from
@@ -59,7 +67,7 @@
5967

6068
using google_breakpad::ConfigFile;
6169
using google_breakpad::EnsureDirectoryPathExists;
62-
using google_breakpad::SimpleStringDictionary;
70+
using google_breakpad::LongStringDictionary;
6371

6472
//=============================================================================
6573
// We want any memory allocations which are used by breakpad during the
@@ -190,7 +198,7 @@ bool HandleMinidump(const char *dump_dir,
190198
// MachineExceptions.h, we have to explicitly name the handler.
191199
google_breakpad::ExceptionHandler *handler_; // The actual handler (STRONG)
192200

193-
SimpleStringDictionary *config_params_; // Create parameters (STRONG)
201+
LongStringDictionary *config_params_; // Create parameters (STRONG)
194202

195203
ConfigFile config_file_;
196204

@@ -306,7 +314,7 @@ static BOOL IsDebuggerActive() {
306314
// since they were allocated by ProtectedMemoryAllocator objects.
307315
//
308316
if (config_params_) {
309-
config_params_->~SimpleStringDictionary();
317+
config_params_->~LongStringDictionary();
310318
}
311319

312320
if (handler_)
@@ -374,10 +382,10 @@ static BOOL IsDebuggerActive() {
374382
}
375383

376384
config_params_ =
377-
new (gKeyValueAllocator->Allocate(sizeof(SimpleStringDictionary)) )
378-
SimpleStringDictionary();
385+
new (gKeyValueAllocator->Allocate(sizeof(LongStringDictionary)))
386+
LongStringDictionary();
379387

380-
SimpleStringDictionary &dictionary = *config_params_;
388+
LongStringDictionary &dictionary = *config_params_;
381389

382390
dictionary.SetKeyValue(BREAKPAD_SERVER_TYPE, [serverType UTF8String]);
383391
dictionary.SetKeyValue(BREAKPAD_PRODUCT_DISPLAY, [display UTF8String]);
@@ -420,8 +428,8 @@ static BOOL IsDebuggerActive() {
420428
if (!config_params_ || !key)
421429
return nil;
422430

423-
const char *value = config_params_->GetValueForKey([key UTF8String]);
424-
return value ? [NSString stringWithUTF8String:value] : nil;
431+
const std::string value = config_params_->GetValueForKey([key UTF8String]);
432+
return value.empty() ? nil : [NSString stringWithUTF8String:value.c_str()];
425433
}
426434

427435
//=============================================================================
@@ -495,8 +503,8 @@ static BOOL IsDebuggerActive() {
495503
NSDictionary *server_parameters) {
496504
NSMutableDictionary *config = [NSMutableDictionary dictionary];
497505

498-
SimpleStringDictionary::Iterator it(*config_params_);
499-
while (const SimpleStringDictionary::Entry *next = it.Next()) {
506+
LongStringDictionary::Iterator it(*config_params_);
507+
while (const LongStringDictionary::Entry *next = it.Next()) {
500508
[config setValue:[NSString stringWithUTF8String:next->value]
501509
forKey:[NSString stringWithUTF8String:next->key]];
502510
}
@@ -525,7 +533,7 @@ static BOOL IsDebuggerActive() {
525533
if (!success)
526534
return nil;
527535

528-
SimpleStringDictionary params = *config_params_;
536+
LongStringDictionary params = *config_params_;
529537
for (NSString *key in server_parameters) {
530538
params.SetKeyValue([key UTF8String],
531539
[[server_parameters objectForKey:key] UTF8String]);
@@ -560,7 +568,7 @@ static BOOL IsDebuggerActive() {
560568
void Breakpad::HandleUncaughtException(NSException *exception) {
561569
// Generate the minidump.
562570
google_breakpad::IosExceptionMinidumpGenerator generator(exception);
563-
const char *minidump_path =
571+
const std::string minidump_path =
564572
config_params_->GetValueForKey(BREAKPAD_DUMP_DIRECTORY);
565573
std::string minidump_id;
566574
std::string minidump_filename = generator.UniqueNameInDirectory(minidump_path,
@@ -573,7 +581,7 @@ static BOOL IsDebuggerActive() {
573581
// 2- If the application crash while trying to handle this exception, a usual
574582
// report will be generated. This report must not contain these special
575583
// keys.
576-
SimpleStringDictionary params = *config_params_;
584+
LongStringDictionary params = *config_params_;
577585
params.SetKeyValue(BREAKPAD_SERVER_PARAMETER_PREFIX "type", "exception");
578586
params.SetKeyValue(BREAKPAD_SERVER_PARAMETER_PREFIX "exceptionName",
579587
[[exception name] UTF8String]);
@@ -582,9 +590,9 @@ static BOOL IsDebuggerActive() {
582590

583591
// And finally write the config file.
584592
ConfigFile config_file;
585-
config_file.WriteFile(minidump_path,
593+
config_file.WriteFile(minidump_path.c_str(),
586594
&params,
587-
minidump_path,
595+
minidump_path.c_str(),
588596
minidump_id.c_str());
589597
}
590598

@@ -612,9 +620,9 @@ BreakpadRef BreakpadCreate(NSDictionary *parameters) {
612620

613621
gKeyValueAllocator =
614622
new (gMasterAllocator->Allocate(sizeof(ProtectedMemoryAllocator)))
615-
ProtectedMemoryAllocator(sizeof(SimpleStringDictionary));
623+
ProtectedMemoryAllocator(sizeof(LongStringDictionary));
616624

617-
// Create a mutex for use in accessing the SimpleStringDictionary
625+
// Create a mutex for use in accessing the LongStringDictionary
618626
int mutexResult = pthread_mutex_init(&gDictionaryMutex, NULL);
619627
if (mutexResult == 0) {
620628

vendor/google-breakpad/src/client/ios/Breakpad.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
1EEEB6101720821900F7E689 /* simple_string_dictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EEEB60D1720821900F7E689 /* simple_string_dictionary.h */; };
5858
AA747D9F0F9514B9006C5449 /* Breakpad_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* Breakpad_Prefix.pch */; };
5959
AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
60+
CF6D547D1F9E6FFE00E95174 /* long_string_dictionary.cc in Sources */ = {isa = PBXBuildFile; fileRef = CF6D547C1F9E6FFE00E95174 /* long_string_dictionary.cc */; };
61+
CF706DC11F7C6EFB002C54C7 /* long_string_dictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = CF706DC01F7C6EFB002C54C7 /* long_string_dictionary.h */; };
6062
/* End PBXBuildFile section */
6163

6264
/* Begin PBXFileReference section */
@@ -111,6 +113,8 @@
111113
1EEEB60D1720821900F7E689 /* simple_string_dictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = simple_string_dictionary.h; sourceTree = "<group>"; };
112114
AA747D9E0F9514B9006C5449 /* Breakpad_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Breakpad_Prefix.pch; sourceTree = SOURCE_ROOT; };
113115
AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
116+
CF6D547C1F9E6FFE00E95174 /* long_string_dictionary.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = long_string_dictionary.cc; sourceTree = "<group>"; };
117+
CF706DC01F7C6EFB002C54C7 /* long_string_dictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = long_string_dictionary.h; sourceTree = "<group>"; };
114118
D2AAC07E0554694100DB518D /* libBreakpad.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBreakpad.a; sourceTree = BUILT_PRODUCTS_DIR; };
115119
/* End PBXFileReference section */
116120

@@ -264,6 +268,8 @@
264268
16C7CC47147D4A4300776EAD /* common */ = {
265269
isa = PBXGroup;
266270
children = (
271+
CF706DC01F7C6EFB002C54C7 /* long_string_dictionary.h */,
272+
CF6D547C1F9E6FFE00E95174 /* long_string_dictionary.cc */,
267273
1EEEB60C1720821900F7E689 /* simple_string_dictionary.cc */,
268274
1EEEB60D1720821900F7E689 /* simple_string_dictionary.h */,
269275
16C7CC4A147D4A4300776EAD /* convert_UTF.c */,
@@ -339,6 +345,7 @@
339345
16C7CEA8147D4A4300776EAD /* string_conversion.h in Headers */,
340346
16BFA67014E195E9009704F8 /* ios_exception_minidump_generator.h in Headers */,
341347
16C92FAD150DF8330053D7BA /* BreakpadController.h in Headers */,
348+
CF706DC11F7C6EFB002C54C7 /* long_string_dictionary.h in Headers */,
342349
1EEEB6101720821900F7E689 /* simple_string_dictionary.h in Headers */,
343350
14569323182CE2C10029C465 /* mach_vm_compat.h in Headers */,
344351
);
@@ -416,6 +423,7 @@
416423
16C7CDFC147D4A4300776EAD /* minidump_generator.cc in Sources */,
417424
16C7CDFE147D4A4300776EAD /* protected_memory_allocator.cc in Sources */,
418425
16C7CE09147D4A4300776EAD /* uploader.mm in Sources */,
426+
CF6D547D1F9E6FFE00E95174 /* long_string_dictionary.cc in Sources */,
419427
16C7CE19147D4A4300776EAD /* minidump_file_writer.cc in Sources */,
420428
16C7CE40147D4A4300776EAD /* convert_UTF.c in Sources */,
421429
16C7CE79147D4A4300776EAD /* GTMLogger.m in Sources */,

vendor/google-breakpad/src/client/ios/BreakpadController.mm

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@ - (void)reportWillBeSent;
9393
@implementation BreakpadController
9494

9595
+ (BreakpadController*)sharedInstance {
96-
@synchronized(self) {
97-
static BreakpadController* sharedInstance_ =
98-
[[BreakpadController alloc] initSingleton];
99-
return sharedInstance_;
100-
}
96+
static dispatch_once_t onceToken;
97+
static BreakpadController* sharedInstance ;
98+
dispatch_once(&onceToken, ^{
99+
sharedInstance = [[BreakpadController alloc] initSingleton];
100+
});
101+
return sharedInstance;
101102
}
102103

103104
- (id)init {
@@ -179,10 +180,9 @@ - (void)setUploadingEnabled:(BOOL)enabled {
179180
enableUploads_ = YES;
180181
[self sendStoredCrashReports];
181182
} else {
183+
// disable the enableUpload_ flag.
184+
// sendDelay checks this flag and disables the upload of logs by sendStoredCrashReports
182185
enableUploads_ = NO;
183-
[NSObject cancelPreviousPerformRequestsWithTarget:self
184-
selector:@selector(sendStoredCrashReports)
185-
object:nil];
186186
}
187187
});
188188
}
@@ -249,10 +249,8 @@ - (void)removeUploadParameterForKey:(NSString*)key {
249249
}
250250

251251
- (void)withBreakpadRef:(void(^)(BreakpadRef))callback {
252-
NSAssert(started_,
253-
@"The controller must be started before withBreakpadRef is called");
254252
dispatch_async(queue_, ^{
255-
callback(breakpadRef_);
253+
callback(started_ ? breakpadRef_ : NULL);
256254
});
257255
}
258256

@@ -317,38 +315,35 @@ - (void)reportWillBeSent {
317315
[userDefaults synchronize];
318316
}
319317

318+
// This method must be called from the breakpad queue.
320319
- (void)sendStoredCrashReports {
321-
dispatch_async(queue_, ^{
322-
if (BreakpadGetCrashReportCount(breakpadRef_) == 0)
323-
return;
320+
if (BreakpadGetCrashReportCount(breakpadRef_) == 0)
321+
return;
324322

325-
int timeToWait = [self sendDelay];
323+
int timeToWait = [self sendDelay];
326324

327-
// Unable to ever send report.
328-
if (timeToWait == -1)
329-
return;
325+
// Unable to ever send report.
326+
if (timeToWait == -1)
327+
return;
330328

331-
// A report can be sent now.
332-
if (timeToWait == 0) {
333-
[self reportWillBeSent];
334-
BreakpadUploadNextReportWithParameters(breakpadRef_,
335-
uploadTimeParameters_);
329+
// A report can be sent now.
330+
if (timeToWait == 0) {
331+
[self reportWillBeSent];
332+
BreakpadUploadNextReportWithParameters(breakpadRef_,
333+
uploadTimeParameters_);
336334

337-
// If more reports must be sent, make sure this method is called again.
338-
if (BreakpadGetCrashReportCount(breakpadRef_) > 0)
339-
timeToWait = uploadIntervalInSeconds_;
340-
}
335+
// If more reports must be sent, make sure this method is called again.
336+
if (BreakpadGetCrashReportCount(breakpadRef_) > 0)
337+
timeToWait = uploadIntervalInSeconds_;
338+
}
341339

342-
// A report must be sent later.
343-
if (timeToWait > 0) {
344-
// performSelector: doesn't work on queue_
345-
dispatch_async(dispatch_get_main_queue(), ^{
346-
[self performSelector:@selector(sendStoredCrashReports)
347-
withObject:nil
348-
afterDelay:timeToWait];
349-
});
350-
}
351-
});
340+
// A report must be sent later.
341+
if (timeToWait > 0) {
342+
dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(timeToWait * NSEC_PER_SEC));
343+
dispatch_after(delay, queue_, ^{
344+
[self sendStoredCrashReports];
345+
});
346+
}
352347
}
353348

354349
@end

0 commit comments

Comments
 (0)