Good News, Everyone!

Today you'll be making a delivery to...

Okay seriously, besides Futurama being the greatest show ever, I actually do have good news. Last week was a very successful week. I was able to implement several commands within just a few days. They're still a bit "rough around the edges" but they work none the less.

The list command works in both 1 and 2 argument form. Specifying a line number lists the 10 lines surrounding it (including itself). I want it to behave just like GDB where typing nothing afterward lists the next 10 lines, again and again. However, I will talk about why this is not so easy in a bit.

The help command works as it should now. Typing "help" without any arguments lists each command along with a short description and typing "help" followed by a command name displays a more verbose message about that particular command.

I thought I got the run command to work as well but that's actually a funny story. Eh, more like a stupid story. Anyway, as it turns out, the run command is actually the step command in disguise; executing just one line at a time. The reason I thought I had it working was because the sample script I was using had only one opcode! This doesn't necessarily set me back though. If anything, it means I got one command working and another is half-way there. I'm still not quite sure how I'm going to get it to execute all the way through though. Normally, this is a trivial task but because of the way things are designed, I may have to do something clever.

I also tried adding the disassemble command; emphasis on the "tried." Seeing as we are trying to close as many tickets as possible before the upcoming 3.6.0 release, I thought I might do my part by closing up TT #2134 which requires moving Parrot_disassemble() to a more appropriate file. Since it currently relies on some things from the old debugger, I planned on HBDB-izing Parrot_disassemble() and then moving it. Well, that turned out to be a much bigger task than I thought it would be. The code for bytecode disassembly was an absolute nightmare! It is one of the most ugly and obscure things I have ever seen! Considering that there are more important things that need to be done, I figured I would just cargo cult everything and merely clean it up and properly comment it. That way, it will work for the time being and I can close up the ticket. Well, even that turned out to be too much just because of the shear amount of code involved. So pretty much, the disassemble command kind of works but I won't come back to it until I have time to re-write it.

One of the things I think about a lot is that I don't want the next person who comes along to use HBDB to wind up as frustrated as I was with Parrot because of the poor quality (or lack) of documentation. I will be (and have been) paying close attention to documentation. That being said, I started writing the "official" documentation this past week. It explains what a debugger is and what it is commonly used for, the meaning and purpose of all the command-line switches (only a few at the moment), and a complete reference of every command that HBDB recognizes. Not only that, but I also plan on including a small tutorial that runs through a sample session demonstrating some of the most commonly used commands. Between that and the way I heavily (and I mean heavily) commented my code, I think people will be quite comfortable when using HBDB.

More recently, I've been working on getting the previous command to execute when nothing is entered. The design for this is simple: if the user enters nothing, leave the command string alone. However, the "if the user enters nothing" part has been a bit troublesome. It turns out that sometimes – and I can't quite pin point when – Parrot_str_to_cstring() returns ASCII value 0 regardless of whether anything was entered. I had the idea last night to just check the byte length with Parrot_str_byte_length() instead but it was getting late. We'll see how that turns out a little later today.

So, even though I'm a little behind, I'm now at least making progress. Things are finally starting to come together.