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/28261] [debug-names] FAIL: gdb.dwarf2/dw2-ranges-psym.exp: No complaints
Date: Wed, 25 Aug 2021 08:18:18 +0000	[thread overview]
Message-ID: <bug-28261-4717-2bwtIEtc9C@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28261-4717@http.sourceware.org/bugzilla/>

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

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
Alternatively, we can do:
...
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
index 4e00c716d91..7333e2b2d55 100644
--- a/gdb/dwarf2/index-write.c
+++ b/gdb/dwarf2/index-write.c
@@ -1481,14 +1481,11 @@ write_debug_names (dwarf2_per_objfile *per_objfile,
   header.append_uint (2, dwarf5_byte_order, 0);

   /* comp_unit_count - The number of CUs in the CU list.  */
-  header.append_uint (4, dwarf5_byte_order,
-                     per_objfile->per_bfd->all_comp_units.size ()
-                     - per_objfile->per_bfd->tu_stats.nr_tus);
+  header.append_uint (4, dwarf5_byte_order, counter);

   /* local_type_unit_count - The number of TUs in the local TU
      list.  */
-  header.append_uint (4, dwarf5_byte_order,
-                     per_objfile->per_bfd->tu_stats.nr_tus);
+  header.append_uint (4, dwarf5_byte_order, types_counter);

   /* foreign_type_unit_count - The number of TUs in the foreign TU
      list.  */
...
which gives us:
...
CU table:
[  0] 0x0
[  1] 0x2e
[  2] 0xa5
[  3] 0xd2
[  4] 0x150
[  5] 0x308
...
but then we run into:
...
$ gdb -q -batch \
  -ex "set trace-commands on" \
  -x outputs/gdb.dwarf2/dw2-ranges-psym/gdb.in.6
+set height 0
+set width 0
+dir
+dir /home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.dwarf2
+show complaints
Max number of complaints about incorrect symbols is 0.
+set complaints 5
+file ./outputs/gdb.dwarf2/dw2-ranges-psym/dw2-ranges-psym
+set complaints 0
+delete breakpoints
+info breakpoints
No breakpoints or watchpoints.
+break -qualified main
Breakpoint 1 at 0x4004ab
+run 

Breakpoint 1, 0x00000000004004ab in main ()
+break someothername
src/gdb/dwarf2/read.c:6627: internal-error:
cutu_reader::cutu_reader(dwarf2_per_cu_data*, dwarf2_per_objfile*,
abbrev_table*, dwarf2_cu*, bool): Assertion `this_cu->length ==
cu->header.get_length ()' failed.
...

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

  parent reply	other threads:[~2021-08-25  8:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24 15:22 [Bug symtab/28261] New: " vries at gcc dot gnu.org
2021-08-24 15:36 ` [Bug symtab/28261] " vries at gcc dot gnu.org
2021-08-25  7:47 ` vries at gcc dot gnu.org
2021-08-25  7:50 ` vries at gcc dot gnu.org
2021-08-25  8:18 ` vries at gcc dot gnu.org [this message]
2021-08-26 12:00 ` vries at gcc dot gnu.org
2021-09-14 11:10 ` vries 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-28261-4717-2bwtIEtc9C@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).