Skip to content

Commit d39d90f

Browse files
authored
Merge pull request #20 from electron/upgrade-breakpad
Upgrade breakpad
2 parents 2ed0e2c + 2c4b62c commit d39d90f

File tree

8 files changed

+35
-6
lines changed

8 files changed

+35
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/node_modules
22
/build
33
*.swp
4+
npm-debug.log

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.gitmodules
22
.npmignore
33
.travis.yml
4+
npm-debug.log
45
test

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ node_js:
55

66
os:
77
- osx
8+
- linux
89

910
notifications:
1011
email:

binding.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}, {
99
'dependencies': [
1010
'deps/breakpad/breakpad.gyp:minidump_stackwalk',
11-
'deps/breakpad/breakpad.gyp:dump_syms',
11+
'deps/breakpad/breakpad.gyp:dump_syms#host',
1212
],
1313
}],
1414
],

common.gypi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
'variables': {
33
'chromeos%': 0,
44
'os_bsd%': 0,
5+
'mac_deployment_target%': '10.9',
56
},
67
'target_defaults': {
78
'conditions': [
@@ -11,6 +12,8 @@
1112
['OS=="mac"', {
1213
'xcode_settings': {
1314
'OTHER_CFLAGS': ['-w'],
15+
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
16+
'CLANG_CXX_LIBRARY': 'libc++',
1417
}
1518
}]
1619
]

test/fixtures/linux.dmp

223 KB
Binary file not shown.

test/minidump-test.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var extractZip = require('extract-zip')
77
var temp = require('temp').track()
88

99
describe('minidump', function () {
10-
this.timeout(60000)
10+
this.timeout(3 * 60 * 1000)
1111

1212
describe('walkStack()', function () {
1313
describe('macOS dump', function () {
@@ -49,11 +49,29 @@ describe('minidump', function () {
4949
})
5050
})
5151
})
52+
53+
describe('Linux dump', function () {
54+
it('calls back with a report', function (done) {
55+
downloadElectronSymbols('linux', function (error, symbolsPath) {
56+
if (error) return done(error)
57+
58+
var dumpPath = path.join(__dirname, 'fixtures', 'linux.dmp')
59+
minidump.walkStack(dumpPath, symbolsPath, function (error, report) {
60+
if (error) return done(error)
61+
62+
report = report.toString()
63+
assert.notEqual(report.length, 0)
64+
assert.notEqual(report.indexOf('electron!Crash [atom_bindings.cc : 27 + 0x0]'), -1)
65+
done()
66+
})
67+
})
68+
})
69+
})
5270
})
5371

5472
describe('dumpSymbol()', function () {
5573
it('calls back with a minidump', function (done) {
56-
if (process.platform !== 'darwin') return this.skip()
74+
if (process.platform === 'win32') return this.skip()
5775

5876
downloadElectron(function (error, binaryPath) {
5977
if (error) return done(error)
@@ -73,15 +91,20 @@ var downloadElectron = function (callback) {
7391
electronDownload({
7492
version: '1.4.3',
7593
arch: 'x64',
76-
platform: 'darwin',
94+
platform: process.platform,
7795
quiet: true
7896
}, function (error, zipPath) {
7997
if (error) return callback(error)
8098

8199
var electronPath = temp.mkdirSync('node-minidump-')
82100
extractZip(zipPath, {dir: electronPath}, function (error) {
83101
if (error) return callback(error)
84-
callback(null, path.join(electronPath, 'Electron.app', 'Contents', 'MacOS', 'Electron'))
102+
103+
if (process.platform === 'darwin') {
104+
callback(null, path.join(electronPath, 'Electron.app', 'Contents', 'MacOS', 'Electron'))
105+
} else {
106+
callback(null, path.join(electronPath, 'electron'))
107+
}
85108
})
86109
})
87110
}

0 commit comments

Comments
 (0)