Friday, November 30, 2007

Eclipse and keycode mapping

Okay, this is take 2 because my first post was unceremoniously 'disappeared'.

My BTS team is getting geared up for writing Unit Tests in JUnit. We're using Eclipse with subclipse for SVN. Two teammates are Windows, one Linux and me on the Mac. Mac's version of Java is Apple's not Sun's so my JRE profile is not compatible with theirs. This means I will be using my Linux VM for the project - getting to know Ubuntu a little better.

Today's the first day of significant coding and I am already frustrated that I have to reach back to use the ctrl key instead of my trusty apple key for shortcuts. Also the tilde key actually produces < and there's no delete functionality (what Mac calls delete is really backspace).

So I have found a solution and here it is:

First, create a file (mine is called wickedCoolKeycodeFinder - you know, so I can always find it again)
and in that file put this:
xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'

chmod +x this file and then run it to produce a neat little window that will tell you what keycode is returned for whatever key you press.

Then, once you know the keycodes of the keys you want to map, create a file called .xmodmaprc and in that file I put:

!this sorts out the apple key + backspace to do delete
keycode 113 = BackSpace Terminate_Server Delete
! map tilde and grave
keycode 49 = grave asciitilde
!map apple key to ctrl
remove Control = Control_L
keycode 115 = Control_L
keycode 116 = Control_L
add Control = Control_L


Now I just need to figure out how I can get my two-finger scrolling on the touchpad to work and I'll be a Linux user forever!

Wednesday, November 28, 2007

Circling, like a tiger ready to pounce

So for my 0.3 release of sourceServer, I am tasked with altering the code in symbolstore.py so that it will track the source files and then call pdbstr.exe on them.

To do this, I need to understand what PDBSTR.EXE does. This is what I have to go on:
Once the code has looked at all the source files in the PDB file, it's time to call PDBSTR.EXE to write the index stream, called SRCSRV, to the PDB file. When debugging, the debugger looks for this stream. If it is found, the debugger knows there's a source server involved and calls into SRCSRV.DLL to execute the version control system to ensure the right file is accessed.


I've been studying the pdb files pre and post indexing to gain insight into what happens when I use the Debugging for Windows srcsrv tools. Circling the symbolstore.py code getting ready to make changes to see what I can do.

Any minute now the big picture will come into focus...back to my pdb files.

Saturday, November 24, 2007

Thursday, November 22, 2007

XPcom Lab II

Well there was an initial kerfuffle trying to get the extension "firstxpcomchrome" working in my Minefield build. Turns out that when I was attempting to connect it up via a text file in the profiles/myprofile/extensions folder, I had put the path as a c:/.... path which, in Unix (ie Mac), is not correct. This was affecting my ability to install the extension through drag n drop because the file for firstxpcomchrome@senecac.on.ca was not being overwritten so even though the extension appeared to install correctly in the add-ons manager window, upon restarting it was nowhere to be seen. Deleting the erroneous flat file and doing a drag and drop installation cleared this up and I was able to continue with the lab.

Aside from crashing the browser every time I called on "Reload All Chrome" from the Extension Developer add-on, the lab went smoothly.

Results:
(please enjoy the File menu behaviour that is happening in the background)
Call
FirstXPComChrome1

Response
FirstXPComChrome2

Tuesday, November 20, 2007

Source Server 0.3 goals

Well, it turns out that my 0.2 release was a little buggy but Ted (luser) was able to hack his srcsrv.ini file to overwrite the URL I had indexed into the pdb files so that he was able to pull code from my server. Instead of hacking the 0.2 and fixing that though, I am moving forward with 0.3 which is to put into symbolstore.py the ability to do the cvs pulls.

This is the most complicated part yet, for me, because I am not too familiar with python and because I still see all this code as a nebulous cloud and finding the path from A to B is difficult.

So my steps toward my 0.3 goal so far have been:

  • Reading up on Python and how it works with some: Python Tutorials

  • Studying the logic of symbolstore.py



And coming soon, some hacks of symbolstore.py to see what kind of havoc I can wreak.

Monday, November 19, 2007

Xpcom success

Thanks to Armen's post and all the sub helpers that led to his post, I did successfully install the Extension Developer add-on and I managed to get my firstxpcom extension working in the JavaScript shell:
FirstxpcomSS1
FirstxpcomSS2

