Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@igalia.com>
To: gdb-patches@sourceware.org
Cc: Andy Wingo <wingo@igalia.com>
Subject: [PATCH 4/8] Rename "gsmob" in Guile interface to "gdb object"
Date: Wed, 09 Apr 2014 16:09:00 -0000	[thread overview]
Message-ID: <1397059725-18066-8-git-send-email-wingo@igalia.com> (raw)
In-Reply-To: <1397059725-18066-1-git-send-email-wingo@igalia.com>

* gdb/guile/scm-gsmob.c:
* gdb/guile/lib/gdb.scm (gdb-object-kind, gdb-object-property)
  (set-gdb-object-property!, gdb-object-has-property?)
  (gdb-object-properties): Rename from gsmob-kind, gsmob-property, etc.
  The fact that these are SMOBs is a C implementation detail that should
  not be exposed to Scheme.

* gdb/doc/guile.texi (GDB Scheme Data Types): Update the manual.
---
 gdb/doc/guile.texi    | 37 ++++++++++++++++++-------------------
 gdb/guile/lib/gdb.scm | 12 ++++++------
 gdb/guile/scm-gsmob.c | 30 +++++++++++++++---------------
 3 files changed, 39 insertions(+), 40 deletions(-)

diff --git a/gdb/doc/guile.texi b/gdb/doc/guile.texi
index 3f6580e..f7204e9 100644
--- a/gdb/doc/guile.texi
+++ b/gdb/doc/guile.texi
@@ -331,46 +331,45 @@ This is the string passed to @code{--target} when @value{GDBN} was configured.
 
 @node GDB Scheme Data Types
 @subsubsection GDB Scheme Data Types
-@cindex gdb smobs
+@cindex gdb objects
 
-@value{GDBN} uses Guile's @dfn{smob} (small object)
-data type for all @value{GDBN} objects
-(@pxref{Defining New Types (Smobs),,, guile, GNU Guile Reference Manual}).
-The smobs that @value{GDBN} provides are called @dfn{gsmobs}.
+The values exposed by @value{GDBN} to Guile are known as
+@dfn{@value{GDBN} objects}.  There are several kinds of @value{GDBN}
+object, and each is disjoint from all other types known to Guile.
 
-@deffn {Scheme Procedure} gsmob-kind gsmob
-Return the kind of the gsmob, e.g., @code{<gdb:breakpoint>},
+@deffn {Scheme Procedure} gdb-object-kind object
+Return the kind of the @value{GDBN} object, e.g., @code{<gdb:breakpoint>},
 as a symbol.
 @end deffn
 
-Every @code{gsmob} provides a common set of functions for extending
-them in simple ways.  Each @code{gsmob} has a list of properties,
-initially empty.  These properties are akin to Guile's object properties,
-but are stored with the @code{gsmob}
+Every @value{GDBN} object provides a common set of functions for
+extending them in simple ways.  Each @value{GDBN} object has a list of
+properties, initially empty.  These properties are akin to Guile's
+object properties, but are stored with the @value{GDBN} object
 (@pxref{Object Properties,,, guile, GNU Guile Reference Manual}).
 Property names can be any @code{eq?}-able value, but it is recommended
 that they be symbols.
 
-@deffn {Scheme Procedure} set-gsmob-property! gsmob property-name value
+@deffn {Scheme Procedure} set-gdb-object-property! object property-name value
 Set the value of property @code{property-name} to value @code{value}.
 The result is unspecified.
 @end deffn
 
-@deffn {Scheme Procedure} gsmob-property gsmob property-name
+@deffn {Scheme Procedure} gdb-object-property object property-name
 Return the value of property @code{property-name}.
 If the property isn't present then @code{#f} is returned.
 @end deffn
 
