public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-jankratochvil-fortran-module2: Merge remote branch 'origin/master' into archer-jankratochvil-fortran-module2
@ 2010-04-30  7:17 jkratoch
  0 siblings, 0 replies; only message in thread
From: jkratoch @ 2010-04-30  7:17 UTC (permalink / raw)
  To: archer-commits

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 22089 bytes --]

The branch, archer-jankratochvil-fortran-module2 has been updated
       via  b4a2f4e1be15ab037ebfd53793be913b2d992311 (commit)
       via  d88f06d04fab728abe63b6e04a44d8e2e2ca7b96 (commit)
       via  6f316690aaae8e0cbc09fe722a50c71292a9b8c0 (commit)
       via  2d1337f31d467ebc25bfbf2fd59e46bdd524a43d (commit)
       via  5744f22e63868e7707d2dce7f00a9e9366678869 (commit)
       via  7354233be0f3586016796f38eea1584bd233bf14 (commit)
       via  b76f139f9ffc5b1c3d2d869ac4ef852168a5ec8a (commit)
       via  4ae9202a91e7f35b84a64d47608010fd5acf1db5 (commit)
       via  41c5017cc1af5e54bd7795f9a9178dcb4bd9a97b (commit)
       via  5217026f38d2a7072e99c8c18293d1ec88c8a699 (commit)
       via  89ccbf6f9c89282574704a0ffa5a86fc2cd128cf (commit)
       via  870850ddab624f9d0111a4a0733cf7f5edf9bf91 (commit)
       via  5f38666e4d2282a3407a0266a889a5be14ad5c74 (commit)
       via  9e3eb77c5a286397c355549af7c6b670250d5d01 (commit)
      from  3a6bc61b15be7466bdc1c3cf3f85528734422344 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit b4a2f4e1be15ab037ebfd53793be913b2d992311
Merge: d88f06d04fab728abe63b6e04a44d8e2e2ca7b96 6f316690aaae8e0cbc09fe722a50c71292a9b8c0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Apr 30 09:16:47 2010 +0200

    Merge remote branch 'origin/master' into archer-jankratochvil-fortran-module2

commit d88f06d04fab728abe63b6e04a44d8e2e2ca7b96
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Apr 30 09:14:28 2010 +0200

    fixups

-----------------------------------------------------------------------

Summary of changes:
 bfd/version.h                                     |    2 +-
 gdb/ChangeLog                                     |   74 +++-
 gdb/MAINTAINERS                                   |    1 +
 gdb/Makefile.in                                   |   14 +-
 gdb/NEWS                                          |    8 +-
 gdb/arm-linux-tdep.c                              |   32 +-
 gdb/c-lang.c                                      |    7 +-
 gdb/c-lang.h                                      |    5 +
 gdb/d-lang.c                                      |  278 +++++++++
 gdb/d-lang.h                                      |   32 ++
 gdb/d-valprint.c                                  |   91 +++
 gdb/defs.h                                        |    1 +
 gdb/doc/ChangeLog                                 |   12 +
 gdb/doc/gdb.texinfo                               |  164 ++++++-
 gdb/dwarf2read.c                                  |   17 +-
 gdb/language.c                                    |    6 +
 gdb/python/py-cmd.c                               |   14 +-
 gdb/python/py-param.c                             |  617 +++++++++++++++++++++
 gdb/python/python-internal.h                      |    9 +
 gdb/python/python.c                               |   24 +-
 gdb/regcache.c                                    |   29 +-
 gdb/regcache.h                                    |    1 +
 gdb/ser-base.c                                    |    2 +-
 gdb/ser-base.h                                    |    1 -
 gdb/symfile.c                                     |    1 +
 gdb/symtab.c                                      |   26 +-
 gdb/target.c                                      |    1 +
 gdb/testsuite/ChangeLog                           |   15 +
 gdb/testsuite/gdb.base/default.exp                |    2 +-
 gdb/testsuite/gdb.fortran/library-module-lib.f90  |    1 +
 gdb/testsuite/gdb.fortran/library-module-main.f90 |    2 +-
 gdb/testsuite/gdb.fortran/library-module.exp      |   11 +-
 gdb/testsuite/gdb.fortran/module.exp              |    3 +-
 gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp     |   88 +++
 gdb/testsuite/gdb.mi/ns-stale-regcache.c          |   30 +
 gdb/testsuite/gdb.python/py-param.exp             |  140 +++++
 gdb/version.in                                    |    2 +-
 37 files changed, 1713 insertions(+), 50 deletions(-)
 create mode 100644 gdb/d-lang.c
 create mode 100644 gdb/d-lang.h
 create mode 100644 gdb/d-valprint.c
 create mode 100644 gdb/python/py-param.c
 create mode 100644 gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp
 create mode 100644 gdb/testsuite/gdb.mi/ns-stale-regcache.c
 create mode 100644 gdb/testsuite/gdb.python/py-param.exp