XPcom - not right now.

Well, I greatly enjoyed Benjamin Smedberg's talk - power outage and all - and much was learned about Xpcom. Not enough however, to enable me to complete the Xpcom lab that was assigned to us last week.

Last week I pounced on the lab, raring to go with my existing build of firefox and ran into a wall - something is just not making right. Some poking around, consulting with those who have done the lab generates no leads since the trouble I'm having is of course, unique, and so they do not know where I am going wrong.

Fine. I can handle this. I will do it all from scratch, checkout code, rebuild, start the lab and guess what? Still can't do it. Currently I am stopped by this:

make[1]: *** No rule to make target `install.rdf', needed by `libs'.

I don't understand Xpcom enough to really troubleshoot this so I think this lab is going in the "to-do later when you know more" pile for now.

Newsflash, I never created the install.rdf file - so now it's working to the point where I can see it in my Add-ons manager. However! Ted's Extension Developer add-on does not work with my build because it does not support secure updates...must be a new ff3 feature...so now I have to wait until tomorrow to ask luser if there's a work around.

Wednesday, November 14, 2007

Source Server 0.2 release - HOWTO and Contribution Opportunity

Here are the goals for my 0.2 release



  • release build of ff with debugger-info enabled to create pdbs without being a full debug build

  • using lib xul - make an installer for people to download

  • take the symbols and index them and distribute the source

  • set up the symbol server but indexed so that someone can pull the source code

  • which involves running the cv2http.cmd on the indexed code


And the results:

How to set up the Source and Symbol Server



  1. add a path to my symbolServer http://avnerd.tv/symbols/2007110200 as per MDC docs in Tools->Debugging->Symbols



  2. check the option for turning on the source server in Tools->Debugging->General



  3. Download the installer from here Firefox Installer **(FYI you have to use my installer because it is the one that I indexed code and uploaded symbols for - if you do not use this installer you will not get the proper results)


  4. install the firefox you just downloaded (it will install as Minefield in Program Files\Minefield)


  5. make sure you run it with --no-remote and -profilemanager so you don't mess up your normal Firefox experience


  6. once it's running, go to Tools->attach to process... and attach VStudio to the firefox instance


  7. after it's attached, you can go to Debug->break all and then poke around at the firefox functions code (You will get a warning about downloading code from an unknown source, click on "run" because you trust me)


This is what it might look like:




Contribution Opportunity


You need to be in the Windows platform and have a copy of Visual Studio to run the above instructions. If this applies to you, please take a minute to download the installer and follow the instructions as I've outlined them.

Please leave a comment answering the following questions:

  1. Did it work for you?

  2. Were the instructions clear?

  3. Any constructive feedback?

Tuesday, November 13, 2007

Contrib Opportunity! Help with resolving a path with spaces and a perl script

I have a perl script called cv2http.pl that is called upon by cv2http.cmd

Both are in c:\Program Files\Debugging Tools for Windows\sdk\srcsrv directory, which is where I am making this command line call from.

I am trying to do this:

walk.cmd c:\symbols\*.pdb cv2http.cmd HTTP_ALIAS http://avnerd.tv/source

What this will do is swap out the cvs information and replace it with a path to my server where I have the source code.

When I run it I get this:

"Can't open perl script "C:\Program": No such file or directory

for every .pdb that is found.

It looks like it is breaking on the space between Program Files in the path.

So - does anyone know how to either: make this script be forgiving of blank spaces in a path or change the directory this points to so that I can move it and try from there.

**** UPDATE *****
Turns out it was as easy as adding "" around the ~%d0\cv2http.pl call in the cs2http.cmd file - thanks to all who helped on #seneca

Saturday, November 10, 2007

Test Day X 2

Well today I got to run Full Functional Tests on Firefox 3 beta 1 and then this evening as I procrastinated from dealing with my Hamiltonian circuit assignment, I ran tests on Miro's 1.0rc release.

The two testing systems are very different even though they both use Litmus-based testing. Miro's tests are fewer, some are not well written and in some ways I find them to be very superficial. The Firefox tests have been around a lot longer so I'm sure that has allowed for quite a bit of fine tuning.