-@deffn {Scheme Procedure} gsmob-has-property? gsmob property-name
-Return @code{#t} if @code{gsmob} has property @code{property-name}.
+@deffn {Scheme Procedure} gdb-object-has-property? object property-name
+Return @code{#t} if @value{GDBN} object has property @code{property-name}.
 Otherwise return @code{#f}.
 @end deffn
 
-@deffn {Scheme Procedure} gsmob-properties gsmob
+@deffn {Scheme Procedure} gdb-object-properties object
 Return an unsorted list of names of properties.
 @end deffn
 
-@value{GDBN} defines the following Scheme smobs:
+@value{GDBN} defines the following object types:
 
 @table @code
 @item <gdb:arch>
@@ -425,8 +424,8 @@ Return an unsorted list of names of properties.
 @xref{Values From Inferior In Guile}.
 @end table
 
-The following gsmobs are managed internally so that the Scheme function
-@code{eq?} may be applied to them.
+The following @value{GDBN} objects are managed internally so that the
+Scheme function @code{eq?} may be applied to them.
 
 @table @code
 @item <gdb:arch>
diff --git a/gdb/guile/lib/gdb.scm b/gdb/guile/lib/gdb.scm
index f12769e..57d6472 100644
--- a/gdb/guile/lib/gdb.scm
+++ b/gdb/guile/lib/gdb.scm
@@ -270,13 +270,13 @@
  make-pretty-printer-worker
  pretty-printer-worker?
 
- ;; scm-smob.c
+ ;; scm-gsmob.c
 
- gsmob-kind
- gsmob-property
- set-gsmob-property!
- gsmob-has-property?
- gsmob-properties
+ gdb-object-kind
+ gdb-object-property
+ set-gdb-object-property!
+ gdb-object-has-property?
+ gdb-object-properties
 
  ;; scm-string.c
 
diff --git a/gdb/guile/scm-gsmob.c b/gdb/guile/scm-gsmob.c
index b0f9e19..4ba9770 100644
--- a/gdb/guile/scm-gsmob.c
+++ b/gdb/guile/scm-gsmob.c
@@ -48,7 +48,7 @@
 
    Gsmobs (and chained/eqable gsmobs) add an extra field that is used to
    record extra data: "properties".  It is a table of key/value pairs
-   that can be set with set-gsmob-property!, gsmob-property.  */
+   that can be set with set-gdb-object-property!, gdb-object-property.  */
 
 #include "defs.h"
 #include "hashtab.h"
@@ -212,9 +212,9 @@ gsscm_get_gsmob_arg_unsafe (SCM self, int arg_pos, const char *func_name)
   return self;
 }
 
-/* (gsmob-kind gsmob) -> symbol
+/* (gdb-object-kind gsmob) -> symbol
 
-   Note: While one might want to name this gsmob-class-name, it is named
+   Note: While one might want to name this gdb-object-class-name, it is named
    "-kind" because smobs aren't real GOOPS classes.  */
 
 static SCM
@@ -236,7 +236,7 @@ gdbscm_gsmob_kind (SCM self)
   return result;
 }
 
-/* (gsmob-property gsmob property) -> object
+/* (gdb-object-property gsmob property) -> object
    If property isn't present then #f is returned.  */
 
 static SCM
@@ -255,7 +255,7 @@ gdbscm_gsmob_property (SCM self, SCM property)
   return scm_assq_ref (base->properties, property);
 }
 
-/* (set-gsmob-property! gsmob property new-value) -> unspecified */
+/* (set-gdb-object-property! gsmob property new-value) -> unspecified */
 
 static SCM
 gdbscm_set_gsmob_property_x (SCM self, SCM property, SCM new_value)
@@ -296,7 +296,7 @@ gdbscm_set_gsmob_property_x (SCM self, SCM property, SCM new_value)
   return SCM_UNSPECIFIED;
 }
 
-/* (gsmob-has-property? gsmob property) -> boolean */
+/* (gdb-object-has-property? gsmob property) -> boolean */
 
 static SCM
 gdbscm_gsmob_has_property_p (SCM self, SCM property)
@@ -326,7 +326,7 @@ add_property_name (void *closure, SCM handle)
   return SCM_UNSPECIFIED;
 }
 
-/* (gsmob-properties gsmob) -> list
+/* (gdb-object-properties gsmob) -> list
    The list is unsorted.  */
 
 static SCM