First 500 lines of diff:
diff --git a/bfd/version.h b/bfd/version.h
index 6aeda4b..559de31 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20100428
+#define BFD_VERSION_DATE 20100430
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 870aca7..e766ba5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,75 @@
+2010-04-29  Doug Evans  <dje@google.com>
+
+	* ser-base.h (reschedule): Delete prototype.
+	* ser-base.c (reschedule): Make static.
+
+2010-04-29  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
+
+	* arm-linux-tdep.c (ARM_LINUX_JB_PC): Remove.
+	(ARM_LINUX_JB_PC_FPA): Add, offset of PC in longjmp buffer for FPA.
+	(ARM_LINUX_JB_PC_EABI): Add, offset of PC in longjmp buffer for 
+	EABI.
+	(arm_linux_init_abi): Set up JB_PC field dependent on FP model in 
+	use.
+
+2010-04-29  Pedro Alves  <pedro@codesourcery.com>
+
+	PR gdb/11557
+
+	* regcache.c (registers_changed): Rename to ...
+	(registers_changed_ptid): ... this, and only delete register cache
+	entries matching the ptid filter argument.
+	(registers_changed): Reimplement on top of registers_changed_ptid.
+	* regcache.h (registers_changed_ptid): Declare.
+	* target.c (target_resume): Flush register caches.
+
+2010-04-29  Phil Muldoon  <pmuldoon@redhat.com>
+            Tom Tromey  <tromey@redhat.com>
+            Thiago Jung Bauermann  <bauerman@br.ibm.com>
+
+        * Makefile.in (SUBDIR_PYTHON_OBS): Add py-parameter.
+        (SUBDIR_PYTHON_SRCS): Likewise.
+        (py-parameter.o): New rule.
+        * python/py-parameter.c: New file.
+        * python/python-internal.h (gdbpy_initialize_parameter)
+        (gdbpy_parameter, gdbpy_parameter_value)
+        (gdbpy_parse_command_name): Declare.
+        * python/py-cmd.c (parse_command_name): Rename to
+        gdbpy_parse_command_name.
+        (gdbpy_parse_command_name): Accept a starting list parameter and
+        use over cmdlist.
+        (cmdpy_init): Use gdbpy_parse_command_name.
+        * python/python.c (parameter_to_python): Rename to
+        gdbpy_parameter_to_python.  Accept enum var_types and value.
+        (gdbpy_parameter): Use gdbpy_parameter_value.
+        (_initialize_python): Call gdbpy_initialize_parameters.
+
+2010-04-29  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
+
+	* MAINTAINERS: Add myself for write after approval privileges.
+
+2010-04-29  Mihail Zenkov  <mihail.zenkov@gmail.com>
+
+	D language support.
+	* Makefile.in (SFILES): Add d-lang.c d-valprint.c.
+	(COMMON_OBS): Add d-lang.o d-valprint.o.
+	(HFILES_NO_SRCDIR): Add d-lang.h.
+	* NEWS: Mention D language support.
+	* c-lang.c (c_emit_char, exp_descriptor_c): Make public.
+	* c-lang.h (c_emit_char, exp_descriptor_c): Add declaration.
+	* d-lang.c: New file.
+	* d-lang.h: New file.
+	* d-valprint.c: New file.
+	* defs.h (enum language): Add language_d.
+	* dwarf2read.c (set_cu_language): Add DW_LANG_D.
+	* language.c (binop_result_type, integral_type, character_type)
+	(string_type, boolean_type, structured_type): Add language_d.
+	* symfile.c (init_filename_language_table): Add language_d.
+	* symtab.c: Include d-lang.h.
+	(symbol_init_language_specific, symbol_find_demangled_name)
+	(symbol_natural_name, lookup_symbol_in_language)
+	(symbol_demangled_name, symbol_matches_domain): Add language_d.
+
 2010-04-27  Joel Brobecker  <brobecker@adacore.com>
 
 	* solib-svr4.c (solib_svr4_r_map): Expand function description.
