Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [unavailable values part 1, 16/17] don't merge almost but not quite adjacent memory ranges to collect
Date: Wed, 16 Feb 2011 18:00:00 -0000	[thread overview]
Message-ID: <m3k4gz6i21.fsf@fleche.redhat.com> (raw)
In-Reply-To: <201102161303.16592.pedro@codesourcery.com> (Pedro Alves's	message of "Wed, 16 Feb 2011 13:03:16 +0000")

>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:

Pedro> While writting the test in the patch below I tripped
Pedro> on an internal error:
>> collect {int [4]}globalarr2
Pedro>  ../../src/gdb/ax-gdb.c:2053: internal-error: gen_expr: OP_MEMVAL operand isn't an rvalue???
Pedro>  A problem internal to GDB has been detected,
Pedro>  further debugging may prove unreliable.
Pedro> ... bah.

I think that code is just confused.  Even the comment says so :-)

Could you try the appended?  I'm not totally sure about it; maybe for
the axs_lvalue_memory case we should be calling gen_address_of.

I can't really test it here, since newer versions of GCC confuse AX
generation :-(.  That is, I get this a lot when running collection.exp:

DWARF operator DW_OP_call_frame_cfa cannot be translated to an agent expression

This seems pretty important to fix.

Tom

diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 2908431..d1736e1 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -2044,14 +2044,13 @@ gen_expr (struct expression *exp, union exp_element **pc,
 
 	(*pc) += 3;
 	gen_expr (exp, pc, ax, value);
-	/* I'm not sure I understand UNOP_MEMVAL entirely.  I think
-	   it's just a hack for dealing with minsyms; you take some
-	   integer constant, pretend it's the address of an lvalue of
-	   the given type, and dereference it.  */
-	if (value->kind != axs_rvalue)
-	  /* This would be weird.  */
-	  internal_error (__FILE__, __LINE__,
-			  _("gen_expr: OP_MEMVAL operand isn't an rvalue???"));
+
+	/* If we have an axs_rvalue or an axs_lvalue_memory, then we
+	   already have the right value on the stack.  For
+	   axs_lvalue_register, we must convert.  */
+	if (value->kind == axs_lvalue_register)
+	  require_rvalue (ax, value);
+
 	value->type = type;
 	value->kind = axs_lvalue_memory;
       }


  reply	other threads:[~2011-02-16 16:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-07 14:35 Pedro Alves
2011-02-14 12:01 ` Jan Kratochvil
2011-02-16 13:10   ` Pedro Alves
2011-02-16 18:00     ` Tom Tromey [this message]
2011-02-16 18:03       ` Pedro Alves
2011-02-16 18:07         ` Tom Tromey
2011-02-16 18:09           ` Pedro Alves
2011-02-16 18:09       ` Tom Tromey
2011-02-16 21:01         ` FYI: handle DW_OP_call_frame_cfa in AX compiler (Was: [unavailable values part 1, 16/17] don't merge almost but not quite adjacent memory ranges to collect) Tom Tromey
2011-02-16 21:31           ` FYI: handle DW_OP_call_frame_cfa in AX compiler Pedro Alves
2011-02-16 21:40             ` Tom Tromey
2011-02-16 23:27               ` Pedro Alves
2011-02-17 16:24                 ` 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=m3k4gz6i21.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=pedro@codesourcery.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