![]() Which points us directly to the buggy line 7. Program terminated with signal SIGSEGV, Segmentation fault. GDB points us to the exact line where the segfault happened, which is what most users want while debugging: gdb -q -nh main.out core */Ĭompile, and run to generate core: gcc -ggdb3 -std=c99 -Wall -Wextra -pedantic -o main.out main.c ![]() ![]() * Call a function to prepare a stack trace. Mmap_ptr = (char *)malloc(sizeof(data_ptr) + 1) Now for a the full educational test setup:Ĭhar data_ptr = "string in data segment" Ĭhar *text_ptr = "string in text segment" GDB to find failing line, previously mentioned at: How to view core files for debugging purposes in Linux?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |