Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Ulrich Weigand <uweigand@de.ibm.com>, gdb-patches@sourceware.org
Subject: Re: gdbindex crash: Re: Regression: Re: RFC: implement typed DWARF stack
Date: Tue, 17 May 2011 17:01:00 -0000	[thread overview]
Message-ID: <m3ei3xfeii.fsf@fleche.redhat.com> (raw)
In-Reply-To: <m3mximha2d.fsf@fleche.redhat.com> (Tom Tromey's message of "Mon,	16 May 2011 10:41:46 -0600")

Jan> The new testcase crashes with .gdb_index:
Jan> print j
Jan> ERROR: Process no longer exists
Jan> UNRESOLVED: gdb.dwarf2/typeddwarf.exp: check value of j at typeddwarf.c:29

Tom> I have a patch for this which I'm going to test, 

Appended.  I am checking this in.

Earlier I did not realize that the types from the CU are cached, and so
we can simply look them up using get_die_type_at_offset.

Tom> but first I have to look into why the buildbot did not detect this.
Tom> My guess is that the index-based tester is not working properly.

I tracked this down to a bad 'make' invocation.
It wasn't properly passing the options to set the compiler.
I verified that it works now by examining the .log files and checking
that dejagnu is invoking cc-with-index.sh.

Tom

2011-05-17  Tom Tromey  <tromey@redhat.com>

	* dwarf2read.c (dwarf2_get_die_type): Call
	get_die_type_at_offset.
	* dwarf2expr.c (dwarf_get_base_type): Handle NULL return from
	get_base_type function.

diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index 1fe8b79..5cd33a6 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -447,6 +447,8 @@ dwarf_get_base_type (struct dwarf_expr_context *ctx, ULONGEST die, int size)
   if (ctx->get_base_type)
     {
       result = ctx->get_base_type (ctx, die);
+      if (result == NULL)
+	error (_("Could not find type for DW_OP_GNU_const_type"));
       if (size != 0 && TYPE_LENGTH (result) != size)
 	error (_("DW_OP_GNU_const_type has different sizes for type and data"));
     }
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 22643c5..6558bfe 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -13671,22 +13671,8 @@ struct type *
 dwarf2_get_die_type (unsigned int die_offset,
 		     struct dwarf2_per_cu_data *per_cu)
 {
-  struct dwarf2_cu *cu = per_cu->cu;
-  struct die_info *die;
-  struct type *result;
-
   dw2_setup (per_cu->objfile);
-
-  die = follow_die_offset (die_offset, &cu);
-  if (!die)
-    error (_("Dwarf Error: Cannot find DIE at 0x%x referenced in module %s"),
-	   die_offset, per_cu->cu->objfile->name);
-
-  result = get_die_type (die, cu);
-  if (result == NULL)
-    result = read_type_die_1 (die, cu);
-
-  return result;
+  return get_die_type_at_offset (die_offset, per_cu);
 }
 
 /* Follow the signature attribute ATTR in SRC_DIE.


  reply	other threads:[~2011-05-17 17:01 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04 20:48 Tom Tromey
2011-05-05 16:47 ` Tom Tromey
2011-05-05 18:07 ` Ulrich Weigand
2011-05-05 18:38   ` Tom Tromey
2011-05-05 20:15     ` Tom Tromey
2011-05-09 22:02       ` Ulrich Weigand
2011-05-10 14:15         ` Tom Tromey
2011-05-11  0:15           ` Ulrich Weigand
2011-05-11 14:59             ` Tom Tromey
2011-05-11 19:44               ` Tom Tromey
2011-05-12  0:03               ` Ulrich Weigand
2011-05-12 16:33                 ` Tom Tromey
2011-05-13  7:52                   ` Regression: " Jan Kratochvil
2011-05-13 15:44                     ` Tom Tromey
2011-05-15  8:26                       ` gdbindex crash: " Jan Kratochvil
2011-05-16 17:37                         ` Tom Tromey
2011-05-17 17:01                           ` Tom Tromey [this message]
2011-05-13 17:17                     ` Tom Tromey
2011-05-13 17:34                       ` Jan Kratochvil
2011-05-12 19:32             ` Tom Tromey
2011-05-16 15:50               ` Ulrich Weigand
2011-05-16 18:09                 ` Tom Tromey
2011-05-17  8:35                   ` Jakub Jelinek
2011-06-03 13:52                     ` Tom Tromey
2011-05-10 16:39         ` Tom Tromey

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=m3ei3xfeii.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=uweigand@de.ibm.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