public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  master: Merge remote branch 'gdb/master'
Date: Fri, 30 Apr 2010 07:11:00 -0000	[thread overview]
Message-ID: <20100430071130.4987.qmail@sourceware.org> (raw)

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

The branch, master has been updated
       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  f85e2073beea96706b330b571c47949bfcacbb86 (commit)

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

- Log -----------------------------------------------------------------
commit 6f316690aaae8e0cbc09fe722a50c71292a9b8c0
Merge: f85e2073beea96706b330b571c47949bfcacbb86 2d1337f31d467ebc25bfbf2fd59e46bdd524a43d
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Apr 30 09:11:11 2010 +0200

    Merge remote branch 'gdb/master'

commit 2d1337f31d467ebc25bfbf2fd59e46bdd524a43d
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Fri Apr 30 00:00:33 2010 +0000

    *** empty log message ***

commit 5744f22e63868e7707d2dce7f00a9e9366678869
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Fri Apr 30 00:00:04 2010 +0000

    daily update

commit 7354233be0f3586016796f38eea1584bd233bf14
Author: Doug Evans <dje@google.com>
Date:   Thu Apr 29 22:51:00 2010 +0000

    	* ser-base.h (reschedule): Delete prototype.
    	* ser-base.c (reschedule): Make static.

commit b76f139f9ffc5b1c3d2d869ac4ef852168a5ec8a
Author: mgretton <mgretton>
Date:   Thu Apr 29 16:34:25 2010 +0000

    *** empty log message ***

commit 4ae9202a91e7f35b84a64d47608010fd5acf1db5
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Thu Apr 29 16:33:15 2010 +0000

    	PR gdb/11557
    
    	gdb/
    	* 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.
    
    	gdb/testsuite/
    	* gdb.mi/mi-ns-stale-regcache.exp, gdb.mi/ns-stale-regcache.c: New
    	files.

commit 41c5017cc1af5e54bd7795f9a9178dcb4bd9a97b
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Thu Apr 29 16:03:32 2010 +0000

    Fix typo in ChangeLog name (non-UTF8 character).
    
    Seems to have been inserted accidently.

commit 5217026f38d2a7072e99c8c18293d1ec88c8a699
Author: pmuldoon <pmuldoon>
Date:   Thu Apr 29 15:45:55 2010 +0000

    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  Phil Muldoon  <pmuldoon@redhat.com>
    
            * gdb.python/py-param.exp: New File.
    
    2010-04-29  Phil Muldoon  <pmuldoon@redhat.com>
                Tom Tromey  <tromey@redhat.com>
                Thiago Jung Bauermann  <bauerman@br.ibm.com>
    
            * gdb.texinfo (Parameters In Python): New Node.

commit 89ccbf6f9c89282574704a0ffa5a86fc2cd128cf
Author: mgretton <mgretton>
Date:   Thu Apr 29 14:55:36 2010 +0000

    	* gdb/MAINTAINERS: Add myself for write after approval privileges.

commit 870850ddab624f9d0111a4a0733cf7f5edf9bf91
Author: Joel Brobecker <brobecker@gnat.com>
Date:   Thu Apr 29 14:45:37 2010 +0000

    D language support.
    
    gdb/ChangeLog:
    
            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.
    
    gdb/doc/ChangeLog:
    
            * gdb.texinfo: (Summary) Add mention about D language support.
            (Filenames): Add D suffixes.
            (D): New node.
    
    gdb/testsuite/ChangeLog:
    
            * gdb.base/default.exp: Fix "set language" test.

commit 5f38666e4d2282a3407a0266a889a5be14ad5c74
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Thu Apr 29 00:00:09 2010 +0000

    *** empty log message ***

commit 9e3eb77c5a286397c355549af7c6b670250d5d01
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Thu Apr 29 00:00:08 2010 +0000

    daily update

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

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                              |    3 +
 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.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 +-
 33 files changed, 1691 insertions(+), 41 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.


             reply	other threads:[~2010-04-30  7:11 UTC|newest]

