Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [RFA/dwarf2read.c] Make Ada structs "typedef"'ed implicitly
Date: Thu, 11 Jan 2007 16:05:00 -0000	[thread overview]
Message-ID: <20070111160458.GM23012@adacore.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

Hello,

This should be the last issue before gdb.ada/null_record.exp starts
passing with the Debian Ada compiler. It turned out that the Debian
compiler does not generate a DW_TAG_typedef DIE for each struct
(aka record in Ada), whereas our does. In Ada, records, unions,
and enums are implicitly typedef'ed. The attached patch modifies
the sources to reflect this.

2007-01-11  Joel Brobecker  <brobecker@adacore.com>

        * dwarf2read.c (add_partial_symbol): Create an extra partial
        symbol in the VAR_DOMAIN for Ada structures, unions or enums.
        (new_symbol): Likewise for symbols.

Tested on x86-linux. 1 extra PASS in gdb.ada/null_record.exp, no
regression.

OK to apply?

(many thanks to Daniel for bringing all these issues to my attention)

Thanks,
-- 
Joel

[-- Attachment #2: typedef.diff --]
[-- Type: text/plain, Size: 1161 bytes --]

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.210
diff -u -p -r1.210 dwarf2read.c
--- dwarf2read.c	5 Jan 2007 05:49:56 -0000	1.210
+++ dwarf2read.c	11 Jan 2007 15:55:36 -0000
@@ -2001,7 +2001,8 @@ add_partial_symbol (struct partial_die_i
 			   0, (CORE_ADDR) 0, cu->language, objfile);
 
       if (cu->language == language_cplus
-          || cu->language == language_java)
+          || cu->language == language_java
+          || cu->language == language_ada)
 	{
 	  /* For C++ and Java, these implicitly act as typedefs as well. */
 	  add_psymbol_to_list (actual_name, strlen (actual_name),
@@ -7170,7 +7171,8 @@ new_symbol (struct die_info *die, struct
 	       defines a typedef for the class.  Synthesize a typedef symbol
 	       so that "ptype foo" works as expected.  */
 	    if (cu->language == language_cplus
-		|| cu->language == language_java)
+		|| cu->language == language_java
+                || cu->language == language_ada)
 	      {
 		struct symbol *typedef_sym = (struct symbol *)
 		  obstack_alloc (&objfile->objfile_obstack,

             reply	other threads:[~2007-01-11 16:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-11 16:05 Joel Brobecker [this message]
2007-01-21 17:29 ` Daniel Jacobowitz
2007-01-23 23:59   ` Joel Brobecker

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=20070111160458.GM23012@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@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