0

enter image description hereI am trying to debug a code but whenever I try to run gdb I'm getting FATAL: varcache miss for varobj var50.0

#import <stdio.h>
int main(){
    int n; 
    scanf("%d",&n);
    int arr[1000] = {0};
    arr[0] = 1;
    int len = 1;
    for (int i = 2; i <= n; i++) {
        int carry = 0;
        for (int j = 0; j < len; j++) {
            int mul = i * arr[j] + carry;
            int dig = mul % 10;
            arr[j] = dig;
            carry = mul / 10;
        }

        while (carry) {
           len++;
           int dig = carry % 10;
           arr[len - 1] = dig;
           carry /= 10;
        }
    }

    for (int i = len - 1; i >= 0; i--) {
        printf("%d", arr[i]);
    }

    return 0;
}
4
  • Because you are debugging, suspect you had some kind of time consuming I/O or calculation. Try restarting the workspace or internet search /var/cache. May 17 '17 at 2:38
  • Got similar error messages (with different numbers) when trying to list the content of arr in the graphical debugger interface (it would not show any, but crash on next step). Did you do the same?
    – Blauelf
    May 17 '17 at 9:10
  • @Blauelf not while listing arr but when executing the flow
    – user282
    May 23 '17 at 3:15
  • Listing for me would not immediately trigger this, listing would not work (no list appears), and on the next instruction programme would crash with some seemingly random number. I'm wondering whether that's a problem with gdb or the wrapper debug50.
    – Blauelf
    May 23 '17 at 8:54

You must log in to answer this question.

Browse other questions tagged .