Sourcetrail icon indicating copy to clipboard operation
Sourcetrail copied to clipboard

On-demand control flow diagrams for functions

Open ericlemasson opened this issue 7 years ago • 7 comments

[New feature] Any plans to add in the future automatic creation of visual control flow for any method / function, similar to what understand is doing?

ericlemasson avatar May 07 '18 15:05 ericlemasson

Are you referring to the control flow within a method / function?

egraether avatar May 07 '18 23:05 egraether

yes, I like it for average size function, when it is still readable and useful (especially to diff with previous version). But I know this would be complex to develop.

ericlemasson avatar May 07 '18 23:05 ericlemasson

Yes, it would be complex to develop and also require a lot more data to collect and store.

egraether avatar May 08 '18 00:05 egraether

I was thinking more of a 'on-demand functionality' ... when inside a function, could do - right-click / generate control flow for the current function - to switch to a graphical view. I don't think cross-references are required here because we focus only on the current function. Clicking on an item in the graph would bring us back to the corresponding line of code in the function. Not sure if this make any sense ...

ericlemasson avatar May 08 '18 13:05 ericlemasson

I agree that this would be a very useful functionality!

TomSmartBishop avatar Dec 18 '18 15:12 TomSmartBishop

+1 by mail

egraether avatar Jan 14 '19 14:01 egraether

This would be extremely helpful. I think that LLVM is able to provide a CFG for any function.

Here is an old blog post about this idea. The API has probably changed in the meantime...

Edit: Ah, sorry. This would be only related to LLVM-IR it seems, not for high-level C.

fabric-and-ink avatar Jul 02 '20 12:07 fabric-and-ink