@@ -3520,7 +3592,7 @@
 	addr_bit.  Adjust LOAD_ADDR sign for cross-arch inferiors.
 
 2010-02-17  Tristan Gingold  <gingold@adacore.com>
-	    Petr Hluzín <petr.hluzin@gmail.com>
+	    Petr Hluzin  <petr.hluzin@gmail.com>
 
 	* avr-tdep.c (avr_scan_prologue): Convert an if statement to a
 	gdb_assert.  Fix info->size for SIG prologue.
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index dccf65d..dc27d41 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -511,6 +511,7 @@ Tristan Gingold					gingold@adacore.com
 Raoul Gough					RaoulGough@yahoo.co.uk
 Anthony Green			 		green@redhat.com
 Matthew Green					mrg@eterna.com.au
+Matthew Gretton-Dann				matthew.gretton-dann@arm.com
 Maxim Grigoriev					maxim2405@gmail.com
 Jerome Guitton					guitton@act-europe.fr
 Ben Harris					bjh21@netbsd.org
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 750fdfd..754671f 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -275,6 +275,7 @@ SUBDIR_PYTHON_OBS = \
 	py-function.o \
 	py-lazy-string.o \
 	py-objfile.o \
+	py-param.o \
 	py-prettyprint.o \
 	py-progspace.o \
 	py-symbol.o \
@@ -292,6 +293,7 @@ SUBDIR_PYTHON_SRCS = \
 	python/py-function.c \
 	python/py-lazy-string.c \
 	python/py-objfile.c \
+	python/py-param.c \
 	python/py-prettyprint.c \
 	python/py-progspace.c \
 	python/py-symbol.c \
@@ -658,6 +660,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
 	charset.c cli-out.c coffread.c coff-pe-read.c \
 	complaints.c completer.c corefile.c \
 	cp-abi.c cp-support.c cp-namespace.c cp-valprint.c \
+	d-lang.c d-valprint.c \
 	cp-name-parser.y \
 	dbxread.c demangle.c dictionary.c disasm.c doublest.c dummy-frame.c \
 	dwarf2expr.c dwarf2loc.c dwarf2read.c dwarf2-frame.c \
@@ -725,7 +728,7 @@ cli-out.h gdb_expat.h breakpoint.h infcall.h obsd-tdep.h \
 exec.h m32r-tdep.h osabi.h gdbcore.h solib-som.h \
 i386bsd-nat.h xml-support.h xml-tdesc.h alphabsd-tdep.h gdb_obstack.h \
 ia64-tdep.h ada-lang.h varobj.h frv-tdep.h nto-tdep.h serial.h \
-c-lang.h frame.h event-loop.h block.h cli/cli-setshow.h	\
+c-lang.h d-lang.h frame.h event-loop.h block.h cli/cli-setshow.h	\
 cli/cli-decode.h cli/cli-cmds.h cli/cli-dump.h \
 cli/cli-script.h macrotab.h symtab.h version.h gnulib/wchar.in.h \
 gnulib/string.in.h gnulib/str-two-way.h gnulib/extra/link-warning.h \
@@ -831,7 +834,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
 	dbxread.o coffread.o coff-pe-read.o \
 	dwarf2read.o mipsread.o stabsread.o corefile.o \
 	dwarf2expr.o dwarf2loc.o dwarf2-frame.o \
-	ada-lang.o c-lang.o f-lang.o objc-lang.o \
+	ada-lang.o c-lang.o d-lang.o f-lang.o objc-lang.o \
 	ada-tasks.o \
 	ui-out.o cli-out.o \
 	varobj.o vec.o wrapper.o \
@@ -841,7 +844,8 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
 	sentinel-frame.o \
 	complaints.o typeprint.o \
 	ada-typeprint.o c-typeprint.o f-typeprint.o m2-typeprint.o \
