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: Sat, 09 Jul 2022 09:17:09 +0000	[thread overview]
Message-ID: <bug-29343-4717-2lwSIrwyv2@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 #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 14200
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14200&action=edit
tentative patch

This patch fixes the one use:
...
-      this_cu->length = cu_header.length + cu_header.initial_length_size;
+      this_cu->length = cu_header.get_length ();
...
and then proceeds to make the length field private, to enforce using the
accessor.

That works reasonably well, but runs into trouble with this memset:
...
@@ -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);

...
which I removed in the patch, but I'm not sure yet that correct.

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

  parent reply	other threads:[~2022-07-09  9:17 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 [this message]
2022-07-11  9:40 ` vries at gcc dot gnu.org
2022-07-13  7:41 ` vries at gcc dot gnu.org
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-2lwSIrwyv2@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).