From patchwork Fri Jun 20 21:26:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 1626 Received: (qmail 10353 invoked by alias); 20 Jun 2014 21:26:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 10340 invoked by uid 89); 20 Jun 2014 21:26:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: hera.aquilenet.fr Received: from hera.aquilenet.fr (HELO hera.aquilenet.fr) (141.255.128.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Jun 2014 21:26:11 +0000 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id AD87C2E3B; Fri, 20 Jun 2014 23:26:07 +0200 (CEST) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6OG-sh3H2Qzp; Fri, 20 Jun 2014 23:26:07 +0200 (CEST) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 3159A2CE6; Fri, 20 Jun 2014 23:26:07 +0200 (CEST) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: gdb-patches@sourceware.org, Doug Evans Subject: [PATCH] guile: Remove (gdb init) module, and include 'init.scm'. X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 2 Messidor an 222 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Fri, 20 Jun 2014 23:26:06 +0200 Message-ID: <87tx7fl1ch.fsf@gnu.org> User-Agent: Gnus/5.130009 (Ma Gnus v0.9) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 This patch is a prerequisite for the following (compiling Scheme files). It removes the (gdb init), which had a top-level circular dependency with (gdb), thereby preventing compilation. Thanks, Ludo’. gdb/ 2014-06-20 Ludovic Courtès * guile/guile.c: (gdbscm_init_module_name): Change to "gdb". * guile/lib/gdb.scm: Remove 'use-modules' form and include gdb/init.scm. Change 're-export' to 'export'. Export '*pretty-printers*' and '%assert-type'. * guile/lib/gdb/init.scm: Remove 'define-module' form. (%exception-print-style): Remove. * guile/lib/gdb/boot.scm: Change (gdb init) to (gdb). * guile/lib/gdb/experimental.scm: Remove use of (gdb init). * guile/lib/gdb/types.scm: Likewise. * guile/lib/gdb/printing.scm: Add '%assert-type', 'SCM_ARG1', and '*pretty-printers*' to the selection. --- gdb/guile/guile.c | 2 +- gdb/guile/lib/gdb.scm | 6 ++++-- gdb/guile/lib/gdb/boot.scm | 2 +- gdb/guile/lib/gdb/experimental.scm | 3 +-- gdb/guile/lib/gdb/init.scm | 6 +----- gdb/guile/lib/gdb/printing.scm | 6 +++--- gdb/guile/lib/gdb/types.scm | 1 - 7 files changed, 11 insertions(+), 15 deletions(-) diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c index 00d7b06..b77cbf1 100644 --- a/gdb/guile/guile.c +++ b/gdb/guile/guile.c @@ -105,7 +105,7 @@ static SCM to_string_keyword; /* The name of the various modules (without the surrounding parens). */ const char gdbscm_module_name[] = "gdb"; -const char gdbscm_init_module_name[] = "gdb init"; +const char gdbscm_init_module_name[] = "gdb"; /* The name of the bootstrap file. */ static const char boot_scm_filename[] = "boot.scm"; diff --git a/gdb/guile/lib/gdb.scm b/gdb/guile/lib/gdb.scm index d628f00..8072860 100644 --- a/gdb/guile/lib/gdb.scm +++ b/gdb/guile/lib/gdb.scm @@ -313,6 +313,7 @@ ;; scm-pretty-print.c + *pretty-printers* make-pretty-printer pretty-printer? pretty-printer-enabled? @@ -496,13 +497,14 @@ (add-to-load-path (string-append (data-directory) file-name-separator-string "guile")) -(use-modules ((gdb init))) +(include "gdb/init.scm") ;; These come from other files, but they're really part of this module. -(re-export +(export ;; init.scm + %assert-type orig-input-port orig-output-port orig-error-port diff --git a/gdb/guile/lib/gdb/boot.scm b/gdb/guile/lib/gdb/boot.scm index cf7d305..0d775d4 100644 --- a/gdb/guile/lib/gdb/boot.scm +++ b/gdb/guile/lib/gdb/boot.scm @@ -27,5 +27,5 @@ file-name-separator-string "gdb.scm")) ;; Now that the Scheme side support is loaded, initialize it. -(let ((init-proc (@@ (gdb init) %initialize!))) +(let ((init-proc (@@ (gdb) %initialize!))) (init-proc)) diff --git a/gdb/guile/lib/gdb/experimental.scm b/gdb/guile/lib/gdb/experimental.scm index ffded84..9e5a53e 100644 --- a/gdb/guile/lib/gdb/experimental.scm +++ b/gdb/guile/lib/gdb/experimental.scm @@ -22,8 +22,7 @@ ;; E.g., (gdb experimental ports), etc. (define-module (gdb experimental) - #:use-module (gdb) - #:use-module (gdb init)) + #:use-module (gdb)) ;; These are defined in C. (define-public with-gdb-output-to-port (@@ (gdb) %with-gdb-output-to-port)) diff --git a/gdb/guile/lib/gdb/init.scm b/gdb/guile/lib/gdb/init.scm index 1e90790..d4145e5 100644 --- a/gdb/guile/lib/gdb/init.scm +++ b/gdb/guile/lib/gdb/init.scm @@ -17,8 +17,7 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . -(define-module (gdb init) - #:use-module (gdb)) +;; This file is included by (gdb). (define-public SCM_ARG1 1) (define-public SCM_ARG2 2) @@ -28,9 +27,6 @@ (define %orig-output-port #f) (define %orig-error-port #f) -;; %exception-print-style is exported as "private" by gdb. -(define %exception-print-style (@@ (gdb) %exception-print-style)) - ;; Keys for GDB-generated exceptions. ;; gdb:with-stack is handled separately. diff --git a/gdb/guile/lib/gdb/printing.scm b/gdb/guile/lib/gdb/printing.scm index eac9417..f3d2ad5 100644 --- a/gdb/guile/lib/gdb/printing.scm +++ b/gdb/guile/lib/gdb/printing.scm @@ -19,10 +19,10 @@ (define-module (gdb printing) #:use-module ((gdb) #:select - (*pretty-printers* pretty-printer? objfile? progspace? + (%assert-type SCM_ARG1 + *pretty-printers* pretty-printer? objfile? progspace? objfile-pretty-printers set-objfile-pretty-printers! - progspace-pretty-printers set-progspace-pretty-printers!)) - #:use-module (gdb init)) + progspace-pretty-printers set-progspace-pretty-printers!))) (define-public (prepend-pretty-printer! obj matcher) "Add MATCHER to the beginning of the pretty-printer list for OBJ. diff --git a/gdb/guile/lib/gdb/types.scm b/gdb/guile/lib/gdb/types.scm index 31ea192..d27be2f 100644 --- a/gdb/guile/lib/gdb/types.scm +++ b/gdb/guile/lib/gdb/types.scm @@ -16,7 +16,6 @@ (define-module (gdb types) #:use-module (gdb) - #:use-module (gdb init) #:use-module (gdb iterator)) (define-public (type-has-field-deep? type field-name) -- 1.8.4