I have been writing a program for multi-element diffusion. Because the method I am using is poorly optimized in MatLab, I have been programming in C, as that is fast for my purpose. I am, however, much more an engineer than a programmer. The model consists of many functions and each of those functions I have tested separately for expected inputs. However, now that everything is together, my program gets stuck. Most likely in one of the (many) while loops. If I can find which loop it gets stuck in, I can see if it gets a wrong input, or if I made a mistake in the loop itself that I missed during testing. If it were simply looping a few times, I could add a print statement of sorts in each loop, but since it iterates a few million to more than a billion times, that won't work. And if I try to run it with just a few hundred iterations, the problem doesn't occur. I was hoping that in the IDE there is an option to see which function is currently being executed, but I can't find it in the one I am using (Pelles C).
Is there an option in Pelles C (or if not there in another IDE) that shows which function is currently active? Or is there a different way to find where it gets stuck? I have been trying to get the debugger to tell me where it is stuck, but even though it gives me a lot of information about things I have no clue about, it doesn't seem to tell me what I want to know.