Symbols and Installers are giving me a headache.

I’m not sure where things are going wrong right now so I am hoping that you – faithful readers – will be able to help me out. I have run the “make buildsymbols” and checked with srctool.exe to confirm that the pdb files are source indexed. So following that I made an installer to see if I could attach it in Visual Studio and pull some code. However I am not getting the symbols to load.

Here’s what I have:

  1. A modified symbolstore.py: http://pastebin.mozilla.org/255918
  2. Symbols and source indexed .pdb files here: http://avnerd.tv/symbols/test/crashreporter-symbols-firefox-3.0b2pre-WINNT-2007120422
  3. An installer for the build I was working on when I did this: http://avnerd.tv/sharedFiles/ff_SourceServer.exe.zip

When I point Visual Studio to the symbols I can’t get anything to load up. So this means that I am unable to test if the source indexed code’s cvs commands actually work.

There weren’t any gotchas the last time I uploaded symbols – so I’m not sure where to begin in figuring out why Visual Studio isn’t grabbing them properly.

I have to work all day tomorrow – and I have a big assignment still to work on for my BTS system design class, so anyone who can take a minute to poke at this and give me any feedback would be a hero!

Thanks!

3 main barriers to a complete 0.3 release of the source server

Here is the code I have so far in symbolstore.py
http://pastebin.mozilla.org/254868

My portion is specifically lines 36 – 71 where I am now gathering up a string of source files along with the revision number, and generating a (almost) properly formatted stream file in the pdb’s directory.

Here are the barriers:

1. I would prefer to have a template where I have a variable %SOURCEFILES% that can be replaced and output to a new file for each pdb, instead of writing out each line of the stream file in symbolstore.py. If I can’t get that happening for this release – oh well, Dave said it can be a bit ugly at the 0.3 stage. At least what I have right now, is creating the stream file properly.

2. On lines 38 and 39 – what I am making here is a string that looks like this: c:mozilla/xpcom/glue/nsTraceRefcnt.h and in fact, this has to be c:USERS_SOURCEFILE_DIRmozillaxpcomgluensTraceRecnt.h — so two things need to happen here, first, I need the / to be (except for the one after c:, cause it’s right already) and second, for now I can probably name the dir “ff” and the user can make sure that VStudio is pointing to that path (c:ff) when looking for source files…but in the long run? I don’t know yet.

3. This is along the same lines as the template issue. The reason I haven’t successfully implemented the template is because I don’t know where to put, or how to create a path to, the right folders when symbolstore.py is being called. Unfortunately, it is not as easy as I had hoped in that putting the template in the same folder as symbolstore.py would allow me to open it with its name only. So as well as not being able to open the template, I don’t know how I can call upon pdbstr from inside of symbolstore.py

That’s going to be the last part, the first two are a little more pressing.

Source Server home stretch…on the road to mere python coding

Huge changes since last night’s post.

I can insert a .stream file (see previous post for what a .stream file data block contains) into an unindexed .pdb file via pdbstr -w as long as it has certain variables.

I still need to test what the minimum info needed is, right now I just copied and pasted from one that works. I will slowly delete variables from it until it doesn’t work anymore.

Using cvs to pull a specific revision of a file looks like this: cvs export -r 1.23 filename

So – in my test.pdb.stream file I changed the CVS_EXTRACT_CMD to :

CVS_EXTRACT_CMD=%fnchdir%(%CVS_WORKINGDIR%)cvs.exe -d %fnvar%(%var2%) export -r %var4% -d %cvsdatetarg% %var3%

(p.s. %var#% are based on * delimited text in the source files section)

In the source files, i add a source file that contains cvs in the symbol file
like so:

SRCSRV: source files —————————————
c:ffmozillaaccessiblepublicmsaaAccessibleMarshal.def*MYSERVER*mozilla/accessible/public/msaa/AccessibleMarshal.def*1.3

Then, when I write that to the accessiblemarshal.pdb file followed by a call to srctool -f on that .pdb file, I am greeted with a source indexed file that contains the cvs command that the source server will use to extract the source code when the time comes.

The result looks like this:

[c:ffmozillaaccessiblepublicmsaaAccessibleMarshal.def] cmd: cvs.exe -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot export -r 1.3 -d 12-01-07 mozilla/accessible/public/msaa/AccessibleMarshal.def

c:ffmozillaobjdir_debugInfodistcrashreporter-symbols2007120119accessiblemarshal.pdb8EEE4D7316254E22AE3D99EB4082744C3accessiblemarshal.pdb: 1 source files are indexed – 199 are not

So now I need to learn how best to add this into the symbolstore.py file.

My first instinct is to add something in the ProcessFile function that keeps track of all the files that start with cvs, they look like this:

FILE 2 cvs:cvs-mirror.mozilla.org/cvsroot:mozilla/accessible/public/msaa/AccessibleMarshal.def:1.3
FILE 3 c:/program files/microsoft visual studio 8/vc/platformsdk/include/RpcNsi.h

I already did a little playing around with the python script and was able to insert some code here where I wrote if filename.startswith(“cvs”) then some debug statement to see that I could in fact catch the right lines (which I did).

So let’s break it down:

  1. I need to track all lines that start with “cvs” and then turn these into proper file paths
  2. I need a (minimal) template .pdb.stream file that I can write the source file paths to in source files section
  3. Then I will call pdbstr -w and write that .pdb.stream (each named for the pdb it will write to) to the appropriate pdb file

The final hurdle – learn to write good python code to make this all happen.