-	ada-valprint.o c-valprint.o cp-valprint.o f-valprint.o m2-valprint.o \
+	ada-valprint.o c-valprint.o cp-valprint.o d-valprint.o f-valprint.o \
+	m2-valprint.o \
 	serial.o mdebugread.o top.o utils.o \
 	ui-file.o \
 	user-regs.o \
@@ -2021,6 +2025,10 @@ py-objfile.o: $(srcdir)/python/py-objfile.c
 	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-objfile.c
 	$(POSTCOMPILE)
 
+py-param.o: $(srcdir)/python/py-param.c
+	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-param.c
+	$(POSTCOMPILE)
+
 py-prettyprint.o: $(srcdir)/python/py-prettyprint.c
 	$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-prettyprint.c
 	$(POSTCOMPILE)
diff --git a/gdb/NEWS b/gdb/NEWS
index 696da2e..28201cd 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -80,7 +80,9 @@ is now deprecated.
 * Python scripting
 
 ** The GDB Python API now has access to breakpoints, symbols, symbol
-   tables, program spaces, and frame's code blocks.
+   tables, program spaces, and frame's code blocks.  Additionally, GDB
+   Parameters can now be created from the API, and manipulated via
+   set/show in the CLI.
 
 ** New functions gdb.target_charset, gdb.target_wide_charset,
    gdb.progspaces, and gdb.current_progspace.
@@ -100,6 +102,10 @@ regular breakpoints.
 
 ARM Symbian			arm*-*-symbianelf*
 
+* D language support.
+  GDB now supports debugging programs written in the D programming
+  language.
+
 *** Changes in GDB 7.1
 
 * C++ Improvements
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index af409f6..fa85199 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -82,9 +82,20 @@ static const char arm_linux_thumb2_be_breakpoint[] = { 0xf7, 0xf0, 0xa0, 0x00 };
 
 static const char arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa0 };
 
-/* Description of the longjmp buffer.  */
+/* Description of the longjmp buffer.  The buffer is treated as an array of 
+   elements of size ARM_LINUX_JB_ELEMENT_SIZE.
+
+   The location of saved registers in this buffer (in particular the PC
+   to use after longjmp is called) varies depending on the ABI (in 
+   particular the FP model) and also (possibly) the C Library.
+
+   For glibc, eglibc, and uclibc the following holds:  If the FP model is 
+   SoftVFP or VFP (which implies EABI) then the PC is at offset 9 in the 
+   buffer.  This is also true for the SoftFPA model.  However, for the FPA 
+   model the PC is at offset 21 in the buffer.  */
 #define ARM_LINUX_JB_ELEMENT_SIZE	INT_REGISTER_SIZE
-#define ARM_LINUX_JB_PC			21
+#define ARM_LINUX_JB_PC_FPA		21
+#define ARM_LINUX_JB_PC_EABI		9
 
 /*
    Dynamic Linking on ARM GNU/Linux
@@ -877,7 +888,22 @@ arm_linux_init_abi (struct gdbarch_info info,
   if (tdep->fp_model == ARM_FLOAT_AUTO)
     tdep->fp_model = ARM_FLOAT_FPA;
 
-  tdep->jb_pc = ARM_LINUX_JB_PC;
+  switch (tdep->fp_model)
+    {
+    case ARM_FLOAT_FPA:
+      tdep->jb_pc = ARM_LINUX_JB_PC_FPA;
+      break;
+    case ARM_FLOAT_SOFT_FPA:
+    case ARM_FLOAT_SOFT_VFP:
+    case ARM_FLOAT_VFP:
+      tdep->jb_pc = ARM_LINUX_JB_PC_EABI;
+      break;
+    default:
+      internal_error
+	(__FILE__, __LINE__,
+         _("arm_linux_init_abi: Floating point model not supported"));
+      break;
+    }
   tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE;
 
   set_solib_svr4_fetch_link_map_offsets
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 805c572..aa69f94 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -253,8 +253,9 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig, int orig_len,
    string whose delimiter is QUOTER.  Note that that format for printing
    characters and strings is language specific. */
 
-static void
-c_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
+void
+c_emit_char (int c, struct type *type,
+	     struct ui_file *stream, int quoter)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
   struct obstack wchar_buf, output;
