Ask HN: Variable Trace
1 points
5 hours ago
| 0 comments
| HN
A large (2.7 million loc), complex legacy C++ code base has a labyrinthine setup, configuration, and calculation process. I'm looking to trace the usage of a single variable down through the call stack to determine each of its touch points.

Ideally, this would entail launching a visual tool, pointing it to the source code (or importing solution files), right-clicking on the variable, and selecting "trace" (or similar). I've tried SciTools' Understand, but it also graphs ancillary variables related to the variable of interest, rendering the trace effectively useless, being time-consuming to produce (~30 minutes), unreadable (too big), and riddled with numerous unrelated call stacks.

I'm looking to graph the call stack for one variable, preferably using static, on-prem source code analysis using a standalone desktop application. Other tools include joern, SVF, and CodeQL, which I haven't tried yet. A command-line tool would be fine, as long as it is trivial to trace a specific variable.

What has been your experience with tracing variables through code? Are there any tools you'd recommend to generate a focused graph?

No one has commented on this post.