Squash
Squash is a patch generation tool to assist with Gecko:DeCOMtamination. This blog post describes how to use squash.
Squash: refactoring tool
- Quickly produce large refactoring patches
- Automate parts of deCOMtamination: class squashing & out-param rewriting(in the near future)
- Helps replacing deprecated APIs at callsites
- Problems: currently produces ugly code, CPP causes blind-spots
Dehydra: syntax & flow aware grepper
- Match on control flow
eg can find mismatched malloc/free calls - Inspired by UNO, but supports nested AST structures and types allowing more precise pattern matching
- Uses JS instead of a custom DSL
- Cross-function analyses being worked on
- Can build a complete call graph, with custom hooks for callbacks, etc
- Should be able to find unused functions
- Prove that functions are only used in certain ways
Making Attractive Tools
- Accidental byproduct of using JS in dehydra is that analyses can easily be serialized into a form consumable by AJAX applications
- This opens up exciting ways to visualize Mozilla code in ways that IDEs don't allow.
- Pump Eclipse-style navigation abilities into LXR
- Use Firefox with SVG, Canvas, (OpenGL?) to develop Firefox
- JS is a perfect tool for Graydon's old idea of producing a consumable "AST" blob of Mozilla that one can run own scripts on to research code properties
- Squash could be integrated into any editor to do eclipse*style refactoring (Not sure if it's worth the hassle)
- Making smart & generic C/C++ tools is hard, but making generic tools that focus on Moz2 is doable
- Since the tools aren't tied to an IDE they should evolve quicker, so if you discover a boring task that could be implement as an algorithm - it may not be as hard to implement as it seems.