Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Make gdb::span handle nullptr like std::span
Date: Sun, 22 Nov 2026 23:25:02 +0000	[thread overview]
Message-ID: <xhuyfld6k78kx.fsf@aburgess-thinkpadp1gen8.rmtgb.csb> (raw)
In-Reply-To: <87qzgcre6n.fsf@tromey.com>

Tom Tromey <tom@tromey.com> writes:

>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>
> Andrew> I don't see any benefit of wrapping these in _GLIBCXX_DEBUG.  Sure it
> Andrew> means we match the std::span behaviour, but all that really means is
> Andrew> that we fail to spot undefined behaviour, which isn't a good thing.
>
> Andrew> I'd prefer these were just unwrapped gdb_assert(...) calls.
>
> Andrew> But if you feel strongly about it then I'm not trying to block this fix.
>
> I only did it because it's what is already done in the file, and because
> in the past we've had discussions about how certain asserts slow things
> down.

Yeah, I think that's why we cannot just set _GLIBCXX_DEBUG on for all
GDB builds (in the same way that standard gdb_asserts are on for all GDB
builds).

But I think these particular asserts are not going to have a massive
performance hit.

>
> I don't mind removing the #ifs at all.

Meh, as you requested, I just pushed my patches, which includes a
similar assert in gdb::make_span, which is an unguarded gdb_assert, so
we will catch some of these anyway, whether using the old gdb::span or
std::span.

I'd drop the #ifs, but I don't feel that strongly about it :)

>
> Andrew> I think you should just go ahead and merge your patch:
>
> Actually I think you should push yours & I will rebase on top of those.

Done.

Thanks for your feedback.

Andrew


  reply	other threads:[~2026-11-22 23:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22  5:41 Tom Tromey
2026-11-22  8:08 ` Andrew Burgess
2026-11-22 17:03   ` Tom Tromey
2026-11-22 23:25     ` Andrew Burgess [this message]
2026-11-22 23:30 ` Tom Tromey
2026-11-23 16:57   ` 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=xhuyfld6k78kx.fsf@aburgess-thinkpadp1gen8.rmtgb.csb \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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