I'm not giving up on Miro but so far it's been challenging to get involved with that project to the degree with which I have been able to immerse myself in Mozilla projects. The lab the other day threw me into Thunderbird in a quick 'n dirty way and that was great - the documentation is all there. With Miro - well...when I went to look for docs on how to build with Windows...this and this. The gist of it is: "We can't really tell you how to build on windows because it's hard".

Well, now that I'm working on the Mac Book and I have VMWare Fusion with an Ubuntu vm, perhaps I can try building it in a Unix/Linux environment? There's a doc for Mac OS X and for Linux. We'll soon see.

Now, back to Mozilla stuff. My 0.2. release is due soon, I have already done a non-debug build of FF with the --enable-debugger-info-modules in the mozconfig and I've made the buildsymbols for it. Now I just have to index the pdb files and get the symbols and the source up on my server. Immediately after that is done (in the next day or two) I will look into a) how to make an installer and b) how to work with the CVStoHTTP script that comes with the srctools.

When I have an installer up, I'll be putting out the contrib call for anyone who can to grab the installer and try to hook it up with my symbol and source servers.

Stay tuned.

Thursday, November 8, 2007

Thunderbird Bug Fixing Lab - an up close and personal lesson on patch review

Filing a bug



First I had to create a bug over on landfill - explaining the issue

The gist is that anything that has characters@...Someothercharacters turns into a mailto: link in Thunderbird and this was annoying Dave so the whole class jumped to fix it.

Fixing the problem



Dowloaded and built a copy of Thunderbird's trunk on my MacBook and then navigated over to mozTXTToHTMLConv.cpp in order to alter some code which checks for a '.' after the @ symbol but does not also check that there is not a ".." in that string.

This is a one-line fix but I was having some trouble getting my code changes to show up. Funny story, this happened to me in class too and both times it was because I forgot a ) in the code.

Creating a patch



This is easily done by calling cvs diff -u8p . > mailtoPatch.txt in my mozilla directory.

Requesting Review and the Results



We were going down the line as reviewers - I asked Mmullin and he had already done a review so he handed me off to Armenzg who passed my patch with the comments to remove my printf statement and to make the two if statements into one evaluation. It turns out that he should not have passed my patch, instead he should have made the comments and let me fix it before approving the patch.

Even though Armenzg passed my first patch, I did in fact re-do the patch minus printf and simplifying the if statement. I am waiting for a proper approval as I write this but I am sure it will be approved.

After it was all over, I was then the reviewer for Peter's patch and I was impressed with his one line change and passed it immediately.

The whole process was a great learning curve. Now that I've seen how the patch/review process works I imagine that I could fix a bug one of these days.

Wednesday, November 7, 2007

New MacBook with no Boot Camp Utility?

Some of the newest Santa Rosa chipset MacBooks have been deployed without Boot Camp Assistant in the Utilities folder. I'm sure this will be fixed soon. Here's the quick fix if anyone else needs it:

Put the Install Disc 1 in, then in Finder, to to Go -> Go To Folder... and type:

/Volumes/Mac OS X Install Disc 1/System/Installation/Packages

in the dialogue box. There you should see BootCamp.pkg. Running that with all the defaults puts the Boot Camp Assistant in /Applications/Utilities/ (source)

So glad I wasn't going crazy...spent a lot of time poking around my new MacBook muttering "but it's supposed to have boot camp!".

The to-do list goes into high gear now as I have a couple of programs to write for BTP500, some database stuff due for BTS530, and of course all the DPS909 labs and project updates.

All this and setting up the new mac with a windows vm so that I can continue to work on the source server with Visual Studio.

Friday, November 2, 2007

Something to show...

For my 5 hours between classes on Friday. Hopped into Litmus and joined in on Test Day. Managed to do 58 tests and filed my first bugs: 402219, 402228, and 402238.

I feel very accomplished. It's fun to find a bug, and I had an especially great crash that I was able to reproduce 3 times, and after Vlad's talk yesterday I am also looking forward to working on a patch and fixing a bug.

The past few days I have also been testing the waters over at Miro. What a difference size makes. Miro has only 11 staff - how many does Mozilla have? I would guess at least 20 or 30 times more. So far I haven't done a build of Miro yet, I'm going to work on that over the weekend. Can't wait to look at the source code and see what makes a video player. The funny (and somewhat frustrating) thing is that I have had to create new bugzilla and litmus accounts for Miro as my Mozilla ones don't carry forward. Someone hurry up and get that OpenID stuff working on everything!