1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-26 09:07:38 +01:00

(unwind_and_resume): Correct argument printing.

(run_check): Limit unwind_count to range 1..(nfuncs+RECURSION_DEPTH).
	Fix off-by-one but that counter-acted a bug in ia64-test-rbs-asm.S.

(Logical change 1.52)
This commit is contained in:
mostang.com!davidm 2003-02-21 07:36:26 +00:00
parent c341225693
commit f0c37e1652

View file

@ -70,7 +70,7 @@ unwind_and_resume (long iteration, int (*next_func[])())
int i, ret; int i, ret;
if (verbose) if (verbose)
printf (" %s: test%ld, next_func=%p\n", printf (" %s(iteration=%ld, next_func=%p)\n",
__FUNCTION__, iteration, next_func); __FUNCTION__, iteration, next_func);
unw_getcontext (&uc); unw_getcontext (&uc);
@ -128,7 +128,7 @@ run_check (int test)
while (nspills < 128); while (nspills < 128);
func[nfuncs++] = unwind_and_resume; func[nfuncs++] = unwind_and_resume;
unwind_count = 1 + (random () % (nfuncs + RECURSION_DEPTH)); unwind_count = 1 + (random () % (nfuncs + RECURSION_DEPTH - 1));
if (verbose) if (verbose)
printf ("test%d: nfuncs=%d, unwind_count=%d\n", printf ("test%d: nfuncs=%d, unwind_count=%d\n",
@ -137,9 +137,9 @@ run_check (int test)
ret = loadup (RECURSION_DEPTH, reg_values, func); ret = loadup (RECURSION_DEPTH, reg_values, func);
if (ret < 0) if (ret < 0)
panic ("test%d: load() returned %d\n", test, ret); panic ("test%d: load() returned %d\n", test, ret);
else if (ret != RECURSION_DEPTH + 1 + nfuncs - unwind_count) else if (ret != RECURSION_DEPTH + nfuncs - unwind_count)
panic ("test%d: resumed wrong frame: expected %d, got %d\n", panic ("test%d: resumed wrong frame: expected %d, got %d\n",
test, RECURSION_DEPTH + 1 + nfuncs - unwind_count, ret); test, RECURSION_DEPTH + nfuncs - unwind_count, ret);
return 0; return 0;
} }