public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/exp] Fix printing of out of bounds struct members
Date: Mon, 22 Jan 2024 09:29:42 -0700	[thread overview]
Message-ID: <87h6j5jpqh.fsf@tromey.com> (raw)
In-Reply-To: <20240122132801.31153-1-tdevries@suse.de> (Tom de Vries's message of "Mon, 22 Jan 2024 14:28:01 +0100")

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> When building gdb with -O0 -fsanitize=address, and running test-case
Tom> gdb.ada/uninitialized_vars.exp, I run into:
Tom> ...

Thanks for looking into this.

Tom> - when y.a happens to be set to 216, as above, gdb interprets this as the
Tom>   variable having the c+d variant (which is why trying to print y.b fails).

One thing I see here is that y.a is not one of the valid values.  So I
wonder if this kind of corruption should be detected at a different
spot, like throwing an exception from compute_variant_fields_inner.

Tom> [ Given the description at the top of gdb/value.h of optimized out and
Tom> unavailable, I was not sure which one to pick for this case, so this is more
Tom> or less a random choice.

Yeah, neither seems like precisely the right fit.

Tom

  reply	other threads:[~2024-01-22 16:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 13:28 Tom de Vries
2024-01-22 16:29 ` Tom Tromey [this message]
2024-01-24 16:15   ` Tom de Vries
2024-01-24 17:33     ` Tom Tromey
2024-01-25 12:56       ` Tom de Vries

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=87h6j5jpqh.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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).