我在Node.js应用程序中使用bluebird协同例程。
当我在代码中设置断点时,调试代码非常困难 因为调试器不会停止(更准确地停止1秒) 在断点处并立即抛出一个巨大的堆栈跟踪错误,这实际上没有帮助。
我正在使用mac OSX 10.11.6
Node v6.0.0
webstorm 2016.2.2
有人遇到过同样的问题吗?
错误说:
Process finished with exit code 132 SIGILL
调试时抛出异常的示例:
// stack-allocated locals
var arguments = 0x298a35180cd9 <an Arguments with map 0xd8d3750a509>#52#
var target = 0x31e5ff8c7411 <JS Function next (SharedFunctionInfo 0x31e5ff867f09)>#53#
// expression stack (top to bottom)
[05] : 0x31e5ff804189 <undefined>
[04] : 0x298a3517ee71 <JS Generator>#8#
[03] : 0x31e5ff8ba189 <JS Function apply (SharedFunctionInfo 0x31e5ff881af1)>#54#
[02] : 0x22420b724f59 <FixedArray[48]>#55#
--------- s o u r c e c o d e ---------
function tryCatcher() {\x0a try {\x0a var target = tryCatchTarget;\x0a tryCatchTarget = null;\x0a return target.apply(this, arguments);\x0a } catch (e) {\x0a errorObj.e = e;\x0a return errorObj;\x0a }\x0a}
-----------------------------------------
}
[16]: arguments adaptor frame: 1->0 {
// actual arguments
[00] : 0x31e5ff804189 <undefined> // not passed to callee
}
[17]: _promiseFulfilled [/Users/XXXXXXXXX/node_modules/bluebird/js/release/generators.js:97] [pc=0x8679b27641] (this=0x298a3517ef21 <a PromiseSpawn with map 0x115102551369>#9#,value=0x31e5ff804189 <undefined>) {
// stack-allocated locals
var result = 0x31e5ff804189 <undefined>
// expression stack (top to bottom)
[03] : 0x31e5ff804189 <undefined>
[02] : 0x298a3517ee71 <JS Generator>#8#
[01] : 0x31e5ff8ba219 <JS Function call (SharedFunctionInfo 0x31e5ff881cd1)>#56#
--------- s o u r c e c o d e ---------
function (value) {\x0a this._yieldedPromise = null;\x0a this._promise._pushContext();\x0a var result = tryCatch(this._generator.next).call(this._generator, value);\x0a this._promise._popContext();\x0a this._continue(result);\x0a}
-----------------------------------------
}
[18]: /* anonymous */(aka /* anonymous */) [/Users/xxxxx/node_modules/bluebird/js/release/generators.js:201] [pc=0x8679b253e0] (this=0x31e5ff804189 <undefined>) {
// stack-allocated locals
var arguments = 0x298a3517edb1 <an Arguments with map 0xd8d3750a509>#57#
var generator = 0x298a3517ee71 <JS Generator>#8#
var spawn = 0x298a3517ef21 <a PromiseSpawn with map 0x115102551369>#9#
var ret = 0x298a3517f041 <a Promise with map 0x21ef8a9d919>#58#
// expression stack (top to bottom)
[06] : 0x31e5ff804189 <undefined>
[05] : 0x298a3517ef21 <a PromiseSpawn with map 0x115102551369>#9#
[04] : 0x3efd362e231 <JS Function PromiseSpawn._promiseFulfilled (SharedFunctionInfo 0x3efd362d579)>#59#
--------- s o u r c e c o d e ---------
function () {\x0a var generator = generatorFunction.apply(this, arguments);\x0a var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,\x0a stack);\x0a var ret = spawn.promise();\x0a spawn._generator = generator;\x0a spawn._promiseFulfilled(unde...
-----------------------------------------
}
[19]: getData [/Users/xxxxx.js:113] [pc=0x86797f7f39] (this=0x298a3500c8d1 <an Object with map 0x1151025fece9>#10#,segmentId=0x298a350cbe39 <String[1]: 1>) {
// heap-allocated locals
var segmentId = 0x298a350cbe39 <String[1]: 1>
// expression stack (top to bottom)
[02] : 0x31e5ff804189 <undefined>
[01] : 0x298a3517ed59 <JS Function (SharedFunctionInfo 0x2b5de62a3bb9)>#60#
[00] : 0x2cd86ebd7861 <JS Function getData (SharedFunctionInfo 0x1e90f7205ba1)>#61#
--------- s o u r c e c o d e ---------
function getData(segmentId) {\x0a chartsService.init();\x0a\x0a return co(function * hdlr() {\x0a const modelData = {};\x0a console.log('getData segmentId:' + segmentId.toString());\x0a const getChartResult = yield chartsService.getBySegmentId(segmentId);\x0a //console.log('after getData segmentId:' + segmentI...
-----------------------------------------
}
[20]: arguments adaptor frame: 2->1 {
// actual arguments
[00] : 0x298a350cbe39 <String[1]: 1>
[01] : 0x298a350ce801 <an Object with map 0x115102551999>#62# // not passed to callee
}
[21]: hdlr(aka hdlr) [/xxxxcontroller.js:45] [pc=0x8679b25b85] (this=0x31e5ff804189 <undefined>) {
// heap-allocated locals
var this = 0x31e5ff804189 <undefined>
var .generator_object = 0x298a350ce091 <JS Generator>#11#
var variant = 0x31e5ff886891 <String[7]: default>
var service = 0x298a3500c8d1 <an Object with map 0x1151025fece9>#10#
var opts = 0x298a350ce801 <an Object with map 0x115102551999>#62#
var getResult = 0x31e5ff8041e9 <the hole>
var templateData = 0x31e5ff8041e9 <the hole>
var modelData = 0x31e5ff8041e9 <the hole>
var assetPaths = 0x31e5ff8041e9 <the hole>
var processedHtml = 0x31e5ff8041e9 <the hole>
var assetsResult = 0x31e5ff8041e9 <the hole>
var css = 0x31e5ff8041e9 <the hole>
var js = 0x31e5ff8041e9 <the hole>
// expression stack (top to bottom)
[04] : 0x298a350ce801 <an Object with map 0x115102551999>#62#
[03] : 0x298a350cbe39 <String[1]: 1>
[02] : 0x298a3500c8d1 <an Object with map 0x1151025fece9>#10#
[01] : 0x2cd86ebd7861 <JS Function getData (SharedFunctionInfo 0x1e90f7205ba1)>#61#
[00] : 0x298a350cdfd9 <FixedArray[18]>#63#
--------- s o u r c e c o d e ---------
function hdlr()