|
|
Subscribe / Log in / New account

You really want to store this information in a big database

You really want to store this information in a big database

Posted Jan 15, 2015 11:15 UTC (Thu) by error27 (subscriber, #8346)
Parent article: Extracting the abstract syntax tree from GCC

[ I haven't used C++ either and I use vim. So I may be naive. ]

In my work with Smatch, I have create a 10GB cross function database of the kernel every day. It takes about three hours on my computer. But it's *SO* worth it and I wish this information were integrated into my IDE.

Say you have code like:

foo = atoi(xxx);

Then "foo" is user controlled data. It could make the "foo" variable red until you put an upper and lower bound on it. If you had a line "x = 100/foo;" then the IDE could draw a circle around the divide and if you hovered the mouse over it, it was say that it was a divide by a user controlled variable that might be zero.

That example works without cross function information but the Smatch database can tell you, "This function is called with a user controlled range of [0-5]."

Or say you have a variable "foo->bar" then you could hover the mouse over it and it could tell you every possible place that sets this variable and what the possible ranges are.

Or you could hover your mouse over a function parameter and it would tell you the call tree from where the parameter was allocated up to now.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds