bug 520141 - fix source server support to work with pdb compression. r=bsmedberg
authorTed Mielczarek <ted.mielczarek@gmail.com>
Sat, 03 Oct 2009 14:52:37 -0400
changeset 33430 96b2fb480110cce00cf98d0c27acf60fad901869
parent 33429 bb94e11d66a3ee82ecd6b185757342da364a4ebc
child 33431 b44dd220dc15d8f31d4aa7d0e1fda2996d26b06b
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs520141
milestone1.9.3a1pre
bug 520141 - fix source server support to work with pdb compression. r=bsmedberg
toolkit/crashreporter/tools/symbolstore.py
--- a/toolkit/crashreporter/tools/symbolstore.py
+++ b/toolkit/crashreporter/tools/symbolstore.py
@@ -541,21 +541,21 @@ class Dumper:
                             f.write(line)
                             # we want to return true only if at least one line is not a MODULE or FILE line
                             result = True
                     f.close()
                     cmd.close()
                     # we output relative paths so callers can get a list of what
                     # was generated
                     print rel_path
+                    if self.srcsrv and vcs_root:
+                        # add source server indexing to the pdb file
+                        self.SourceServerIndexing(file, guid, sourceFileStream, vcs_root)
                     if self.copy_debug:
                         self.CopyDebug(file, debug_file, guid)
-                    if self.srcsrv and vcs_root:
-                        # Call on SourceServerIndexing
-                        self.SourceServerIndexing(debug_file, guid, sourceFileStream, vcs_root)
             except StopIteration:
                 pass
             except:
                 print >> sys.stderr, "Unexpected error: ", sys.exc_info()[0]
                 raise
         return result
 
 # Platform-specific subclasses.  For the most part, these just have
@@ -611,30 +611,27 @@ class Dumper_Win32(Dumper):
         if success == 0 and os.path.exists(compressed_file):
             os.unlink(full_path)
             print os.path.splitext(rel_path)[0] + ".pd_"
         else:
             print rel_path
         
     def SourceServerIndexing(self, debug_file, guid, sourceFileStream, vcs_root):
         # Creates a .pdb.stream file in the mozilla\objdir to be used for source indexing
-        cwd = os.getcwd()
+        debug_file = os.path.abspath(debug_file)
         streamFilename = debug_file + ".stream"
-        stream_output_path = os.path.join(cwd, streamFilename)
+        stream_output_path = os.path.abspath(streamFilename)
         # Call SourceIndex to create the .stream file
         result = SourceIndex(sourceFileStream, stream_output_path, vcs_root)
-        
         if self.copy_debug:
             pdbstr_path = os.environ.get("PDBSTR_PATH")
             pdbstr = os.path.normpath(pdbstr_path)
-            pdb_rel_path = os.path.join(debug_file, guid, debug_file)
-            pdb_filename = os.path.normpath(os.path.join(self.symbol_path, pdb_rel_path))
-            # move to the dir with the stream files to call pdbstr
-            os.chdir(os.path.dirname(stream_output_path))
-            os.spawnv(os.P_WAIT, pdbstr, [pdbstr, "-w", "-p:" + pdb_filename, "-i:" + streamFilename, "-s:srcsrv"])
+            call([pdbstr, "-w", "-p:" + os.path.basename(debug_file),
+                  "-i:" + os.path.basename(streamFilename), "-s:srcsrv"],
+                 cwd=os.path.dirname(stream_output_path))
             # clean up all the .stream files when done
             os.remove(stream_output_path)
         return result
 
 class Dumper_Linux(Dumper):
     def ShouldProcess(self, file):
         """This function will allow processing of files that are
         executable, or end with the .so extension, and additionally