Friday, September 28, 2007

Setting up a Symbol Server Sandbox

After today's IRC chat with luser, I now have a list of things to do in order to acheive 0.1:

  • set up a localhost server

  • make buildsymbols from my own build

  • load those symbols onto the local server

  • connect them up to my debugger to make sure it all works

  • get the microsoft scripts to work adding source code to my local pdb files

  • so that the debugger can access the source code from being pointed to my server

Starting off, I set up IIS on my computer so that I can have a localhost webserver. This was a bit tricky with some unexpected authentication issues but I think that I have it working now. If I point my browser to http://localhost/symbolServer/ I have a directory of the pdb files that I created by calling make buildsymbols in my objdir.

The next move was to point my debugger (Visual Studio 2005) to the localhost symbol server. However, this is where I got stuck. I could load up the microsoft symbols but it would skip right over my firefox ones.

So I'm going back to square 1. I'm rebuilding with debug disabled because this may be a part of the issue. If this doesn't work I need to look into either a) symbol server directory structure because maybe I'm missing something about the hierarchy or b) perhaps my IIS set-up authentication issues are preventing VStudio from accessing the symbols.

Of course, in the back of my head I know it could also be c) something else entirely.

Back to the building.

Learning to debug - Part 1

So, I'm trying to hook up the Mozilla Symbol Server in order to better see how my attempts at knitting a source server to it will work.

First - I need to know what version of Firefox I should be doing this with. Currently I have 3 options: ff2, nightly build and my own build from yesterday's class. Talking with Dave on IRC, it seems like the nightly is the one to go with.

Now I need a sure-fire browser crashing bug. A few attempts at finding simple-seeming bugs in mxr is fruitless. I try a Gmail bug, the printer bug - no crash. Then bsmedberg provides me with this.

So, with my visual studio 2005 attached to the process that is Minefield, I install the toxic extension and restart Minefield - "Crash Bang Boom!" (i love this, btw). So now I can see some stuff in Visual Studio. What I'm looking at, I'm not exactly sure yet.

Then I did something and cleared out the results of the crash and now I can't get them back because Minefield crashes too fast for me to attach to process in VStudio. Bsmedberg gave me the following commands to try and get it back:
set env NO_EM_RESTART=1
devenv -debugexe firefox.exe -P test

I'm fiddling with this as we speak.

Stay tuned for part 2 where I hopefully will start to see the use of symbols.

Monday, September 24, 2007

Heading to 0.1

Today has been a blow-out day of looking at other people's code. First in class we explored mxr and tried to follow simple browser functions back to their origins. In looking up where the code for the "Clear Private Data" option was, I discovered that I can choose between being asked to confirm before clearing or not. I personally will choose not because I hate the additional click of confirming.

Following the one hour bike ride home and the dog walk to and from the library I sat down to read Chapter 11 of Diomidis Spinellis, Code Reading: The Open Source Perspective
. I liked the simplicity of his example. While I followed his trajectory through adapting a large source code base I picked up on some great ways to avoid trying to master the entire source and instead poke away at what you want to accomplish.

So I need to apply this to what a 0.1 release of my project will look like.

I looked briefly at the source code for the symbol server. There are several references to code on my project page.

Two things that are missing for me:
1. Seeing a debug in action so that I can get a visual reference for how the symbols work with the debugger.
2. Learning how to add to the existing code so that I can test whether my changes will work.

I'm going to continue looking at resources that cover how to debug in windows and see if I can make some headway. If anyone is interested in giving me a demo of how they debug in windows using the symbol server, I would appreciate that.

Sunday, September 23, 2007

Running 2 versions of Firefox

In IRC chat the other day I asked how often Ted (aka luser) did builds and he said not that often - pointing me instead to the nightly builds saying that he used these instead since they were updated automatically every day.

So I downloaded one and installed it.

Now, my favourite extension is the foxmarks synchronizer app because I find myself travelling between my desktop Mac at home and my PC laptop, as well I will often work at jobs where there's a need for a third foxmarks setup.

This extension doesn't work for 3.0 yet - so I've currently been opening the command window and opening each version with the -Profilemanager so that I can use my default profile for 2.0 (with foxmarks) and my "nightlyBuilds" profile for exploring 3.0

Now I read in a post that I can just manually change the version. Sounds great, but I don't know if I want to go through this everytime there's a new nightly version number.

Anyone else know a better way?

Thursday, September 20, 2007

Ted's visit

Learning from today's class with Ted Mielczarek:

- lots of successful builds, so things are getting easier
- the error that we are getting about directory names with spaces is an advancement over the past when it just failed for an unknown reason
- there's a bug right now with building on Vista, there's a work-around right now
- VM is a great way to test in different environments (I have VMware, just need to get it going)
- ac options are for autoconf whereas mk options are for make
- a reminder to use an object directory with builds
- why you can build mozilla without it - but it's easier with - it handles the MOZ_CO_PROJECT stuff
- looking at tinderbox - not everyone is using tinderbox...lots of people use buildbot so it would be great to get more of the mozilla stuff into buildbot
- there's work being done to get rid of autoconf - switch to python script instead
- talking about replacing make but not sure to what
- google-breakpad, a crash reporting system, integrated with mozilla
- demo of crashing, reporting the crash - bug reports (this is all still a little overwhelming)

And then a break.

- make -C
- mozconfig options for debugging:
ac_add_options --enable-debug (in optimizations)
- demo of searching code at

Final note - in order to do the Source server I apparently don't have to be stellar at C++, phew!

Starting the Project - Mozilla Source and Symbol Server

Today we get to hear Ted Mielczarek speak on the Mozilla Build system. According to Dave, I will be communicating with Ted about the project I signed up for, the Mozilla Source and Symbol Server.

Let me say first of all that I chose this project because I know nothing about it. Let me emphasize this: NOTHING.

So, to get started - looking over the resources provided, reading up on what a source server is and what a symbol server is. I think that I need to see the symbol server in action so that I can know why a source server would be beneficial. This means I need to learn how people debug Mozilla.

Apparently you can debug both in VStudio and also in something called Windbg (which makes me think "windbag"). I have VStudio 2005 already installed and last year a fellow classmate showed me how to do some basic debugging of my C++ programs. At the time that was a huge breakthrough - to be able to see exactly how far into a function I could get, to see what a variable was set to was a huge help in figuring out where something was going terribly wrong.

I don't know if debugging Mozilla is like this. I haven't got it set up yet. My next goal is to find someone who can show me their debugging process. I learn best visually. So for now, I have just downloaded windbag...

Monday, September 17, 2007

Makefile experiment

Okay, as per this week's "To Do List" I followed the instructions and created a basic makefile for the nled editor. I haven't used nled since first year, what a flashback.

Anyway, it was pretty simple. Not sure if I "cheated" by commenting out a tiny statement in the qkdisp.c file in the qb_beep function as follows:
/*#elif WIN95
#elif __OS2__

because I was getting an error about it.

In any case, the makefile looks like this:
and the end result? No .obj files left over when I ran it with the command --- make && make clean ---
as well...ta da!!