Revisions

This commit is contained in:
Justin Ethier 2016-08-10 20:39:59 -04:00
parent 72c652da17
commit 8f9aa037a8

View file

@ -52,7 +52,7 @@ For example:
CFLAGS ?= -g -Wall -Iinclude -L.
COMP_CFLAGS ?= -g -Wall -I$(PREFIX)/include -L$(PREFIX)/lib
Then rebuild/reinstall everything. This may be easiest to do using the [cyclone-bootstrap](https://github.com/justinethier/cyclone-bootstrap) repository: just modify `Makefile.config` and follow the install instructions.
Then rebuild/reinstall everything. This may be easiest to do using the [cyclone-bootstrap](https://github.com/justinethier/cyclone-bootstrap) repository; just modify `Makefile.config` and follow the install instructions.
Now that the C compiler is producing debugging information, you can use `gdb` to debug the segfault directly:
@ -63,4 +63,4 @@ If you need to specify any command line arguments to the program:
(gdb) run arg1 arg2 ...
At this point when the program crashes you should be able to see exactly where it failed. If it failed in runtime.c or one of the native C files, it should be straightforward to figure out the problem. If the crash is in a C file generated by Cyclone, the problem will be harder to debug, because likely the compiler either generated code incorrectly or the compiler did not catch an error (such as a missing function parameter) and generated bad code as a result.
At this point when the program crashes you should be able to see exactly where it failed. If it failed in `runtime.c` or one of the native C files, it should be straightforward to figure out the problem. If the crash is in a C file generated by Cyclone, the problem will be harder to debug, because likely the compiler either generated code incorrectly or the compiler did not catch an error (such as a missing function parameter) and generated bad code as a result.