public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org>
Cc: Kevin Buettner <kevinb@redhat.com>
Subject: Re: [PATCH] Permit DW_OP_GNU_uninit to be used with DW_OP_piece
Date: Mon, 05 Jun 2023 07:17:08 -0600	[thread overview]
Message-ID: <877csit5ez.fsf@tromey.com> (raw)
In-Reply-To: <20230603183158.70474-1-kevinb@redhat.com> (Kevin Buettner via Gdb-patches's message of "Sat, 3 Jun 2023 11:31:58 -0700")

>>>>> "Kevin" == Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org> writes:

Kevin> The test case in that bug report involved running gdb against the 'jq'
Kevin> program (which is a command-line JSON processor) on Fedora 37.  Since
Kevin> the debug info is compiler (and compile-time option) dependent, it
Kevin> won't necessarily show up in other distributions or even past or
Kevin> future versions of Fedora.  (E.g. when trying the example shown below
Kevin> on Fedora 38, GDB says that the value of 'value' has been optimized
Kevin> out.  I.e. it does not demonstrate the same DWARF error that can be
Kevin> see when using Fedora 37.)

Ages ago, during one of the rewrites of the DWARF expression evaluator,
I found out that DW_OP_GNU_uninit was not really documented.  So, I just
made it continue to work the way it had been described in the gdb
sources.

My recollection is that it required a special compiler argument to even
get gcc to emit it.  It's still undocumented as far as I can tell.

So I'd suggest perhaps you could get someone to remove it from GCC, or
from the jq build.  It's barely used and IMO not really useful.

That said, it's fine by me if you want to keep it around.

Kevin>  	case DW_OP_GNU_uninit:
Kevin> -	  if (op_ptr != op_end)
Kevin> +	  if (op_ptr != op_end && *op_ptr != DW_OP_piece)
Kevin>  	    error (_("DWARF-2 expression error: DW_OP_GNU_uninit must always "
Kevin>  		   "be the very last op."));

If DW_OP_GNU_uninit can end a piece then the error message here should
be updated.

Also did you look at the other spots that understand DWARF expressions?
There are 3 or 4 in gdb.

Aside from this the patch is OK.

Tom

  reply	other threads:[~2023-06-05 13:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-03 18:31 Kevin Buettner
2023-06-05 13:17 ` Tom Tromey [this message]
2023-06-11 22:53   ` Kevin Buettner
2023-06-12  0:28     ` 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=877csit5ez.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).