CLion stepping into printf function not working

Hello,

I'm having difficulty stepping through a simple program. I get stuck at a printf function, everytime I click "step into", it returns to the same statement, eventually exiting the program.

Here is the full code to the program:

#include <stdio.h>


/* Function to swap values at two pointers */
void swap (char *x, char *y)
{
    char temp;
    temp = *x;
    *x = *y;
    *y = temp;
}

/* Function to print permutations of string
    This function takes three parameters:
    1. String
    2. Starting index of the string
    3. Ending index of the string. */
void permute(char *a, int i, int n)
{
    int j;
    if (i == n)
        printf("%s\n", a);
    else
    {
        for (j = i; j <= n; j++)
        {
            swap((a+i), (a+j));
            permute(a, i+1, n);
            swap((a+i), (a+j)); //backtrack
        }
    }
}

/* Driver program to test above functions */
int main()
{
    char a[] = "ABC";
    permute(a, 0, 2);
    getchar();
    return 0;
}

Please also see an active stackoverflow question: http://stackoverflow.com/questions/32480896/cant-step-into-printf-function-with-gdb?noredirect=1#comment52824788_32480896
4 comments
Comment actions Permalink

Hi Tony.

I've tried to reproduce the issue, but it correctly works on my environment. Could you please specify your OS and send us a screenshot with toolchains (Settings | Build, Execution, Deployment | Toolchains).

0
Comment actions Permalink

Hi

I've attached a screenshot of my toolchains. I am using Mac OSX Yosemite.

thanks



Attachment(s):
screenshot.png
0
Comment actions Permalink

Also please specify which CLion version are you using (About CLion tab in the main menu).

0
Comment actions Permalink

Nevermind I've fixed the issue. I downloaded the new version of CLion which uses LLDB.

thanks

0

Please sign in to leave a comment.