public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 3/4] Fix some aspects of python lazy string handling: scheme addition
@ 2016-11-07  1:17 Doug Evans
  2017-03-16 16:43 ` Doug Evans via gdb-patches
  0 siblings, 1 reply; 2+ messages in thread
From: Doug Evans @ 2016-11-07  1:17 UTC (permalink / raw)
  To: gdb-patches, eliz, pmuldoon

Hi. This is a simple internal addition to the scheme support.

I separated it out for myself, as it helped to keep the python and scheme
sides comparable.

2016-11-06  Doug Evans  <dje@google.com>

	* guile/guile-internal.h (tyscm_scm_to_type): Declare.
	* guile/scm-type.c (tyscm_scm_to_type): New function.

diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h
index 5f819b8..3597706 100644
--- a/gdb/guile/guile-internal.h
+++ b/gdb/guile/guile-internal.h
@@ -561,6 +561,8 @@ extern SCM tyscm_scm_from_type (struct type *type);
  extern type_smob *tyscm_get_type_smob_arg_unsafe (SCM type_scm, int  
arg_pos,
  						  const char *func_name);

+extern struct type *tyscm_scm_to_type (SCM t_scm);
+
  extern struct type *tyscm_type_smob_type (type_smob *t_smob);

  extern SCM tyscm_scm_from_field (SCM type_scm, int field_num);
diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c
index 2acdfad..35d6588 100644
--- a/gdb/guile/scm-type.c
+++ b/gdb/guile/scm-type.c
@@ -347,6 +347,19 @@ tyscm_get_type_smob_arg_unsafe (SCM self, int arg_pos,  
const char *func_name)
    return t_smob;
  }

+/* Return the type field of T_SCM, an object of type <gdb:type>.
+   This exists so that we don't have to export the struct's contents.  */
+
+struct type *
+tyscm_scm_to_type (SCM t_scm)
+{
+  type_smob *t_smob;
+
+  gdb_assert (tyscm_is_type (t_scm));
+  t_smob = (type_smob *) SCM_SMOB_DATA (t_scm);
+  return t_smob->type;
+}
+
  /* Helper function for save_objfile_types to make a deep copy of the  
type.  */

  static int

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/4] Fix some aspects of python lazy string handling: scheme addition
  2016-11-07  1:17 [PATCH 3/4] Fix some aspects of python lazy string handling: scheme addition Doug Evans
@ 2017-03-16 16:43 ` Doug Evans via gdb-patches
  0 siblings, 0 replies; 2+ messages in thread
From: Doug Evans via gdb-patches @ 2017-03-16 16:43 UTC (permalink / raw)
  To: gdb-patches, Eli Zaretskii, Phil Muldoon

On Sun, Nov 6, 2016 at 5:17 PM, Doug Evans <dje@google.com> wrote:
> Hi. This is a simple internal addition to the scheme support.
>
> I separated it out for myself, as it helped to keep the python and scheme
> sides comparable.
>
> 2016-11-06  Doug Evans  <dje@google.com>
>
>         * guile/guile-internal.h (tyscm_scm_to_type): Declare.
>         * guile/scm-type.c (tyscm_scm_to_type): New function.

Re-reg-tested on amd64-linux and committed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-16 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07  1:17 [PATCH 3/4] Fix some aspects of python lazy string handling: scheme addition Doug Evans
2017-03-16 16:43 ` Doug Evans via gdb-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).