public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/29306] New: Replace some asserts with errors
@ 2022-06-30 14:26 vries at gcc dot gnu.org
  2022-06-30 14:27 ` [Bug gdb/29306] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2022-06-30 14:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29306

            Bug ID: 29306
           Summary: Replace some asserts with errors
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

We've introduced kind-checking accessor functions like this:
...
  LONGEST loc_bitpos () const
  {
    gdb_assert (m_loc_kind == FIELD_LOC_KIND_BITPOS);
    return m_loc.bitpos;
  }
...
and that's great because that enables us to find bugs, f.i. PR29294.

OTOH, I wonder if this:
...
(gdb) print ptm
$1 = gdb/gdbtypes.h:695: internal-error: loc_bitpos: \
  Assertion `m_loc_kind == FIELD_LOC_KIND_BITPOS' failed.
$
...
is not a bit too much, and we should instead have something along the lines of:
...
(gdb) print ptm^M
$1 = <gdb/gdbtypes.h:695: internal-error: loc_bitpos: \
  Assertion `m_loc_kind == FIELD_LOC_KIND_BITPOS' failed.>
(gdb)
...
allowing us to get back to the gdb prompt.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-04 20:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30 14:26 [Bug gdb/29306] New: Replace some asserts with errors vries at gcc dot gnu.org
2022-06-30 14:27 ` [Bug gdb/29306] " vries at gcc dot gnu.org
2022-06-30 14:29 ` simark at simark dot ca
2022-06-30 15:03 ` vries at gcc dot gnu.org
2022-07-04 20:54 ` tromey at sourceware dot org

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).