OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 | 426 |
427 CppEntriesProvider.prototype.parseVmSymbols = function( | 427 CppEntriesProvider.prototype.parseVmSymbols = function( |
428 libName, libStart, libEnd, processorFunc) { | 428 libName, libStart, libEnd, processorFunc) { |
429 this.loadSymbols(libName); | 429 this.loadSymbols(libName); |
430 | 430 |
431 var prevEntry; | 431 var prevEntry; |
432 | 432 |
433 function addPrevEntry(end) { | 433 function addPrevEntry(end) { |
434 // Several functions can be mapped onto the same address. To avoid | 434 // Several functions can be mapped onto the same address. To avoid |
435 // creating zero-sized entries, skip such duplicates. | 435 // creating zero-sized entries, skip such duplicates. |
436 if (prevEntry && prevEntry.start != end) { | 436 if (prevEntry && prevEntry.start < end) { |
437 processorFunc(prevEntry.name, prevEntry.start, end); | 437 processorFunc(prevEntry.name, prevEntry.start, end); |
438 } | 438 } |
439 } | 439 } |
440 | 440 |
441 while (true) { | 441 while (true) { |
442 var funcInfo = this.parseNextLine(); | 442 var funcInfo = this.parseNextLine(); |
443 if (funcInfo === null) { | 443 if (funcInfo === null) { |
444 continue; | 444 continue; |
445 } else if (funcInfo === false) { | 445 } else if (funcInfo === false) { |
446 break; | 446 break; |
(...skipping 24 matching lines...) Expand all Loading... |
471 }; | 471 }; |
472 | 472 |
473 | 473 |
474 function UnixCppEntriesProvider() { | 474 function UnixCppEntriesProvider() { |
475 this.symbols = []; | 475 this.symbols = []; |
476 this.parsePos = 0; | 476 this.parsePos = 0; |
477 }; | 477 }; |
478 inherits(UnixCppEntriesProvider, CppEntriesProvider); | 478 inherits(UnixCppEntriesProvider, CppEntriesProvider); |
479 | 479 |
480 | 480 |
481 UnixCppEntriesProvider.FUNC_RE = /^([0-9a-fA-F]{8}) . (.*)$/; | 481 UnixCppEntriesProvider.FUNC_RE = /^([0-9a-fA-F]{8}) [tT] (.*)$/; |
482 | 482 |
483 | 483 |
484 UnixCppEntriesProvider.prototype.loadSymbols = function(libName) { | 484 UnixCppEntriesProvider.prototype.loadSymbols = function(libName) { |
485 this.parsePos = 0; | 485 this.parsePos = 0; |
486 try { | 486 try { |
487 this.symbols = [ | 487 this.symbols = [ |
488 os.system('nm', ['-C', '-n', libName], -1, -1), | 488 os.system('nm', ['-C', '-n', libName], -1, -1), |
489 os.system('nm', ['-C', '-n', '-D', libName], -1, -1) | 489 os.system('nm', ['-C', '-n', '-D', libName], -1, -1) |
490 ]; | 490 ]; |
491 } catch (e) { | 491 } catch (e) { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 | 653 |
654 var params = processArguments(arguments); | 654 var params = processArguments(arguments); |
655 var tickProcessor = new TickProcessor( | 655 var tickProcessor = new TickProcessor( |
656 params.platform == 'unix' ? new UnixCppEntriesProvider() : | 656 params.platform == 'unix' ? new UnixCppEntriesProvider() : |
657 new WindowsCppEntriesProvider(), | 657 new WindowsCppEntriesProvider(), |
658 params.separateIc, | 658 params.separateIc, |
659 params.ignoreUnknown, | 659 params.ignoreUnknown, |
660 params.stateFilter); | 660 params.stateFilter); |
661 tickProcessor.processLogFile(params.logFileName); | 661 tickProcessor.processLogFile(params.logFileName); |
662 tickProcessor.printStatistics(); | 662 tickProcessor.printStatistics(); |
OLD | NEW |