public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/30822] New: [gdb/symtab] Handle cyclic DIE references
@ 2023-09-04 11:41 vries at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: vries at gcc dot gnu.org @ 2023-09-04 11:41 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 30822
           Summary: [gdb/symtab] Handle cyclic DIE references
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

There are a few fixes in place in gdb/dwarf2/read.c that deal with
self-referencing DIEs:
...
$ grep -i self-ref gdb/dwarf2/read.c
              /* Handle DIE with self-reference.  */
      /* Self-referential typedefs are, it seems, not allowed by the DWARF
      complaint (_("Self-referential DW_TAG_typedef "
              /* Self-reference, we're done.  */
        /* Self-reference, we're done.  */
      /* Self-reference, we're done.  */
...

These prevent either a hang or running out of stack.

The generic case of cyclic DIE references (for instance DIE A references DIE B,
DIE B references DIE A) hasn't been solved though.

Tom Tromey mentioned using a tortoise/hare approach to detect the cycles here (
https://sourceware.org/pipermail/gdb-patches/2023-August/201921.html ).

See https://en.wikipedia.org/wiki/Cycle_detection#Floyd's_tortoise_and_hare .

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-04 11:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-04 11:41 [Bug symtab/30822] New: [gdb/symtab] Handle cyclic DIE references vries at gcc dot gnu.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).