(line)
| 27 | rl.on('line', parseLine); |
| 28 | |
| 29 | function parseLine(line) { |
| 30 | try { |
| 31 | debug('Received line: ' + line); |
| 32 | |
| 33 | let parsed = parser.parseLine(line, {debug:true}); |
| 34 | console.log(outputLine(parsed)); |
| 35 | } catch(e) { |
| 36 | switch(true) { |
| 37 | case e instanceof errors.UnfinishedSyscallException: |
| 38 | debug('Encountered partial syscall, skipping: ' + line); |
| 39 | // suppress |
| 40 | return; |
| 41 | } |
| 42 | |
| 43 | debug('[PARSE ERROR] ' + e); |
| 44 | if(program.stopOnFail) { |
| 45 | console.error('[PARSE ERROR] ' + e); |
| 46 | debug('Exiting due to stopOnFail argument'); |
| 47 | process.exit(1); |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | // TODO: some kind of buffering solution to boost performance? |
| 53 | function outputLine(line) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…