[cfe-dev] CFRefCount "Problem" #3: Debug-printing ProgramStates

Jordy Rose jediknil at belkadan.com
Sat Aug 27 16:04:14 PDT 2011


[Background: Currently we're trying to eliminate the concept of "transfer functions" from the static analyzer, which has gradually been supplanted by the Checker interface. The only implementation of the transfer functions, CFRefCount, has two roles: general-purpose function and method evaluator, and retain-count checking for the Cocoa and CoreFoundation frameworks. The former is being moved to ExprEngine*, the latter to a regular checker called RetainReleaseChecker. Of course, there are always design issues; I'm trying to make sure they get cleared up on-list one by one.]

This one is barely a problem: currently there's a notion of a "state printer" for ProgramStates, which is intended for debug use in printing the contents of a state. However, only TransferFuncs gets a shot at adding new printers.

Now that we /have/ the checker infrastructure, it makes more sense to me to have a new callback, print::State, which allows checkers to print any checker-specific data...such as RetainReleaseChecker's RefBindings and autorelease pool contents, and perhaps PthreadLockChecker's locksets or CStringChecker's string lengths...and ditch the notion of a separate "program state printer" owned by the ProgramStateManager.

This seems pretty straightforward to me, though there might be details to change?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: printState.patch
Type: application/octet-stream
Size: 15333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110827/fe135aee/attachment.obj>


More information about the cfe-dev mailing list