Marc:
I needed to debug a gsc-compiled file with gdb today, and it was fairly inconvenient that the .c file wasn't left around by compile- file in beta 21. I suggest that the .c file be left around for the various source tools that need it.
Brad
Afficher les réponses par date
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 4-Apr-07, at 2:56 PM, Bradley Lucier wrote:
Marc:
I needed to debug a gsc-compiled file with gdb today, and it was fairly inconvenient that the .c file wasn't left around by compile- file in beta 21. I suggest that the .c file be left around for the various source tools that need it.
I have added a -keep-c option to gsc. I.e. you'll have to do:
gsc -keep-c foo
to compile foo.scm to foo.o1 and foo.c . That's still shorter than what it used to be, i.e.
gsc -dynamic foo
Marc
On Apr 4, 2007, at 5:03 PM, Marc Feeley wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 4-Apr-07, at 2:56 PM, Bradley Lucier wrote:
Marc:
I needed to debug a gsc-compiled file with gdb today, and it was fairly inconvenient that the .c file wasn't left around by compile- file in beta 21. I suggest that the .c file be left around for the various source tools that need it.
I have added a -keep-c option to gsc. I.e. you'll have to do:
gsc -keep-c foo
to compile foo.scm to foo.o1 and foo.c . That's still shorter than what it used to be, i.e.
gsc -dynamic foo
and
gsc foo
would be shorter still.
Why don't you want to keep the C file around by default?
Brad
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 4-Apr-07, at 5:15 PM, Bradley Lucier wrote:
Why don't you want to keep the C file around by default?
Clutter. Same reason the C compiler doesn't keep the .o file around (and other files too).
The model should be
foo.scm ----> foo.o1 gsc
Marc
On Apr 4, 2007, at 5:45 PM, Marc Feeley wrote:
Why don't you want to keep the C file around by default?
Clutter. Same reason the C compiler doesn't keep the .o file around (and other files too).
OK (though I got used to using the "clutter"). -track-scheme should imply -keep-c.
Brad
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 5-Apr-07, at 9:38 AM, Bradley Lucier wrote:
OK (though I got used to using the "clutter"). -track-scheme should imply -keep-c.
Why? When you use -track-scheme you want the debugger to point to the Scheme file, so the .c file is not needed!
Marc
Marc Feeley wrote:
On 4-Apr-07, at 2:56 PM, Bradley Lucier wrote:
Marc:
I needed to debug a gsc-compiled file with gdb today, and it was fairly inconvenient that the .c file wasn't left around by compile- file in beta 21. I suggest that the .c file be left around for the various source tools that need it.
I have added a -keep-c option to gsc. I.e. you'll have to do:
gsc -keep-c foo
to compile foo.scm to foo.o1 and foo.c
How do I tell the |compile-file| procedure to keep the C file? I realize that there's the |compile-file-to-c| procedure, but usually I just want to compile-file and if that fails I want to investigate the c file. Well actually it might also be a good idea to not remove the .c file if the C compiler fails.
Christian.
On Feb 5, 2008, at 4:36 AM, Christian Jaeger wrote:
How do I tell the |compile-file| procedure to keep the C file?
[brad:~/Desktop] lucier% gsc Gambit v4.1.2
(compile-file "sqrt.scm" options: '(keep-c))
gcc: unrecognized option '-no-cpp-precomp' #t
*** EOF again to exit [brad:~/Desktop] lucier% ll sqrt.* -rw-r--r-- 1 lucier lucier 51338 Feb 5 09:12 sqrt.c -rwxr-xr-x 1 lucier lucier 22268 Feb 5 09:12 sqrt.o1* -rw-r--r-- 1 lucier lucier 458 Jan 26 15:39 sqrt.scm -rw-r--r-- 1 lucier lucier 275 Jan 26 01:42 sqrt.scm~
On Feb 5, 2008, at 4:36 AM, Christian Jaeger wrote:
How do I tell the |compile-file| procedure to keep the C file? I realize that there's the |compile-file-to-c| procedure, but usually I just want to compile-file and if that fails I want to investigate the c file. Well actually it might also be a good idea to not remove the .c file if the C compiler fails.
Marc:
More generally, it would be good to document all the options handled in handle-options in gsc/_front.scm
(define (handle-options opts) (reset-options) (let ((rev-remaining-opts '())) (for-each (lambda (opt) (case opt ((warnings) (set! compiler-option-warnings #t)) ((verbose) (set! compiler-option-verbose #t)) ((report) (set! compiler-option-report #t)) ((expansion) (set! compiler-option-expansion #t)) ((gvm) (set! compiler-option-gvm #t)) ((debug) (set! compiler-option-debug #t)) ((debug-source) (set! compiler-option-debug-source #t)) ((debug-environments) (set! compiler-option-debug-environments #t)) ((track-scheme) (set! compiler-option-track-scheme #t)) ((c dynamic link flat check force keep-c o l prelude postlude cc-options ld-options-prelude ld-options) #f) ;; these options are innocuous (else (set! rev-remaining-opts (cons opt rev-remaining-opts))))) opts) (reverse rev-remaining-opts)))
It's not clear which of these options apply to (compile-file "file.scm") from looking at the documentation.
Brad
On 6-Feb-08, at 8:12 PM, Bradley Lucier wrote:
Marc:
More generally, it would be good to document all the options handled in handle-options in gsc/_front.scm
They are all documented, except for "check" and "force", which aren't really handled by the compiler (they are detected by the runtime system to include or not the runtime checks, and to perform or not automatic forcing).
Marc