@@ -1135,7 +1136,7 @@ c_language_arch_info (struct gdbarch *gdbarch,
   lai->bool_type_default = builtin->builtin_int;
 }
 
-static const struct exp_descriptor exp_descriptor_c = 
+const struct exp_descriptor exp_descriptor_c = 
 {
   print_subexp_standard,
   operator_length_standard,
diff --git a/gdb/c-lang.h b/gdb/c-lang.h
index 423cee0..c2cdd56 100644
--- a/gdb/c-lang.h
+++ b/gdb/c-lang.h
@@ -87,6 +87,11 @@ extern void c_printstr (struct ui_file * stream, struct type *elttype,
 extern void c_language_arch_info (struct gdbarch *gdbarch,
 				  struct language_arch_info *lai);
 
+extern const struct exp_descriptor exp_descriptor_c;
+
+extern void c_emit_char (int c, struct type *type,
+			 struct ui_file *stream, int quoter);
+
 /* These are in c-typeprint.c: */
 
 extern void c_type_print_base (struct type *, struct ui_file *, int, int);
diff --git a/gdb/d-lang.c b/gdb/d-lang.c
new file mode 100644
index 0000000..6db521b
--- /dev/null
+++ b/gdb/d-lang.c
@@ -0,0 +1,278 @@
+/* D language support routines for GDB, the GNU debugger.
+
+   Copyright (C) 2005, 2006, 2008, 2009, 2010 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/>.  */
+
+#include "defs.h"
+#include "symtab.h"
+#include "language.h"
+#include "d-lang.h"
+#include "c-lang.h"
+#include "gdb_string.h"
+#include "parser-defs.h"
+#include "gdb_obstack.h"
+
+#include <ctype.h>
+
+/* Extract identifiers from MANGLED_STR and append it to TEMPBUF.
+   Return 1 on success or 0 on failure.  */
+static int
+extract_identifiers (const char *mangled_str, struct obstack *tempbuf)
+{
+  long i = 0;
+
+  while (isdigit (*mangled_str))
+    {
+      i = strtol (mangled_str, NULL, 10);
+      mangled_str++;
+      if (i <= 0  && strlen (mangled_str) < i)
+        return 0;
+      obstack_grow (tempbuf, mangled_str, i);
+      mangled_str += i;
+      obstack_grow_str (tempbuf, ".");
+    }
+  if (*mangled_str == '\0' || i == 0)
+    return 0;
+  obstack_blank (tempbuf, -1);
+  return 1;
+}
+
+/* Extract and demangle type from MANGLED_STR and append it to TEMPBUF.
+   Return 1 on success or 0 on failure.  */
+static int
+extract_type_info (const char *mangled_str, struct obstack *tempbuf)
+{
+  if (*mangled_str == '\0')
+    return 0;
+  switch (*mangled_str++)
+    {
+      case 'A': /* dynamic array */
+      case 'G': /* static array */
+      case 'H': /* associative array */
+	if (!extract_type_info (mangled_str, tempbuf))
+	  return 0;
+	obstack_grow_str (tempbuf, "[]");
+	return 1;
+      case 'P': /* pointer */
+	if (!extract_type_info (mangled_str, tempbuf))
+	  return 0;
+	obstack_grow_str (tempbuf, "*");
+	return 1;
+      case 'R': /* reference */
+	if (!extract_type_info (mangled_str, tempbuf))
+	  return 0;
+	obstack_grow_str (tempbuf, "&");
+	return 1;
+      case 'Z': /* return value */
+	return extract_type_info (mangled_str, tempbuf);
+      case 'J': /* out */
+	obstack_grow_str (tempbuf, "out ");
+	return extract_type_info (mangled_str, tempbuf);
+      case 'K': /* inout */
+	obstack_grow_str (tempbuf, "inout ");
+	return extract_type_info (mangled_str, tempbuf);
+      case 'E': /* enum */
+      case 'T': /* typedef */
+      case 'D': /* delegate */
+      case 'C': /* class */
+      case 'S': /* struct */
+	return extract_identifiers (mangled_str, tempbuf);
+
+      /* basic types: */
+      case 'n': obstack_grow_str (tempbuf, "none"); return 1;
+      case 'v': obstack_grow_str (tempbuf, "void"); return 1;
+      case 'g': obstack_grow_str (tempbuf, "byte"); return 1;
+      case 'h': obstack_grow_str (tempbuf, "ubyte"); return 1;
+      case 's': obstack_grow_str (tempbuf, "short"); return 1;
+      case 't': obstack_grow_str (tempbuf, "ushort"); return 1;
+      case 'i': obstack_grow_str (tempbuf, "int"); return 1;
+      case 'k': obstack_grow_str (tempbuf, "uint"); return 1;
+      case 'l': obstack_grow_str (tempbuf, "long"); return 1;
+      case 'm': obstack_grow_str (tempbuf, "ulong"); return 1;
+      case 'f': obstack_grow_str (tempbuf, "float"); return 1;
+      case 'd': obstack_grow_str (tempbuf, "double"); return 1;
+      case 'e': obstack_grow_str (tempbuf, "real"); return 1;
+
+      /* imaginary and complex: */
+      case 'o': obstack_grow_str (tempbuf, "ifloat"); return 1;
+      case 'p': obstack_grow_str (tempbuf, "idouble"); return 1;
+      case 'j': obstack_grow_str (tempbuf, "ireal"); return 1;
+      case 'q': obstack_grow_str (tempbuf, "cfloat"); return 1;
+      case 'r': obstack_grow_str (tempbuf, "cdouble"); return 1;
+      case 'c': obstack_grow_str (tempbuf, "creal"); return 1;
+
+      /* other types: */
+      case 'b': obstack_grow_str (tempbuf, "bit"); return 1;
+      case 'a': obstack_grow_str (tempbuf, "char"); return 1;
+      case 'u': obstack_grow_str (tempbuf, "wchar"); return 1;
+      case 'w': obstack_grow_str (tempbuf, "dchar"); return 1;
+
+      default:
+	obstack_grow_str (tempbuf, "unknown");
+	return 1;
+    }
+}
+
+/* Implements the la_demangle language_defn routine for language D.  */
+char *
+d_demangle (const char *symbol, int options)
+{
+  struct obstack tempbuf;
+  char *out_str;
+  unsigned char is_func = 0;
+
+  if (symbol == NULL)
+    return NULL;
+  else if (strcmp (symbol, "_Dmain") == 0)
+    return xstrdup ("D main");
+
+  obstack_init (&tempbuf);
+  
+  if (symbol[0] == '_' && symbol[1] == 'D')
+    {
+      symbol += 2;
+      is_func = 1;
+    }
+  else if (strncmp (symbol, "__Class_", 8) == 0)
+    symbol += 8;
+  else if (strncmp (symbol, "__init_", 7) == 0)
+    symbol += 7;
+  else if (strncmp (symbol, "__vtbl_", 7) == 0)
+    symbol += 7;
+  else if (strncmp (symbol, "__modctor_", 10) == 0)
+    symbol += 10;
+  else if (strncmp (symbol, "__moddtor_", 10) == 0)
+    symbol += 10;
+  else if (strncmp (symbol, "__ModuleInfo_", 13) == 0)
+    symbol += 13;
+  else
+    {
+      obstack_free (&tempbuf, NULL);
+      return NULL;
+    }
+  
+  if (!extract_identifiers (symbol, &tempbuf))
+    {
+      obstack_free (&tempbuf, NULL);
+      return NULL;
+    }
+
+  obstack_grow_str (&tempbuf, "(");
+  if (is_func == 1 && *symbol == 'F')
+    {
+      symbol++;
+      while (*symbol != '\0' && *symbol != 'Z')
+	{
+	  if (is_func == 1)
+	    is_func++;
+	  else
+	    obstack_grow_str (&tempbuf, ", ");
+	  if (!extract_type_info (symbol, &tempbuf))
+	    {
+	      obstack_free (&tempbuf, NULL);
+	      return NULL;
+	   }
+	}
+     }
+  obstack_grow_str0 (&tempbuf, ")");
+
+  /* Doesn't display the return type, but wouldn't be too hard to do.  */
+
+  out_str = xstrdup (obstack_finish (&tempbuf));
+  obstack_free (&tempbuf, NULL);
+  return out_str;
+}


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-30  7:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-30  7:17 [SCM] archer-jankratochvil-fortran-module2: Merge remote branch 'origin/master' into archer-jankratochvil-fortran-module2 jkratoch

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).