From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 49C933847825 for ; Tue, 29 Jun 2021 00:54:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 49C933847825 Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7D99033BECB for ; Tue, 29 Jun 2021 00:54:29 +0000 (UTC) Date: Mon, 28 Jun 2021 20:54:28 -0400 From: Mike Frysinger To: cgen@sourceware.org Subject: crash when displaying usage Message-ID: Mail-Followup-To: cgen@sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cgen@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cgen mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jun 2021 00:54:32 -0000 disclaimer: i avoid lisp in general, so i don't have much to offer. NB: i have to use a manual compile of guile-1.8 because cgen itself doesn't support guile-2 (syntax errors). i'm not sure if that's the cause, or if there's something else. in the current cgen checkout, printing the usage info always crashes. $ guile-1.8 -l ./guile.scm -s ./cgen-sim.scm -s . --help Backtrace: In ././read.scm: 1145: 0* [string-append " " " " #f] In unknown file: ?: 1* [# #f] In ././read.scm: 1144: 2* [map # (#f #)] 1143: 3* [apply # ... 1136: 4* [string-append "-A file " " - " "generate arch.h in " ... 1136: 5* [display ... In unknown file: ?: 6* [# ("-A" "file" "generate arch.h in " ...)] In ././read.scm: 1135: 7* [for-each # (# # # # ...)] 1128: 8 (let* ((cep (current-error-port))) (case errtype ((help) #f) ...) ...) 1334: 9 [cgen-usage help "" ...] 1314: 10 (cond (# #) (# #) (# #) ...) 1309: 11* (case opt ((#f) (set! moreopts? #f)) ...) 1306: 12 (let* ((new-argv #) (opt #) (arg #)) (case opt (# #) ...) ...) 1377: 13 [loop ("--help")] 1377: 14 (if moreopts? (loop (cdr new-argv))) 1306: 15 (let* ((new-argv #) (opt #) (arg #)) (case opt (# #) ...) ...) 1305: 16* [loop ("-s" "." "--help")] 1289: 17 (let (# # # # ...) (# #) (cgen-call-with-debugging debugging #)) 1257: 18* (let (# # # # ...) (# args) (let # # #)) cgen -s ./cgen-sim.scm -s . --help Usage: cgen arguments ... -a arch-file - specify path of .cpu file to load -b - use debugging evaluator, for backtraces -d - start interactive debugging session -f flags - specify a set of flags to control code generation -h - print usage information --help - print usage information -i isa-list - specify isa-list entries to keep -m mach-list - specify mach-list entries to keep -s srcdir - set srcdir -t trace-options - specify list of things to trace Options: commands - trace cgen commands (e.g. define-insn) pmacros - trace pmacro expansion all - trace everything -v - increment verbosity level -w diagnostic-options - specify list of things to issue diagnostics about Options: iformat - verify instruction formats are valid all - turn on all diagnostics --version - print version info ERROR: In procedure string-append: ERROR: Wrong type (expecting string): #f