@@ -449,23 +449,23 @@ gdbscm_clear_eqable_gsmob_ptr_slot (htab_t htab, eqable_gdb_smob *base)
 
 static const scheme_function gsmob_functions[] =
 {
-  { "gsmob-kind", 1, 0, 0, gdbscm_gsmob_kind,
+  { "gdb-object-kind", 1, 0, 0, gdbscm_gsmob_kind,
     "\
-Return the kind of the smob, e.g., <gdb:breakpoint>, as a symbol." },
+Return the kind of the GDB object, e.g., <gdb:breakpoint>, as a symbol." },
 
-  { "gsmob-property", 2, 0, 0, gdbscm_gsmob_property,
+  { "gdb-object-property", 2, 0, 0, gdbscm_gsmob_property,
     "\
-Return the specified property of the gsmob." },
+Return the specified property of the GDB object." },
 
-  { "set-gsmob-property!", 3, 0, 0, gdbscm_set_gsmob_property_x,
+  { "set-gdb-object-property!", 3, 0, 0, gdbscm_set_gsmob_property_x,
     "\
-Set the specified property of the gsmob." },
+Set the specified property of the GDB object." },
 
-  { "gsmob-has-property?", 2, 0, 0, gdbscm_gsmob_has_property_p,
+  { "gdb-object-has-property?", 2, 0, 0, gdbscm_gsmob_has_property_p,
     "\
 Return #t if the specified property is present." },
 
-  { "gsmob-properties", 1, 0, 0, gdbscm_gsmob_properties,
+  { "gdb-object-properties", 1, 0, 0, gdbscm_gsmob_properties,
     "\
 Return an unsorted list of names of properties." },
 
-- 
1.9.1


  parent reply	other threads:[~2014-04-09 16:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 16:09 [PATCH 0/8] Cleanups to Guile extension interface Andy Wingo
2014-04-09 16:09 ` [PATCH 8/9] Remove useless Guile SMOB marking functions Andy Wingo
2014-04-09 16:09 ` [PATCH 3/8] Fix typos in documentation of Guile `execute' function Andy Wingo
2014-04-09 16:35   ` Eli Zaretskii
2014-04-09 16:09 ` [PATCH 4/9] " Andy Wingo
2014-04-09 16:09 ` [PATCH 6/9] Remove Guile GDB object property mechanism Andy Wingo
2014-04-09 16:09 ` [PATCH 8/8] Remove a useless Guile finalizer Andy Wingo
2014-04-09 16:09 ` [PATCH 2/9] Define and export Guile classes for all GDB object types Andy Wingo
2014-04-09 16:09 ` [PATCH 6/8] Remove Guile mark functions that don't mark anything Andy Wingo
2014-04-09 16:09 ` [PATCH 3/9] Fix excess parentheses in Guile extension examples Andy Wingo
2014-04-09 16:09 ` [PATCH 7/8] Remove useless Guile SMOB marking functions Andy Wingo
2014-04-09 16:09 ` [PATCH 7/9] Remove Guile mark functions that don't mark anything Andy Wingo
2014-04-09 16:09 ` [PATCH 1/9] Allow GDB to build against unreleased Guile 2.2 Andy Wingo
2014-04-09 16:09 ` [PATCH 5/8] Remove Guile GDB object property mechanism Andy Wingo
2014-04-09 16:37   ` Eli Zaretskii
2014-04-09 16:09 ` Andy Wingo [this message]
2014-04-09 16:36   ` [PATCH 4/8] Rename "gsmob" in Guile interface to "gdb object" Eli Zaretskii
2014-04-09 16:09 ` [PATCH 9/9] Remove a useless Guile finalizer Andy Wingo
2014-04-09 16:09 ` [PATCH 2/8] Fix excess parentheses in Guile extension examples Andy Wingo
2014-04-09 16:33   ` Eli Zaretskii
2014-04-09 16:09 ` [PATCH 5/9] Rename "gsmob" in Guile interface to "gdb object" Andy Wingo

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=1397059725-18066-8-git-send-email-wingo@igalia.com \
    --to=wingo@igalia.com \
    --cc=gdb-patches@sourceware.org \
    /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