Don't panic if tickprocessor can't find a shared library.
authorerik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 16 Jun 2009 13:44:48 +0000 (13:44 +0000)
committererik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 16 Jun 2009 13:44:48 +0000 (13:44 +0000)
Don't swallow exceptions so we can't see where they are really
thrown.
Review URL: http://codereview.chromium.org/126200

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2192 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

tools/tickprocessor.js

index cce579b..dfe60ae 100644 (file)
@@ -157,18 +157,13 @@ TickProcessor.prototype.processLogFile = function(fileName) {
 
 TickProcessor.prototype.processLog = function(lines) {
   var csvParser = new devtools.profiler.CsvParser();
-  try {
-    for (var i = 0, n = lines.length; i < n; ++i) {
-      var line = lines[i];
-      if (!line) {
-        continue;
-      }
-      var fields = csvParser.parseLine(line);
-      this.dispatchLogRow(fields);
+  for (var i = 0, n = lines.length; i < n; ++i) {
+    var line = lines[i];
+    if (!line) {
+      continue;
     }
-  } catch (e) {
-    print('line ' + (i + 1) + ': ' + (e.message || e));
-    throw e;
+    var fields = csvParser.parseLine(line);
+    this.dispatchLogRow(fields);
   }
 };
 
@@ -487,11 +482,16 @@ UnixCppEntriesProvider.FUNC_RE = /^([0-9a-fA-F]{8}) . (.*)$/;
 
 
 UnixCppEntriesProvider.prototype.loadSymbols = function(libName) {
-  this.symbols = [
-    os.system('nm', ['-C', '-n', libName], -1, -1),
-    os.system('nm', ['-C', '-n', '-D', libName], -1, -1)
-  ];
   this.parsePos = 0;
+  try {
+    this.symbols = [
+      os.system('nm', ['-C', '-n', libName], -1, -1),
+      os.system('nm', ['-C', '-n', '-D', libName], -1, -1)
+    ];
+  } catch (e) {
+    // If the library cannot be found on this system let's not panic.
+    this.symbols = [ '', '' ];
+  }
 };