node.js - Bluebird coroutine() is difficult to debug in WebStorm -


i'm using bluebird co-routines in node.js application.

when i'm setting breakpoints in code, hard debug code since debugger doesn't stop (to more accurate stops 1 second) @ breakpoint , throws error huge stack trace doesn't help.

i'm using mac osx 10.11.6

node v6.0.0

webstorm 2016.2.2

did encountered same problem?

the error says:

process finished exit code 132 sigill 

example thrown exception when debugging:

// stack-allocated locals   var arguments = 0x298a35180cd9 <an arguments map 0xd8d3750a509>#52#   var target = 0x31e5ff8c7411 <js function next (sharedfunctioninfo 0x31e5ff867f09)>#53#   // expression stack (top 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 callee } [17]: _promisefulfilled [/users/xxxxxxxxx/node_modules/bluebird/js/release/generators.js:97] [pc=0x8679b27641] (this=0x298a3517ef21 <a promisespawn map 0x115102551369>#9#,value=0x31e5ff804189 <undefined>) {   // stack-allocated locals   var result = 0x31e5ff804189 <undefined>   // expression stack (top 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 map 0xd8d3750a509>#57#   var generator = 0x298a3517ee71 <js generator>#8#   var spawn = 0x298a3517ef21 <a promisespawn map 0x115102551369>#9#   var ret = 0x298a3517f041 <a promise map 0x21ef8a9d919>#58#   // expression stack (top bottom)   [06] : 0x31e5ff804189 <undefined>   [05] : 0x298a3517ef21 <a promisespawn 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 map 0x1151025fece9>#10#,segmentid=0x298a350cbe39 <string[1]: 1>) {   // heap-allocated locals   var segmentid = 0x298a350cbe39 <string[1]: 1>   // expression stack (top 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 map 0x115102551999>#62#  // not passed callee } [21]: hdlr(aka hdlr) [/xxxxcontroller.js:45] [pc=0x8679b25b85] (this=0x31e5ff804189 <undefined>) {   // heap-allocated locals   var = 0x31e5ff804189 <undefined>   var .generator_object = 0x298a350ce091 <js generator>#11#   var variant = 0x31e5ff886891 <string[7]: default>   var service = 0x298a3500c8d1 <an object map 0x1151025fece9>#10#   var opts = 0x298a350ce801 <an object 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 bottom)   [04] : 0x298a350ce801 <an object map 0x115102551999>#62#   [03] : 0x298a350cbe39 <string[1]: 1>   [02] : 0x298a3500c8d1 <an object 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() 


Comments