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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 | 601 |
602 CppEntriesProvider.prototype.loadSymbols = function(libName) { | 602 CppEntriesProvider.prototype.loadSymbols = function(libName) { |
603 }; | 603 }; |
604 | 604 |
605 | 605 |
606 CppEntriesProvider.prototype.parseNextLine = function() { | 606 CppEntriesProvider.prototype.parseNextLine = function() { |
607 return false; | 607 return false; |
608 }; | 608 }; |
609 | 609 |
610 | 610 |
611 function UnixCppEntriesProvider(nmExec) { | 611 function UnixCppEntriesProvider(nmExec, targetRootFS) { |
612 this.symbols = []; | 612 this.symbols = []; |
613 this.parsePos = 0; | 613 this.parsePos = 0; |
614 this.nmExec = nmExec; | 614 this.nmExec = nmExec; |
| 615 this.targetRootFS = targetRootFS; |
615 this.FUNC_RE = /^([0-9a-fA-F]{8,16}) ([0-9a-fA-F]{8,16} )?[tTwW] (.*)$/; | 616 this.FUNC_RE = /^([0-9a-fA-F]{8,16}) ([0-9a-fA-F]{8,16} )?[tTwW] (.*)$/; |
616 }; | 617 }; |
617 inherits(UnixCppEntriesProvider, CppEntriesProvider); | 618 inherits(UnixCppEntriesProvider, CppEntriesProvider); |
618 | 619 |
619 | 620 |
620 UnixCppEntriesProvider.prototype.loadSymbols = function(libName) { | 621 UnixCppEntriesProvider.prototype.loadSymbols = function(libName) { |
621 this.parsePos = 0; | 622 this.parsePos = 0; |
| 623 libName = this.targetRootFS + libName; |
622 try { | 624 try { |
623 this.symbols = [ | 625 this.symbols = [ |
624 os.system(this.nmExec, ['-C', '-n', '-S', libName], -1, -1), | 626 os.system(this.nmExec, ['-C', '-n', '-S', libName], -1, -1), |
625 os.system(this.nmExec, ['-C', '-n', '-S', '-D', libName], -1, -1) | 627 os.system(this.nmExec, ['-C', '-n', '-S', '-D', libName], -1, -1) |
626 ]; | 628 ]; |
627 } catch (e) { | 629 } catch (e) { |
628 // If the library cannot be found on this system let's not panic. | 630 // If the library cannot be found on this system let's not panic. |
629 this.symbols = ['', '']; | 631 this.symbols = ['', '']; |
630 } | 632 } |
631 }; | 633 }; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 '--separate-ic': ['separateIc', true, | 780 '--separate-ic': ['separateIc', true, |
779 'Separate IC entries'], | 781 'Separate IC entries'], |
780 '--unix': ['platform', 'unix', | 782 '--unix': ['platform', 'unix', |
781 'Specify that we are running on *nix platform'], | 783 'Specify that we are running on *nix platform'], |
782 '--windows': ['platform', 'windows', | 784 '--windows': ['platform', 'windows', |
783 'Specify that we are running on Windows platform'], | 785 'Specify that we are running on Windows platform'], |
784 '--mac': ['platform', 'mac', | 786 '--mac': ['platform', 'mac', |
785 'Specify that we are running on Mac OS X platform'], | 787 'Specify that we are running on Mac OS X platform'], |
786 '--nm': ['nm', 'nm', | 788 '--nm': ['nm', 'nm', |
787 'Specify the \'nm\' executable to use (e.g. --nm=/my_dir/nm)'], | 789 'Specify the \'nm\' executable to use (e.g. --nm=/my_dir/nm)'], |
| 790 '--target': ['targetRootFS', '', |
| 791 'Specify the target root directory for cross environment'], |
788 '--snapshot-log': ['snapshotLogFileName', 'snapshot.log', | 792 '--snapshot-log': ['snapshotLogFileName', 'snapshot.log', |
789 'Specify snapshot log file to use (e.g. --snapshot-log=snapshot.log)'] | 793 'Specify snapshot log file to use (e.g. --snapshot-log=snapshot.log)'] |
790 }; | 794 }; |
791 this.argsDispatch_['--js'] = this.argsDispatch_['-j']; | 795 this.argsDispatch_['--js'] = this.argsDispatch_['-j']; |
792 this.argsDispatch_['--gc'] = this.argsDispatch_['-g']; | 796 this.argsDispatch_['--gc'] = this.argsDispatch_['-g']; |
793 this.argsDispatch_['--compiler'] = this.argsDispatch_['-c']; | 797 this.argsDispatch_['--compiler'] = this.argsDispatch_['-c']; |
794 this.argsDispatch_['--other'] = this.argsDispatch_['-o']; | 798 this.argsDispatch_['--other'] = this.argsDispatch_['-o']; |
795 this.argsDispatch_['--external'] = this.argsDispatch_['-e']; | 799 this.argsDispatch_['--external'] = this.argsDispatch_['-e']; |
796 }; | 800 }; |
797 | 801 |
798 | 802 |
799 ArgumentsProcessor.DEFAULTS = { | 803 ArgumentsProcessor.DEFAULTS = { |
800 logFileName: 'v8.log', | 804 logFileName: 'v8.log', |
801 snapshotLogFileName: null, | 805 snapshotLogFileName: null, |
802 platform: 'unix', | 806 platform: 'unix', |
803 stateFilter: null, | 807 stateFilter: null, |
804 callGraphSize: 5, | 808 callGraphSize: 5, |
805 ignoreUnknown: false, | 809 ignoreUnknown: false, |
806 separateIc: false, | 810 separateIc: false, |
| 811 targetRootFS: '', |
807 nm: 'nm' | 812 nm: 'nm' |
808 }; | 813 }; |
809 | 814 |
810 | 815 |
811 ArgumentsProcessor.prototype.parse = function() { | 816 ArgumentsProcessor.prototype.parse = function() { |
812 while (this.args_.length) { | 817 while (this.args_.length) { |
813 var arg = this.args_[0]; | 818 var arg = this.args_[0]; |
814 if (arg.charAt(0) != '-') { | 819 if (arg.charAt(0) != '-') { |
815 break; | 820 break; |
816 } | 821 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) { | 867 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) { |
863 synonims.push(synArg); | 868 synonims.push(synArg); |
864 delete this.argsDispatch_[synArg]; | 869 delete this.argsDispatch_[synArg]; |
865 } | 870 } |
866 } | 871 } |
867 print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]); | 872 print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]); |
868 } | 873 } |
869 quit(2); | 874 quit(2); |
870 }; | 875 }; |
871 | 876 |
OLD | NEW |