Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: tools/tickprocessor.js

Issue 132021: Two requested changes to tick processor. (Closed)
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/linux-tick-processor ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/tickprocessor.js
diff --git a/tools/tickprocessor.js b/tools/tickprocessor.js
index 72d367f1990aab42b80b46435b3e446f8bddd5fd..ed6b34b9faa0faf0d1ce8a7e9453ce29076285c0 100644
--- a/tools/tickprocessor.js
+++ b/tools/tickprocessor.js
@@ -410,9 +410,10 @@ CppEntriesProvider.prototype.parseNextLine = function() {
};
-function UnixCppEntriesProvider() {
+function UnixCppEntriesProvider(nmExec) {
this.symbols = [];
this.parsePos = 0;
+ this.nmExec = nmExec;
};
inherits(UnixCppEntriesProvider, CppEntriesProvider);
@@ -424,8 +425,8 @@ UnixCppEntriesProvider.prototype.loadSymbols = function(libName) {
this.parsePos = 0;
try {
this.symbols = [
- os.system('nm', ['-C', '-n', libName], -1, -1),
- os.system('nm', ['-C', '-n', '-D', libName], -1, -1)
+ os.system(this.nmExec, ['-C', '-n', libName], -1, -1),
+ os.system(this.nmExec, ['-C', '-n', '-D', libName], -1, -1)
];
} catch (e) {
// If the library cannot be found on this system let's not panic.
@@ -523,7 +524,8 @@ function processArguments(args) {
platform: 'unix',
stateFilter: null,
ignoreUnknown: false,
- separateIc: false
+ separateIc: false,
+ nm: 'nm'
};
var argsDispatch = {
'-j': ['stateFilter', TickProcessor.VmStates.JS,
@@ -543,7 +545,9 @@ function processArguments(args) {
'--unix': ['platform', 'unix',
'Specify that we are running on *nix platform'],
'--windows': ['platform', 'windows',
- 'Specify that we are running on Windows platform']
+ 'Specify that we are running on Windows platform'],
+ '--nm': ['nm', 'nm',
+ 'Specify the \'nm\' executable to use (e.g. --nm=/my_dir/nm)']
};
argsDispatch['--js'] = argsDispatch['-j'];
argsDispatch['--gc'] = argsDispatch['-g'];
@@ -575,9 +579,15 @@ function processArguments(args) {
break;
}
args.shift();
+ var userValue = null;
+ var eqPos = arg.indexOf('=');
+ if (eqPos != -1) {
+ userValue = arg.substr(eqPos + 1);
+ arg = arg.substr(0, eqPos);
+ }
if (arg in argsDispatch) {
var dispatch = argsDispatch[arg];
- result[dispatch[0]] = dispatch[1];
+ result[dispatch[0]] = userValue == null ? dispatch[1] : userValue;
} else {
printUsageAndExit();
}
@@ -592,7 +602,7 @@ function processArguments(args) {
var params = processArguments(arguments);
var tickProcessor = new TickProcessor(
- params.platform == 'unix' ? new UnixCppEntriesProvider() :
+ params.platform == 'unix' ? new UnixCppEntriesProvider(params.nm) :
new WindowsCppEntriesProvider(),
params.separateIc,
params.ignoreUnknown,
« no previous file with comments | « tools/linux-tick-processor ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698