Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Gaius Mulley <gaius@glam.ac.uk>
To: tromey@redhat.com
Cc: gdb-patches@sourceware.org,  drow@false.org
Subject: Re: recursive bug in dwarf2read.c
Date: Fri, 11 Dec 2009 20:56:00 -0000	[thread overview]
Message-ID: <87hbrx5ix9.fsf@j228-gm.comp.glam.ac.uk> (raw)
In-Reply-To: <m3d42lz4w0.fsf@fleche.redhat.com> (Tom Tromey's message of "Fri\, 11 Dec 2009 12\:29\:03 -0700")

Tom Tromey <tromey@redhat.com> writes:

>>>>>> "Gaius" == Gaius Mulley <gaius@glam.ac.uk> writes:
>
> Gaius> 2009-12-10  Gaius Mulley  <gaius@glam.ac.uk>
> Gaius> 	* dwarf2read.c (read_subroutine_type): Add the subroutine
> Gaius> 	  type to the die immediately to allow a parameter type to be
> Gaius> 	  the same subroutine type.
>
> This seems almost ok to me.
>
> With this change, read_subroutine_type calls set_die_type twice.
> I think it would be preferable to eliminate the second call.

Hi Tom,

ahh yes - true, here is the modified patch without the redundant
second call:

--- src-orig/gdb/dwarf2read.c	2009-12-10 16:41:40.000000000 +0000
+++ src/gdb/dwarf2read.c	2009-12-11 20:31:52.000000000 +0000
@@ -5879,6 +5879,11 @@
      the default value DW_CC_normal.  */
   attr = dwarf2_attr (die, DW_AT_calling_convention, cu);
   TYPE_CALLING_CONVENTION (ftype) = attr ? DW_UNSND (attr) : DW_CC_normal;
+
+  /* We need to add the subroutine type to the die immediately so
+     we don't infinitely recurse when dealing with parameters
+     declared as the same subroutine type. */
+  set_die_type (die, ftype, cu);
   
   if (die->child != NULL)
     {
@@ -5926,7 +5931,7 @@
 	}
     }
 
-  return set_die_type (die, ftype, cu);
+  return ftype;
 }
 
 static struct type *

2009-12-11  Gaius Mulley  <gaius@glam.ac.uk>

	* dwarf2read.c (read_subroutine_type): Add the subroutine
	  type to the die immediately to allow a parameter type to be
	  the same subroutine type.


regards,
Gaius


  reply	other threads:[~2009-12-11 20:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <878wdcto0t.fsf@j228-gm.comp.glam.ac.uk>
     [not found] ` <20091209185157.GA29691@caradoc.them.org>
2009-12-10 19:39   ` Gaius Mulley
2009-12-11 19:29     ` Tom Tromey
2009-12-11 20:56       ` Gaius Mulley [this message]
2009-12-11 21:06         ` Tom Tromey
2009-12-16 15:14           ` Gaius Mulley

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=87hbrx5ix9.fsf@j228-gm.comp.glam.ac.uk \
    --to=gaius@glam.ac.uk \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /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