Code::Blocks Forums

User forums => Help => Topic started by: quastor on July 21, 2022, 08:06:50 pm

Title: Unexpected behavior of Step into option while debugging segfault
Post by: quastor on July 21, 2022, 08:06:50 pm
I'm trying to debug a segfault in my project the cause of which is in a known function and encountering an unexpected behavior of the debugger.
My main() function has one breakpoint at the first line and includes several calls to functions either from other .c files.
When I use the Step into option with a function located in another file, the IDE behaves as if I hit Next line and just executes the function at once.

Code
int main(int argc, char **argv){
int n = argc;
while(--argc){
preproc(argv[n-argc]); /*just skips*/
proc(argv[n-argc]); /*just skips*/
write_code_to(argv[n-argc]); /*here is the segfault, also skips and just throws the segfault*/
}

return 0;
}

If it matters, I use a custom makefile with a single make command: $make -f $makefile
What are possible reasons and ways to fix?
Title: Re: Unexpected behavior of Step into option while debugging segfault
Post by: ollydbg on July 22, 2022, 06:28:48 am
When I use the Step into option with a function located in another file, the IDE behaves as if I hit Next line and just executes the function at once.

Here are my suggestions:
1, can you show us the full debug log?
2, what happens if those two source files are inside a cbp file, I mean not using the custom makefile method.