I'm studying one project in C++. It's quite big, build is created with cmake. After installing all dependencies and libs it's the build is done fine. But when I run it, I get Segmentation fault
.
Here is the thing: There is no IDE, running this project with cmake in VS Code. I wonder if it's possible to find this place in code which causes Segmentation fault
. I know that there is GDB debugger for such things. I run several commands and here's what I get:
gdb build/studpark
...
Reading symbols from build/studpark...
(gdb) run
Starting program: /Users/admin/Downloads/StudPark-develop/build/studpark
[New Thread 0x2503 of process 7316]
[New Thread 0x1903 of process 7316]
[New Thread 0x1a03 of process 7316]
warning: unhandled dyld version (17)
Thread 3 received signal SIGSEGV, Segmentation fault.
0x00007ff809bec6b2 in ?? ()
(gdb) backtrace
#0 0x00007ff809bec6b2 in ?? ()
#1 0x00007ff7bfeff510 in ?? ()
#2 0x0000000100002abe in main ()
Backtrace stopped: frame did not save the PC
The question is: Is it possible to trace and find exact place in code that causes segmentation fault?
EDIT: I compile my project with these flags:
set(CMAKE_CXX_FLAGS "-stdlib=libc++ -g")
My platform is Mac OS.