Thread overview: 120+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-30  7:11 jkratoch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-02-01 19:25 jkratoch
2011-01-29 16:44 jkratoch
2011-01-25 12:53 pmuldoon
2011-01-25  9:10 jkratoch
2011-01-17 13:31 pmuldoon
2011-01-15 11:35 jkratoch
2011-01-14  8:04 jkratoch
2011-01-10 12:00 pmuldoon
2011-01-10  9:10 jkratoch
2011-01-07  5:57 jkratoch
2011-01-06 12:22 pmuldoon
2011-01-04  4:59 jkratoch
2010-12-31 22:30 jkratoch
2010-12-30  7:22 jkratoch
2010-12-22 20:11 swagiaal
2010-12-14 17:13 jkratoch
2010-12-14  8:27 pmuldoon
2010-12-10 17:16 jkratoch
2010-12-08 15:55 pmuldoon
2010-12-06  6:40 jkratoch
2010-12-04  1:03 jkratoch
2010-12-02 15:47 pmuldoon
2010-11-30  0:15 jkratoch
2010-11-28 18:02 jkratoch
2010-11-28  5:41 jkratoch
2010-11-16  5:04 jkratoch
2010-11-12 11:47 pmuldoon
2010-11-11 11:39 pmuldoon
2010-11-10  9:09 pmuldoon
2010-11-08  9:34 pmuldoon
2010-11-07 18:15 jkratoch
2010-10-22 14:28 pmuldoon
2010-10-20 12:48 pmuldoon
2010-10-19 16:01 pmuldoon
2010-10-17 20:27 jkratoch
2010-10-15 17:07 jkratoch
2010-10-14 20:55 jkratoch
2010-10-13 15:06 jkratoch
2010-10-12 16:45 jkratoch
2010-10-11  9:21 jkratoch
2010-10-11  8:47 pmuldoon
2010-10-06  9:00 pmuldoon
2010-09-30  8:56 pmuldoon
2010-09-27  9:48 jkratoch
2010-09-20 12:34 pmuldoon
2010-09-16 20:49 ratmice
2010-09-04 19:59 jkratoch
2010-09-03  7:26 jkratoch
2010-09-02 15:04 jkratoch
2010-09-01 15:29 swagiaal
2010-08-23 13:54 jkratoch
2010-08-20 17:49 jkratoch
2010-08-12 15:19 swagiaal
2010-08-06 15:32 jkratoch
2010-07-29 19:17 swagiaal
2010-07-22 16:57 jkratoch
2010-07-22 16:26 jkratoch
2010-07-20 18:51 jkratoch
2010-07-09  8:09 jkratoch
2010-06-24  8:55 jkratoch
2010-06-23 20:56 jkratoch
2010-06-17 12:53 jkratoch
2010-06-07  8:14 jkratoch
2010-06-02 19:03 jkratoch
2010-05-28 21:27 jkratoch
2010-05-26 18:36 swagiaal
2010-05-17 18:02 jkratoch
2010-05-17  1:04 jkratoch
2010-05-10 19:30 swagiaal
2010-05-05 14:24 swagiaal
2010-05-03 13:49 jkratoch
2010-05-03  8:48 jkratoch
2010-05-02 23:10 jkratoch
2010-05-02 15:54 jkratoch
2010-04-28 11:44 jkratoch
2010-04-25 20:22 jkratoch
2010-04-09 20:37 jkratoch
2010-04-07  1:41 jkratoch
2010-04-05 10:11 jkratoch
2010-04-04 11:58 jkratoch
2010-03-22 23:58 jkratoch
2010-03-20 17:23 jkratoch
2010-03-18 10:01 jkratoch
2010-03-17 18:04 jkratoch
2010-03-12 18:35 jkratoch
2010-03-04 22:28 jkratoch
2010-03-01 22:16 jkratoch
2010-02-26 22:16 jkratoch
2010-02-26 17:50 jkratoch
2010-02-17 16:01 swagiaal
2010-02-13 22:51 jkratoch
2010-02-11 12:51 jkratoch
2010-02-09 19:01 jkratoch
2010-02-08 21:46 jkratoch
2010-02-03  4:38 jkratoch
2010-01-31 17:25 jkratoch
2010-01-28 19:17 swagiaal
2010-01-28 10:56 jkratoch
2010-01-27 19:21 swagiaal
2010-01-27  8:08 jkratoch
2010-01-26 18:58 swagiaal
2010-01-20 21:48 jkratoch
2010-01-15  2:09 jkratoch
2010-01-15  0:52 jkratoch
2010-01-14 22:23 jkratoch
2010-01-13 20:53 jkratoch
2010-01-10 20:47 jkratoch
2010-01-09 10:03 jkratoch
2010-01-09  8:41 jkratoch
2010-01-08 19:16 jkratoch
2009-12-06 17:43 jkratoch
2009-12-03 16:32 jkratoch
2009-11-30 13:59 jkratoch
2009-11-24 21:21 jkratoch
2009-11-21  9:24 jkratoch
2009-11-20 21:06 jkratoch
2009-11-20 15:57 jkratoch
2009-11-17 19:59 jkratoch
2009-11-16  2:22 jkratoch

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=20100430071130.4987.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).