I have a question about debugging.
I always use the debugger to find out the line which caused segmentation fault.
it will highlight the line that caused the segfault and i can backtrace the line
But today when i use it to debug, when th debugger stop the program.
No line is highlighted and I can't find the backtrace information.
I wonder this problem is caused by my setting or other thing else.
I have already enable the debug information in the linker option.
Thanks so much
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-11-02
It is likely that you have corrupted the stack and therefore the back-trace. You'll have to use an alternative strategy - stepping the code until the seg fault, then restarting and executing until just before the fault, then look at the data and see what you have done. A buffer overrun of a local array for example will corrupt the stack.
One way of finding the error is to observe the back trace (call stack) while stepping the code. If the call stack suddenly becomes unintelligible, you have just stomped on it.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi all,
I have a question about debugging.
I always use the debugger to find out the line which caused segmentation fault.
it will highlight the line that caused the segfault and i can backtrace the line
But today when i use it to debug, when th debugger stop the program.
No line is highlighted and I can't find the backtrace information.
I wonder this problem is caused by my setting or other thing else.
I have already enable the debug information in the linker option.
Thanks so much
It is likely that you have corrupted the stack and therefore the back-trace. You'll have to use an alternative strategy - stepping the code until the seg fault, then restarting and executing until just before the fault, then look at the data and see what you have done. A buffer overrun of a local array for example will corrupt the stack.
One way of finding the error is to observe the back trace (call stack) while stepping the code. If the call stack suddenly becomes unintelligible, you have just stomped on it.
Clifford