public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
@ 2022-10-16  7:41 vries at gcc dot gnu.org
  2022-10-16  7:41 ` [Bug symtab/29694] " vries at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2022-10-16  7:41 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 29694
           Summary: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp:
                    print sizeof(a)/sizeof(a[0])
           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: ---

On openSUSE Tumbleweed with test-case gdb.cp/stub-array-size.exp and target
board cc-with-gdb-index, I run into:
...
(gdb) print sizeof(a)/sizeof(a[0])^M
Division by zero^M
(gdb) FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
...

This is a regression since gdb 12 branch point.

Bisects to:
...
6acc36f71dfc60e357496174672103f133f85e97 is the first bad commit
commit 6acc36f71dfc60e357496174672103f133f85e97
Author: Tom Tromey <tromey@adacore.com>
Date:   Thu Apr 21 09:37:24 2022 -0600

    Fix method naming bug in new DWARF indexer
...

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

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

* [Bug symtab/29694] [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
  2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
@ 2022-10-16  7:41 ` vries at gcc dot gnu.org
  2022-10-16  7:43 ` vries at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2022-10-16  7:41 UTC (permalink / raw)
  To: gdb-prs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

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

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

* [Bug symtab/29694] [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
  2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
  2022-10-16  7:41 ` [Bug symtab/29694] " vries at gcc dot gnu.org
@ 2022-10-16  7:43 ` vries at gcc dot gnu.org
  2022-10-16 15:39 ` vries at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2022-10-16  7:43 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
This is not reproducible sofar on Leap 15.4.

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

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

* [Bug symtab/29694] [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
  2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
  2022-10-16  7:41 ` [Bug symtab/29694] " vries at gcc dot gnu.org
  2022-10-16  7:43 ` vries at gcc dot gnu.org
@ 2022-10-16 15:39 ` vries at gcc dot gnu.org
  2022-10-16 16:10 ` tromey at sourceware dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2022-10-16 15:39 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 14400
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14400&action=edit
Patch adding hardcoded .s test-case

Using this test-case, I can reproduce the problem on Leap 15.4.

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

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

* [Bug symtab/29694] [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
  2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-10-16 15:39 ` vries at gcc dot gnu.org
@ 2022-10-16 16:10 ` tromey at sourceware dot org
  2022-10-17  3:59 ` vries at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2022-10-16 16:10 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.1

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
I was able to reproduce on Fedora 34.
On Monday I'll check if my gdb-index series fixes it.

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

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

* [Bug symtab/29694] [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
  2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-10-16 16:10 ` tromey at sourceware dot org
@ 2022-10-17  3:59 ` vries at gcc dot gnu.org
  2022-10-17 15:48 ` tromey at sourceware dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: vries at gcc dot gnu.org @ 2022-10-17  3:59 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom Tromey from comment #3)
> I was able to reproduce on Fedora 34.
> On Monday I'll check if my gdb-index series fixes it.

Unfortunately, for me it doesn't.

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

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

* [Bug symtab/29694] [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
  2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-10-17  3:59 ` vries at gcc dot gnu.org
@ 2022-10-17 15:48 ` tromey at sourceware dot org
  2022-10-17 15:56 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2022-10-17 15:48 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
The new index says:

[1008] A: 0 [global, type]

whereas the old one says:

[737] A: 1 [global, type]

Here the old one is correct because the A in CU 0 is
just a declaration without a size:

 <1><45>: Abbrev Number: 10 (DW_TAG_structure_type)
    <46>   DW_AT_name        : A
    <48>   DW_AT_declaration : 1
    <48>   DW_AT_sibling     : <0x6d>

So, I think the solution is probably for the scanner to
avoid creating entries for these declaration types.

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

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

* [Bug symtab/29694] [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
  2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-10-17 15:48 ` tromey at sourceware dot org
@ 2022-10-17 15:56 ` tromey at sourceware dot org
  2022-10-17 16:04 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2022-10-17 15:56 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

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

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

* [Bug symtab/29694] [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
  2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2022-10-17 15:56 ` tromey at sourceware dot org
@ 2022-10-17 16:04 ` tromey at sourceware dot org
  2022-10-17 19:41 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2022-10-17 16:04 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |29366


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=29366
[Bug 29366] [meta] New DWARF indexer meta bug
-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug symtab/29694] [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
  2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2022-10-17 16:04 ` tromey at sourceware dot org
@ 2022-10-17 19:41 ` tromey at sourceware dot org
  2022-10-21 16:13 ` cvs-commit at gcc dot gnu.org
  2022-10-21 16:14 ` tromey at sourceware dot org
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2022-10-17 19:41 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2022-October/192767.html

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

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

* [Bug symtab/29694] [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
  2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2022-10-17 19:41 ` tromey at sourceware dot org
@ 2022-10-21 16:13 ` cvs-commit at gcc dot gnu.org
  2022-10-21 16:14 ` tromey at sourceware dot org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-21 16:13 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2afd002ac6acb01763d643686345cc0c6ad564bd

commit 2afd002ac6acb01763d643686345cc0c6ad564bd
Author: Tom Tromey <tromey@adacore.com>
Date:   Mon Oct 17 12:21:10 2022 -0600

    Fix incorrect .gdb_index with new DWARF scanner

    PR symtab/29694 points out a regression caused by the new DWARF
    scanner when the cc-with-gdb-index target board is used.

    What happens here is that an older version of gdb will make an index
    describing the "A" type as:

    [737] A: 1 [global, type]

    whereas the new gdb says:

    [1008] A: 0 [global, type]

    Here the old one is correct because the A in CU 0 is just a
    declaration without a size:

     <1><45>: Abbrev Number: 10 (DW_TAG_structure_type)
        <46>   DW_AT_name        : A
        <48>   DW_AT_declaration : 1
        <48>   DW_AT_sibling     : <0x6d>

    This patch fixes the problem by introducing the idea of a "type
    declaration".  I think gdb still needs to recurse into these types,
    searching for methods, but by marking the type itself as a
    declaration, gdb can skip this type during lookups and when writing
    the index.

    Regression tested on x86-64 using the cc-with-gdb-index board.

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

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

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

* [Bug symtab/29694] [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0])
  2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2022-10-21 16:13 ` cvs-commit at gcc dot gnu.org
@ 2022-10-21 16:14 ` tromey at sourceware dot org
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2022-10-21 16:14 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
            Version|HEAD                        |unknown

--- Comment #8 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

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

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

end of thread, other threads:[~2022-10-21 16:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-16  7:41 [Bug symtab/29694] New: [gdb, gdb-index] FAIL: gdb.cp/stub-array-size.exp: print sizeof(a)/sizeof(a[0]) vries at gcc dot gnu.org
2022-10-16  7:41 ` [Bug symtab/29694] " vries at gcc dot gnu.org
2022-10-16  7:43 ` vries at gcc dot gnu.org
2022-10-16 15:39 ` vries at gcc dot gnu.org
2022-10-16 16:10 ` tromey at sourceware dot org
2022-10-17  3:59 ` vries at gcc dot gnu.org
2022-10-17 15:48 ` tromey at sourceware dot org
2022-10-17 15:56 ` tromey at sourceware dot org
2022-10-17 16:04 ` tromey at sourceware dot org
2022-10-17 19:41 ` tromey at sourceware dot org
2022-10-21 16:13 ` cvs-commit at gcc dot gnu.org
2022-10-21 16:14 ` 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).