aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile/scm-arch.c
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2014-02-09 19:40:01 -0800
committerDoug Evans <xdje42@gmail.com>2014-02-09 19:40:01 -0800
commited3ef33944c39d9a3cea72b9a7cef3c20f0e3461 (patch)
tree4e67d95b8ea65bb36a9cade5e37df2ad6289052e /gdb/guile/scm-arch.c
parent7026a7c16ee82d39e84823f8cc3097a9a940ddb2 (diff)
downloadgdb-ed3ef33944c39d9a3cea72b9a7cef3c20f0e3461.zip
gdb-ed3ef33944c39d9a3cea72b9a7cef3c20f0e3461.tar.gz
gdb-ed3ef33944c39d9a3cea72b9a7cef3c20f0e3461.tar.bz2
Add Guile as an extension language.
* NEWS: Mention Guile scripting. * Makefile.in (SUBDIR_GUILE_OBS): New variable. (SUBDIR_GUILE_SRCS, SUBDIR_GUILE_DEPS): New variables (SUBDIR_GUILE_LDFLAGS, SUBDIR_GUILE_CFLAGS): New variables. (INTERNAL_CPPFLAGS): Add GUILE_CPPFLAGS. (CLIBS): Add GUILE_LIBS. (install-guile): New rule. (guile.o): New rule. (scm-arch.o, scm-auto-load.o, scm-block.o): New rules. (scm-breakpoint.o, scm-disasm.o, scm-exception.o): New rules. (scm-frame.o, scm-iterator.o, scm-lazy-string.o): New rules. (scm-math.o, scm-objfile.o, scm-ports.o): New rules. (scm-pretty-print.o, scm-safe-call.o, scm-gsmob.o): New rules. (scm-string.o, scm-symbol.o, scm-symtab.o): New rules. (scm-type.o, scm-utils.o, scm-value.o): New rules. * configure.ac: New option --with-guile. * configure: Regenerate. * config.in: Regenerate. * auto-load.c: Remove #include "python/python.h". Add #include "gdb/section-scripts.h". (source_section_scripts): Handle Guile scripts. (_initialize_auto_load): Add name of Guile objfile script to scripts-directory help text. * breakpoint.c (condition_command): Tweak comment to include Scheme. * breakpoint.h (gdbscm_breakpoint_object): Add forward decl. (struct breakpoint): New member scm_bp_object. * defs.h (enum command_control_type): New value guile_control. * cli/cli-cmds.c: Remove #include "python/python.h". Add #include "extension.h". (show_user): Update comment. (_initialize_cli_cmds): Update help text for "show user". Update help text for max-user-call-depth. * cli/cli-script.c: Remove #include "python/python.h". Add #include "extension.h". (multi_line_command_p): Add guile_control. (print_command_lines): Handle guile_control. (execute_control_command, recurse_read_control_structure): Ditto. (process_next_line): Recognize "guile" commands. * disasm.c (gdb_disassemble_info): Make non-static. * disasm.h: #include "dis-asm.h". (struct gdbarch): Add forward decl. (gdb_disassemble_info): Declare. * extension.c: #include "guile/guile.h". (extension_languages): Add guile. (get_ext_lang_defn): Handle EXT_LANG_GDB. * extension.h (enum extension_language): New value EXT_LANG_GUILE. * gdbtypes.c (get_unsigned_type_max): New function. (get_signed_type_minmax): New function. * gdbtypes.h (get_unsigned_type_max): Declare. (get_signed_type_minmax): Declare. * guile/README: New file. * guile/guile-internal.h: New file. * guile/guile.c: New file. * guile/guile.h: New file. * guile/scm-arch.c: New file. * guile/scm-auto-load.c: New file. * guile/scm-block.c: New file. * guile/scm-breakpoint.c: New file. * guile/scm-disasm.c: New file. * guile/scm-exception.c: New file. * guile/scm-frame.c: New file. * guile/scm-gsmob.c: New file. * guile/scm-iterator.c: New file. * guile/scm-lazy-string.c: New file. * guile/scm-math.c: New file. * guile/scm-objfile.c: New file. * guile/scm-ports.c: New file. * guile/scm-pretty-print.c: New file. * guile/scm-safe-call.c: New file. * guile/scm-string.c: New file. * guile/scm-symbol.c: New file. * guile/scm-symtab.c: New file. * guile/scm-type.c: New file. * guile/scm-utils.c: New file. * guile/scm-value.c: New file. * guile/lib/gdb.scm: New file. * guile/lib/gdb/boot.scm: New file. * guile/lib/gdb/experimental.scm: New file. * guile/lib/gdb/init.scm: New file. * guile/lib/gdb/iterator.scm: New file. * guile/lib/gdb/printing.scm: New file. * guile/lib/gdb/types.scm: New file. * data-directory/Makefile.in (GUILE_SRCDIR): New variable. (VPATH): Add $(GUILE_SRCDIR). (GUILE_DIR): New variable. (GUILE_INSTALL_DIR, GUILE_FILES): New variables. (all): Add stamp-guile dependency. (stamp-guile): New rule. (clean-guile, install-guile, uninstall-guile): New rules. (install-only): Add install-guile dependency. (uninstall): Add uninstall-guile dependency. (clean): Add clean-guile dependency. doc/ * Makefile.in (GDB_DOC_FILES): Add guile.texi. * gdb.texinfo (Auto-loading): Add set/show auto-load guile-scripts. (Extending GDB): New menu entries Guile, Multiple Extension Languages. (Guile docs): Include guile.texi. (objfile-gdbdotext file): Add objfile-gdb.scm. (dotdebug_gdb_scripts section): Mention Guile scripts. (Multiple Extension Languages): New node. * guile.texi: New file. testsuite/ * configure.ac (AC_OUTPUT): Add gdb.guile. * configure: Regenerate. * lib/gdb-guile.exp: New file. * lib/gdb.exp (get_target_charset): New function. * gdb.base/help.exp: Update expected output from "apropos apropos". * gdb.guile/Makefile.in: New file. * gdb.guile/guile.exp: New file. * gdb.guile/scm-arch.c: New file. * gdb.guile/scm-arch.exp: New file. * gdb.guile/scm-block.c: New file. * gdb.guile/scm-block.exp: New file. * gdb.guile/scm-breakpoint.c: New file. * gdb.guile/scm-breakpoint.exp: New file. * gdb.guile/scm-disasm.c: New file. * gdb.guile/scm-disasm.exp: New file. * gdb.guile/scm-equal.c: New file. * gdb.guile/scm-equal.exp: New file. * gdb.guile/scm-error.exp: New file. * gdb.guile/scm-error.scm: New file. * gdb.guile/scm-frame-args.c: New file. * gdb.guile/scm-frame-args.exp: New file. * gdb.guile/scm-frame-args.scm: New file. * gdb.guile/scm-frame-inline.c: New file. * gdb.guile/scm-frame-inline.exp: New file. * gdb.guile/scm-frame.c: New file. * gdb.guile/scm-frame.exp: New file. * gdb.guile/scm-generics.exp: New file. * gdb.guile/scm-gsmob.exp: New file. * gdb.guile/scm-iterator.c: New file. * gdb.guile/scm-iterator.exp: New file. * gdb.guile/scm-math.c: New file. * gdb.guile/scm-math.exp: New file. * gdb.guile/scm-objfile-script-gdb.in: New file. * gdb.guile/scm-objfile-script.c: New file. * gdb.guile/scm-objfile-script.exp: New file. * gdb.guile/scm-objfile.c: New file. * gdb.guile/scm-objfile.exp: New file. * gdb.guile/scm-ports.exp: New file. * gdb.guile/scm-pretty-print.c: New file. * gdb.guile/scm-pretty-print.exp: New file. * gdb.guile/scm-pretty-print.scm: New file. * gdb.guile/scm-section-script.c: New file. * gdb.guile/scm-section-script.exp: New file. * gdb.guile/scm-section-script.scm: New file. * gdb.guile/scm-symbol.c: New file. * gdb.guile/scm-symbol.exp: New file. * gdb.guile/scm-symtab-2.c: New file. * gdb.guile/scm-symtab.c: New file. * gdb.guile/scm-symtab.exp: New file. * gdb.guile/scm-type.c: New file. * gdb.guile/scm-type.exp: New file. * gdb.guile/scm-value-cc.cc: New file. * gdb.guile/scm-value-cc.exp: New file. * gdb.guile/scm-value.c: New file. * gdb.guile/scm-value.exp: New file. * gdb.guile/source2.scm: New file. * gdb.guile/types-module.cc: New file. * gdb.guile/types-module.exp: New file.
Diffstat (limited to 'gdb/guile/scm-arch.c')
-rw-r--r--gdb/guile/scm-arch.c668
1 files changed, 668 insertions, 0 deletions
diff --git a/gdb/guile/scm-arch.c b/gdb/guile/scm-arch.c
new file mode 100644
index 0000000..fa578f3
--- /dev/null
+++ b/gdb/guile/scm-arch.c
@@ -0,0 +1,668 @@
+/* Scheme interface to architecture.
+
+ Copyright (C) 2014 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* See README file in this directory for implementation notes, coding
+ conventions, et.al. */
+
+#include "defs.h"
+#include "charset.h"
+#include "gdbarch.h"
+#include "arch-utils.h"
+#include "guile-internal.h"
+
+/* The <gdb:arch> smob.
+ The typedef for this struct is in guile-internal.h. */
+
+struct _arch_smob
+{
+ /* This always appears first. */
+ gdb_smob base;
+
+ struct gdbarch *gdbarch;
+};
+
+static const char arch_smob_name[] = "gdb:arch";
+
+/* The tag Guile knows the arch smob by. */
+static scm_t_bits arch_smob_tag;
+
+static struct gdbarch_data *arch_object_data = NULL;
+
+static int arscm_is_arch (SCM);
+
+/* Administrivia for arch smobs. */
+
+/* The smob "mark" function for <gdb:arch>. */
+
+static SCM
+arscm_mark_arch_smob (SCM self)
+{
+ arch_smob *a_smob = (arch_smob *) SCM_SMOB_DATA (self);
+
+ /* Do this last. */
+ return gdbscm_mark_gsmob (&a_smob->base);
+}
+
+/* The smob "print" function for <gdb:arch>. */
+
+static int
+arscm_print_arch_smob (SCM self, SCM port, scm_print_state *pstate)
+{
+ arch_smob *a_smob = (arch_smob *) SCM_SMOB_DATA (self);
+ struct gdbarch *gdbarch = a_smob->gdbarch;
+
+ gdbscm_printf (port, "#<%s", arch_smob_name);
+ gdbscm_printf (port, " %s", gdbarch_bfd_arch_info (gdbarch)->printable_name);
+ scm_puts (">", port);
+
+ scm_remember_upto_here_1 (self);
+
+ /* Non-zero means success. */
+ return 1;
+}
+
+/* Low level routine to create a <gdb:arch> object for GDBARCH. */
+
+static SCM
+arscm_make_arch_smob (struct gdbarch *gdbarch)
+{
+ arch_smob *a_smob = (arch_smob *)
+ scm_gc_malloc (sizeof (arch_smob), arch_smob_name);
+ SCM a_scm;
+
+ a_smob->gdbarch = gdbarch;
+ a_scm = scm_new_smob (arch_smob_tag, (scm_t_bits) a_smob);
+ gdbscm_init_gsmob (&a_smob->base);
+
+ return a_scm;
+}
+
+/* Return the gdbarch field of A_SMOB. */
+
+struct gdbarch *
+arscm_get_gdbarch (arch_smob *a_smob)
+{
+ return a_smob->gdbarch;
+}
+
+/* Return non-zero if SCM is an architecture smob. */
+
+static int
+arscm_is_arch (SCM scm)
+{
+ return SCM_SMOB_PREDICATE (arch_smob_tag, scm);
+}
+
+/* (arch? object) -> boolean */
+
+static SCM
+gdbscm_arch_p (SCM scm)
+{
+ return scm_from_bool (arscm_is_arch (scm));
+}
+
+/* Associates an arch_object with GDBARCH as gdbarch_data via the gdbarch
+ post init registration mechanism (gdbarch_data_register_post_init). */
+
+static void *
+arscm_object_data_init (struct gdbarch *gdbarch)
+{
+ SCM arch_scm = arscm_make_arch_smob (gdbarch);
+
+ /* This object lasts the duration of the GDB session, so there is no
+ call to scm_gc_unprotect_object for it. */
+ scm_gc_protect_object (arch_scm);
+
+ return (void *) arch_scm;
+}
+
+/* Return the <gdb:arch> object corresponding to GDBARCH.
+ The object is cached in GDBARCH so this is simple. */
+
+SCM
+arscm_scm_from_arch (struct gdbarch *gdbarch)
+{
+ SCM a_scm = (SCM) gdbarch_data (gdbarch, arch_object_data);
+
+ return a_scm;
+}
+
+/* Return the <gdb:arch> smob in SELF.
+ Throws an exception if SELF is not a <gdb:arch> object. */
+
+static SCM
+arscm_get_arch_arg_unsafe (SCM self, int arg_pos, const char *func_name)
+{
+ SCM_ASSERT_TYPE (arscm_is_arch (self), self, arg_pos, func_name,
+ arch_smob_name);
+
+ return self;
+}
+
+/* Return a pointer to the arch smob of SELF.
+ Throws an exception if SELF is not a <gdb:arch> object. */
+
+arch_smob *
+arscm_get_arch_smob_arg_unsafe (SCM self, int arg_pos, const char *func_name)
+{
+ SCM a_scm = arscm_get_arch_arg_unsafe (self, arg_pos, func_name);
+ arch_smob *a_smob = (arch_smob *) SCM_SMOB_DATA (a_scm);
+
+ return a_smob;
+}
+
+/* Arch methods. */
+
+/* (current-arch) -> <gdb:arch>
+ Return the architecture of the currently selected stack frame,
+ if there is one, or the current target if there isn't. */
+
+static SCM
+gdbscm_current_arch (void)
+{
+ return arscm_scm_from_arch (get_current_arch ());
+}
+
+/* (arch-name <gdb:arch>) -> string
+ Return the name of the architecture as a string value. */
+
+static SCM
+gdbscm_arch_name (SCM self)
+{
+ arch_smob *a_smob
+ = arscm_get_arch_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
+ struct gdbarch *gdbarch = a_smob->gdbarch;
+ const char *name;
+
+ name = (gdbarch_bfd_arch_info (gdbarch))->printable_name;
+
+ return gdbscm_scm_from_c_string (name);
+}
+
+/* (arch-charset <gdb:arch>) -> string */
+
+static SCM
+gdbscm_arch_charset (SCM self)
+{
+ arch_smob *a_smob
+ =arscm_get_arch_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
+ struct gdbarch *gdbarch = a_smob->gdbarch;
+
+ return gdbscm_scm_from_c_string (target_charset (gdbarch));
+}
+
+/* (arch-wide-charset <gdb:arch>) -> string */
+
+static SCM
+gdbscm_arch_wide_charset (SCM self)
+{
+ arch_smob *a_smob
+ = arscm_get_arch_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
+ struct gdbarch *gdbarch = a_smob->gdbarch;
+
+ return gdbscm_scm_from_c_string (target_wide_charset (gdbarch));
+}
+
+/* Builtin types.
+
+ The order the types are defined here follows the order in
+ struct builtin_type. */
+
+/* Helper routine to return a builtin type for <gdb:arch> object SELF.
+ OFFSET is offsetof (builtin_type, the_type).
+ Throws an exception if SELF is not a <gdb:arch> object. */
+
+static const struct builtin_type *
+gdbscm_arch_builtin_type (SCM self, const char *func_name)
+{
+ arch_smob *a_smob
+ = arscm_get_arch_smob_arg_unsafe (self, SCM_ARG1, func_name);
+ struct gdbarch *gdbarch = a_smob->gdbarch;
+
+ return builtin_type (gdbarch);
+}
+
+/* (arch-void-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_void_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_void;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-char-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_char_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_char;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-short-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_short_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_short;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-int-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_int_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_int;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-long-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_long_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_long;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-schar-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_schar_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_signed_char;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-uchar-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_uchar_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_unsigned_char;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-ushort-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_ushort_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_unsigned_short;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-uint-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_uint_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_unsigned_int;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-ulong-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_ulong_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_unsigned_long;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-float-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_float_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_float;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-double-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_double_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_double;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-longdouble-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_longdouble_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_long_double;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-bool-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_bool_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_bool;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-longlong-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_longlong_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_long_long;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-ulonglong-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_ulonglong_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_unsigned_long_long;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-int8-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_int8_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_int8;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-uint8-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_uint8_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_uint8;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-int16-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_int16_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_int16;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-uint16-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_uint16_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_uint16;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-int32-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_int32_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_int32;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-uint32-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_uint32_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_uint32;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-int64-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_int64_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_int64;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* (arch-uint64-type <gdb:arch>) -> <gdb:type> */
+
+static SCM
+gdbscm_arch_uint64_type (SCM self)
+{
+ struct type *type
+ = gdbscm_arch_builtin_type (self, FUNC_NAME)->builtin_uint64;
+
+ return tyscm_scm_from_type (type);
+}
+
+/* Initialize the Scheme architecture support. */
+
+static const scheme_function arch_functions[] =
+{
+ { "arch?", 1, 0, 0, gdbscm_arch_p,
+ "\
+Return #t if the object is a <gdb:arch> object." },
+
+ { "current-arch", 0, 0, 0, gdbscm_current_arch,
+ "\
+Return the <gdb:arch> object representing the architecture of the\n\
+currently selected stack frame, if there is one, or the architecture of the\n\
+current target if there isn't.\n\
+\n\
+ Arguments: none" },
+
+ { "arch-name", 1, 0, 0, gdbscm_arch_name,
+ "\
+Return the name of the architecture." },
+
+ { "arch-charset", 1, 0, 0, gdbscm_arch_charset,
+ "\
+Return name of target character set as a string." },
+
+ { "arch-wide-charset", 1, 0, 0, gdbscm_arch_wide_charset,
+ "\
+Return name of target wide character set as a string." },
+
+ { "arch-void-type", 1, 0, 0, gdbscm_arch_void_type,
+ "\
+Return the <gdb:type> object for the \"void\" type\n\
+of the architecture." },
+
+ { "arch-char-type", 1, 0, 0, gdbscm_arch_char_type,
+ "\
+Return the <gdb:type> object for the \"char\" type\n\
+of the architecture." },
+
+ { "arch-short-type", 1, 0, 0, gdbscm_arch_short_type,
+ "\
+Return the <gdb:type> object for the \"short\" type\n\
+of the architecture." },
+
+ { "arch-int-type", 1, 0, 0, gdbscm_arch_int_type,
+ "\
+Return the <gdb:type> object for the \"int\" type\n\
+of the architecture." },
+
+ { "arch-long-type", 1, 0, 0, gdbscm_arch_long_type,
+ "\
+Return the <gdb:type> object for the \"long\" type\n\
+of the architecture." },
+
+ { "arch-schar-type", 1, 0, 0, gdbscm_arch_schar_type,
+ "\
+Return the <gdb:type> object for the \"signed char\" type\n\
+of the architecture." },
+
+ { "arch-uchar-type", 1, 0, 0, gdbscm_arch_uchar_type,
+ "\
+Return the <gdb:type> object for the \"unsigned char\" type\n\
+of the architecture." },
+
+ { "arch-ushort-type", 1, 0, 0, gdbscm_arch_ushort_type,
+ "\
+Return the <gdb:type> object for the \"unsigned short\" type\n\
+of the architecture." },
+
+ { "arch-uint-type", 1, 0, 0, gdbscm_arch_uint_type,
+ "\
+Return the <gdb:type> object for the \"unsigned int\" type\n\
+of the architecture." },
+
+ { "arch-ulong-type", 1, 0, 0, gdbscm_arch_ulong_type,
+ "\
+Return the <gdb:type> object for the \"unsigned long\" type\n\
+of the architecture." },
+
+ { "arch-float-type", 1, 0, 0, gdbscm_arch_float_type,
+ "\
+Return the <gdb:type> object for the \"float\" type\n\
+of the architecture." },
+
+ { "arch-double-type", 1, 0, 0, gdbscm_arch_double_type,
+ "\
+Return the <gdb:type> object for the \"double\" type\n\
+of the architecture." },
+
+ { "arch-longdouble-type", 1, 0, 0, gdbscm_arch_longdouble_type,
+ "\
+Return the <gdb:type> object for the \"long double\" type\n\
+of the architecture." },
+
+ { "arch-bool-type", 1, 0, 0, gdbscm_arch_bool_type,
+ "\
+Return the <gdb:type> object for the \"bool\" type\n\
+of the architecture." },
+
+ { "arch-longlong-type", 1, 0, 0, gdbscm_arch_longlong_type,
+ "\
+Return the <gdb:type> object for the \"long long\" type\n\
+of the architecture." },
+
+ { "arch-ulonglong-type", 1, 0, 0,
+ gdbscm_arch_ulonglong_type,
+ "\
+Return the <gdb:type> object for the \"unsigned long long\" type\n\
+of the architecture." },
+
+ { "arch-int8-type", 1, 0, 0, gdbscm_arch_int8_type,
+ "\
+Return the <gdb:type> object for the \"int8\" type\n\
+of the architecture." },
+
+ { "arch-uint8-type", 1, 0, 0, gdbscm_arch_uint8_type,
+ "\
+Return the <gdb:type> object for the \"uint8\" type\n\
+of the architecture." },
+
+ { "arch-int16-type", 1, 0, 0, gdbscm_arch_int16_type,
+ "\
+Return the <gdb:type> object for the \"int16\" type\n\
+of the architecture." },
+
+ { "arch-uint16-type", 1, 0, 0, gdbscm_arch_uint16_type,
+ "\
+Return the <gdb:type> object for the \"uint16\" type\n\
+of the architecture." },
+
+ { "arch-int32-type", 1, 0, 0, gdbscm_arch_int32_type,
+ "\
+Return the <gdb:type> object for the \"int32\" type\n\
+of the architecture." },
+
+ { "arch-uint32-type", 1, 0, 0, gdbscm_arch_uint32_type,
+ "\
+Return the <gdb:type> object for the \"uint32\" type\n\
+of the architecture." },
+
+ { "arch-int64-type", 1, 0, 0, gdbscm_arch_int64_type,
+ "\
+Return the <gdb:type> object for the \"int64\" type\n\
+of the architecture." },
+
+ { "arch-uint64-type", 1, 0, 0, gdbscm_arch_uint64_type,
+ "\
+Return the <gdb:type> object for the \"uint64\" type\n\
+of the architecture." },
+
+ END_FUNCTIONS
+};
+
+void
+gdbscm_initialize_arches (void)
+{
+ arch_smob_tag = gdbscm_make_smob_type (arch_smob_name, sizeof (arch_smob));
+ scm_set_smob_mark (arch_smob_tag, arscm_mark_arch_smob);
+ scm_set_smob_print (arch_smob_tag, arscm_print_arch_smob);
+
+ gdbscm_define_functions (arch_functions, 1);
+
+ arch_object_data
+ = gdbarch_data_register_post_init (arscm_object_data_init);
+}