IMCC Wars: Episode IV - A New Hope

A long time ago in a galaxy far, far away...

It is a period of binary war. Rebel hackers, striking from a hidden base in New Jersey have won their first victory against the evil IMCC Empire.

Alright, back to reality.

For the past two weeks, I've sacrificed much of my vacation to lead a full on assault against IMCC. There was much bloodshed and for a while I was on the brink of surrendering, but I think I may have stumbled upon something very encouraging. But first...

I have finally worked out a system for successfully pausing execution. That's right, breakpoints actually work! Granted, you do have to use the PC value and not every one directly corresponds with exactly one line but it's a good start. Part of the problem was that I didn't really understand the funky way bytecode is stored. The pc value used by the runcore is an absolute value while interp->code-> is a constant relative value...I think. Subtracting the two gives the difference/distance between those two locations, not an address which is what I was originally storing it as. Yeah, another stupid mistake with an obvious solution. But nevermind. I'm pretty damn happy.

My latest work has been on polishing the 'list' command so that it supports line ranges. list 6,18 lists lines 6 through 18, list ,21 lists from the beginning until line 21, list 9,9 lists only line 9, and list 36, lists from line 36 until the end. It's pretty neat. I do have a small bug where any non-range value less than 5 lists only the last line but I think that can be fixed with a few carefully placed if statements.

Several days ago, I was sitting on the couch thinking, "Boy, I should really be on the beach with the rest of my family." Then I remembered that I'm stupid and decided to continue searching through some code, looking for examples of how to use the PackFile PMC's. Stumbling upon the stack command for the old debugger, I realized that using it as a model for my own backtrace command would not only help me understand how to use PackFile and Context PMC's but would also get another command out of the way.

After sifting through line after line of absolutely nauseating function names like Parrot_sub_Context_infostr() and PackFile_Annotations_lookup(), I finally had a working backtrace command. Yipee! However, I noticed something very peculiar in the resulting output: the line numbers of the function calls were actually accurate! Huh? What? A light at the end of the tunnel, maybe?

It appears that file and line annotations may present a way for me to destroy the IMCC Death Star and save the planet HBDB. I can't get my hopes up too much though; sometimes the current function is called at line -1 yet everything else is accurate from the callee and on. Even with this one flaw, I think this is very promising.