public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Andreas Arnez <arnez@linux.ibm.com>
Cc: "Rohr, Stephan via Gdb" <gdb@sourceware.org>,
	 "Rohr, Stephan" <stephan.rohr@intel.com>,
	 "Tom Tromey" <tom@tromey.com>
Subject: Re: Issue in dwarf2/expr.c
Date: Fri, 15 Apr 2022 14:24:51 -0600	[thread overview]
Message-ID: <875ynajdrg.fsf@tromey.com> (raw)
In-Reply-To: <877d7reps0.fsf@li-07e5db4c-3052-11b2-a85c-815382633c95.ibm.com> (Andreas Arnez's message of "Thu, 14 Apr 2022 15:51:59 +0200")

>> I came across a bug in dwarf2/expr.c:177 in function  rw_pieced_value. when reading a pieced value described by DW_OP_piece or DW_OP_bit_piece.
>> 
>> if (value_type (v) != value_enclosing_type (v))
>> internal_error (__FILE__, __LINE__,
>> _("Should not be able to create a lazy value with "
>> "an enclosing type"));

> Since I did some work on this function in the past, I just looked where
> this check comes from, and it turns out that it was introduced in 2010
> by Tom Tromey with commit afd74c5ff76010405caddd2834be4a0178fa93dd --

> gdb
> 	* dwarf2loc.c (read_pieced_value): Work properly when 'v' has an
> 	offset.
> 	(write_pieced_value): Likewise.

> Perhaps Tom still remembers the rationale?

I don't remember, sorry.
It's possible I assumed that it should be impossible to create a value
with an enclosing type without un-lazying it.

Removing the assertion seems fine but it's important to make sure the
result works correctly.  An enclosing type normally means that the data
representing the 'type' is at some offset in the contents, but it seems
to me that rw_pieced_value may not handle this case.

Tom

  reply	other threads:[~2022-04-15 20:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 16:57 Rohr, Stephan
2022-04-14 13:51 ` Andreas Arnez
2022-04-15 20:24   ` Tom Tromey [this message]
2022-04-19  6:28     ` Rohr, Stephan

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=875ynajdrg.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=arnez@linux.ibm.com \
    --cc=gdb@sourceware.org \
    --cc=stephan.rohr@intel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).