tests/c/factorial2.c
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 07 Feb 2019 15:18:41 +0000
changeset 175 a04e1a36e888
parent 95 f417138e9c48
permissions -rw-r--r--
Fix for multi-location breakpoints created initially as pending If the breakpoint has been created as pending breakpoint it is unknown whether it is a multi-location breakpoint or not so it has no locations. If, once the object is loaded abd breakpoint can be installed, it turns out there are multiple locations, we get an an =breakpoint-modified event listing all locations. Therefore, we have to update existing breakpoint and add locations.

#include <stdio.h>
#line 3 "factorial2.c"
#line 4 "factorial2.js"
int factorial(int i) {	
	if (i == 1) {
		return 1;
	} else {
		return i * factorial(i - 1);
	}
}
#line 12 "factorial2.c"

int main(int argc, char **argv) {
	int i = 5;
	int f = factorial(i);
	printf("factorial(%d) = %d\n", i , f);
}