I have a algorithm which "sometimes" did not break the recursion and ends up in a stack overflow. Now I want to debug that situation. gdb points me directly to the line where I overwrite the stack boarder, but it is impossible to get a stacktrace because gdb needs endless time to unwind the stack and display it in ddd.
I now simply want to reduce the stack size to get the corruption much earlier. So I need a way to reduce to stack for my running task. There are no threads involved so it should be not such a big deal.
But I have no idea if gdb itself has an option to manipulte the stack (size) itself or I need to programmatic change the size at start of my prog or I can maybe reduce the size from the os command line ( linux ) after starting the debug session.
Maybe it is also possible the stop if the call tree reaches a maximum depth if gdb has such an option.