From patchwork Mon Nov 7 01:17:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 17241 Received: (qmail 84177 invoked by alias); 7 Nov 2016 01:17:22 -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 84135 invoked by uid 89); 7 Nov 2016 01:17:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1580, scm, SCM, H*MI:google X-HELO: mail-pf0-f201.google.com Received: from mail-pf0-f201.google.com (HELO mail-pf0-f201.google.com) (209.85.192.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Nov 2016 01:17:19 +0000 Received: by mail-pf0-f201.google.com with SMTP id f81so193713pfa.2 for ; Sun, 06 Nov 2016 17:17:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:message-id:date:subject:from:to; bh=2xZcEiBnIwVz3CqEaHjHWfghCbnaR+GP3JJXZ/TJlQU=; b=hTKfR+iltAodDAytuDS84RwUDy6/cyJL6KqHuOSE0spZEwAzvdq+GZObOItJ9dFf4R bCmutLzb/Y2ivnQJT+hZ55Rltr9A47uE9k0ASG9dS7ndR8VVUDfX24loBou7jGCzuOJE 6aW0PHQsu08IWYmn00bSPnAxOt3gkKb+wCcHL11nE2Fq3B8SlVP0nRU9n7QCFtF9fvvt DzMEh5ti9KC2HfFtAJioWwYZwSVnAVNZ74E6/w6guB+xKaX8i/P9F5gdwB0Q1zjforDs Roq+skRix03Eif1VEmlpeJHI/41o2q1tCfV67yuz0YEi6AfIZoL6f3pbcewS59VWMnBx qHhA== X-Gm-Message-State: ABUngveJdJxu8HMTGj3B7V8edGi9l07HZDD+jXqBhMZgFriE1F5Bk2boQADuUdvbIhZ/PDV+rB6MBOVwE13rjT1rgLaGN58034tSQ7hzxrEQyvIO45yNP6IwNges2BNejDGQmLbwZsnNtfaJKaQuL3wViwMveQzi8aLSPh3uzkUdnoW8IGbZTg== MIME-Version: 1.0 X-Received: by 10.98.15.91 with SMTP id x88mr1400678pfi.34.1478481438090; Sun, 06 Nov 2016 17:17:18 -0800 (PST) Message-ID: <001a11c05fa2ed28760540abc807@google.com> Date: Mon, 07 Nov 2016 01:17:18 +0000 Subject: [PATCH 3/4] Fix some aspects of python lazy string handling: scheme addition From: Doug Evans To: gdb-patches@sourceware.org, eliz@gnu.org, pmuldoon@redhat.com X-IsSubscribed: yes 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 * guile/guile-internal.h (tyscm_scm_to_type): Declare. * guile/scm-type.c (tyscm_scm_to_type): New function. static int 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 . + 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. */