public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/29343] [gdb/symtab] per_cu->length set without initial_length_size
Date: Wed, 13 Jul 2022 07:41:17 +0000	[thread overview]
Message-ID: <bug-29343-4717-M0c7X0m0YM@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29343-4717@http.sourceware.org/bugzilla/>

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

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #2)
> ...
> @@ -23377,8 +23377,6 @@ dwarf2_per_cu_data::get_header () const
>        const gdb_byte *info_ptr
>         = this->section->buffer + to_underlying (this->sect_off);
>  
> -      memset (&m_header, 0, sizeof (m_header));
> -
>        read_comp_unit_head (&m_header, info_ptr, this->section,
>                            rcuh_kind::COMPILE);
>  
> ...

Hmm, so struct comp_unit_head is a POD, that we init using memset, sometimes.

Sometimes we just initialize a bit, like this:
...
      /* Initialize it due to a false compiler warning.  */
      header.signature = -1;
      header.type_cu_offset_in_tu = (cu_offset) -1;
...

And sometime not at all (before the reading is done).

To make sure things are initialized consistently, we'd have to start using
constructors, which I suppose means we no longer can use the memset.

So I guess this requires a larger rewrite.

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

  parent reply	other threads:[~2022-07-13  7:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09  8:24 [Bug symtab/29343] New: " vries at gcc dot gnu.org
2022-07-09  8:24 ` [Bug symtab/29343] " vries at gcc dot gnu.org
2022-07-09  8:34 ` vries at gcc dot gnu.org
2022-07-09  9:17 ` vries at gcc dot gnu.org
2022-07-11  9:40 ` vries at gcc dot gnu.org
2022-07-13  7:41 ` vries at gcc dot gnu.org [this message]
2022-07-13  7:42 ` [Bug symtab/29343] [gdb/symtab] c++-ify comp_unit_head vries at gcc dot gnu.org
2022-12-24 22:45 ` tromey at sourceware dot org
2022-12-25  8:25 ` vries at gcc dot gnu.org
2022-12-26 20:59 ` cvs-commit at gcc dot gnu.org
2022-12-26 21:03 ` tromey at sourceware dot org
2022-12-30 12:55 ` cvs-commit at gcc dot gnu.org

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=bug-29343-4717-M0c7X0m0YM@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).