Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: gdb-patches@sourceware.org, Doug Evans <xdje42@gmail.com>
Subject: [PATCH] guile: Remove (gdb init) module, and include 'init.scm'.
Date: Fri, 20 Jun 2014 21:26:00 -0000	[thread overview]
Message-ID: <87tx7fl1ch.fsf@gnu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]

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  <ludo@gnu.org>

	* 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(-)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 3889 bytes --]

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 <http://www.gnu.org/licenses/>.
 
-(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

             reply	other threads:[~2014-06-20 21:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 21:26 Ludovic Courtès [this message]
2014-07-12  5:01 ` Doug Evans
2014-07-12 14:55   ` Ludovic Courtès
2014-07-12 17:42     ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tx7fl1ch.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=xdje42@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox