I’m too tired to write this properly, but it’s satisfying enough to do before I quit. If you’ve been following my progress, you’ll know that I’ve been trying to solve Dave’s mxr-dehydra challenge, looking for all possible methods that SetParent could be in privatePrevAccessible->SetParent(this) (which is really nsPIAccessible->SetParent(nsIAccessible*)). As Dave discovered the hard way, there are two. Using my code, which builds a SQLite database of the tree’s type info while you build, I can do it in a fraction of a second:
sqlite> select members.mtname, members.mdecl, members.mdef from impl, members where impl.tbase="nsPIAccessible" and impl.tconcrete=members.mtname and mname="SetParent(nsIAccessible*)";
mtname|mdecl|mdef
nsAccessible|/home/dave/mozilla-central/src/accessible/src/base/nsAccessible.h:111|/home/dave/mozilla-central/src/accessible/src/base/nsAccessible.cpp:460
nsHTMLListBulletAccessible|/home/dave/mozilla-central/src/accessible/src/html/nsHTMLTextAccessible.h:110|/home/dave/mozilla-central/src/accessible/src/html/nsHTMLTextAccessible.cpp:338
This shows the declaration and definition of nsAccessible::SetParent and nsHTMLListBulletAccessbile::SetParent. I’ve written a dehydra script to generate .sql files for everything that gets compiled, and then a script to assemble these into a simple database (~45M) that can be queried about any class/type, member, or inheritance relationship in the tree.
I’ve run into all sorts of strange edge cases over the past two days, but it’s getting pretty close. The cases I’ve tested work, which isn’t the same as saying it works. I’m going to try and iron out some more of the bugs I know about, and then move on to solving the problem of how to map tokenized source to the output of process_function(), which breaks down all the variables, assignments, function calls within the code. The thought of it overwhelms me tonight, and it’s enough to make me want to quit for the weekend. But I’m quitting with a smile on my face
.
3 Comments
I have no idea of the difficulty, but it seems like this is something that you ought smile about it. And cheers to you!
Just awesome
This is great! I really look forward to being able to test it. Make sure to blog when there is something testable up and running.
One Trackback
[...] should be, but since I had code for the MDRK to improve the front-end of MXR, I decided to hack my Dehydra SQLite database into it. After trying several ways to partition the Mozilla type system so it was useable in GUI [...]