0

I'm new to C++ and I'm using Visual Studio Community 2019. Below are 3 functions: OnInput() passes FString argument to ProcessGuess() witch passes it to IsValid(). Is there any tool or extension for VS so I can click on local variable FString Word inside IsValid() function and see whole chain of transformations: Word<- Guess<- Input for this argument? I think "chain of arguments dependencies" is weird name for what I'm asking about, what is the proper name for it?

const FString ValidInput = "Yes";
 
void OnInput(const FString& Input)              // Take input from user
{   
        ProcessGuess(Input);
         
}   


void ProcessGuess(FString Guess)                 //Check if user have valid guess
{
    if (!IsValid(Guess))                  
    {
        PrintLine(TEXT("Your Input is NOT valid."));
    }
    else
    {
        PrintLine(TEXT("Your Input is valid."));
    }
}

bool IsValid(FString Word) const  //Check if user input is == ValidInput
{
    if(Word == ValidInput)
    {
       return true;
    }
    else
    {
       return false;
    }
}
  • You can do something similar in the debugger. Put a breakpoint on the first line of `IsValid` and run the program to that point. Then inspect the stack backtrace to see how you got there. – Paul Sanders Jul 21 '20 at 22:27
  • @Paul Sanders Thank you - this will be enough for me right now. Sadly this is runtime only solution. Because of your comment I now know about VS Enterprise version of stack trace - CodeMaps - they are much more transparent - but cost too much. – Andrey Sergeev Jul 21 '20 at 23:43
  • @Andrey Sergeev,As far as I'm concerned, you could try to use [Doxygen tool](https://www.doxygen.nl/index.html).Doxygen can create include, inheritance, call and caller graphs using [graphviz](http://www.graphviz.org/). For more details I suggest you could refer to the link: https://stackoverflow.com/questions/9632347/c-code-dependency-call-graph-viewer – Jeaninez - MSFT Jul 22 '20 at 02:01

0 Answers0