public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/31897] New: [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST
@ 2024-06-15  8:34 vries at gcc dot gnu.org
  2024-06-15 21:58 ` [Bug symtab/31897] " vries at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-06-15  8:34 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 31897
           Summary: [gdb/symtab] FAIL: gdb.base/fission-macro.exp:
                    dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info
                    macro FIRST
           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: ---

Here ( https://linaro.atlassian.net/browse/GNU-1258 ) the following FAIL is
reported on arm-linux:
...
(gdb) info macro FIRST
Defined at
/home/tcwg-buildslave/workspace/tcwg_gnu_2/abe/snapshots/gdb.git~master/gdb/testsuite/gdb.base/fission-macro.c:0
-DFIRST=1
(gdb) FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32:
strict_dwarf=0: info macro FIRST
...

In contrast, on x86_64-linux I see:
...
(gdb) info macro FIRST^M
Defined at /data/vries/gdb/src/gdb/testsuite/gdb.base/fission-macro.c:18^M
#define FIRST 1^M
(gdb) PASS: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32:
strict_dwarf=0: info macro FIRST
...

So, the line number for the macro definition seems to be incorrect: 0 instead
of 18, and consequently we get "-DFIRST=1" instead of "#define FIRST 1".

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

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

* [Bug symtab/31897] [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST
  2024-06-15  8:34 [Bug symtab/31897] New: [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST vries at gcc dot gnu.org
@ 2024-06-15 21:58 ` vries at gcc dot gnu.org
  2025-01-21 10:20 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-06-15 21:58 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
I managed to reproduce this by building gcc from trunk on arm-linux, and
compiling the source file like this:
...
$ /home/linux/gcc/install/bin/gcc
/home/linux/gdb/src/gdb/testsuite/gdb.base/fission-macro.c -c -gsplit-dwarf
-gdwarf-5 -g3
...
and then doing:
...
$ gdb -q -batch fission-macro.o -ex "info macros fission-macro.c:25" 2>&1 |
grep -B1 FIRST
Defined at /home/linux/gdb/src/gdb/testsuite/gdb.base/fission-macro.c:0
-DFIRST=1
...

That however is fixed by "[gdb/macros] Handle 64-bit dwarf in
gdb.base/fission-macro.exp" (
https://sourceware.org/pipermail/gdb-patches/2024-May/209297.html ):
...
$ gdb -q -batch fission-macro.o -ex "info macros fission-macro.c:25" 2>&1 |
grep -B1 FIRST
Defined at /home/linux/gdb/src/gdb/testsuite/gdb.base/fission-macro.c:18
#define FIRST 1
...
and that stays the same if we apply the entire patch series.

However, that changes when we use a relative patch name for the source file:
...
$ /home/linux/gcc/install/bin/gcc src/gdb/testsuite/gdb.base/fission-macro.c -c
-gsplit-dwarf -gdwarf-5 -g3
...

The same problem occurs, and the same patch fixes it, but after applying
"[gdb/macros] Fix gdb.base/fission-macro.exp with clang" from that series, we
get another problem:
...
$ gdb -q -batch -iex "set complaints 1000" fission-macro.o -ex "info macros
fission-macro.c:25"
During symbol reading: debug info gives source 2 included from file at zero
line 0
During symbol reading: symtab found for
`src/gdb/testsuite/gdb.base/fission-macro.c', but that file
is not covered in the compilation unit's macro information
$
...

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

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

* [Bug symtab/31897] [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST
  2024-06-15  8:34 [Bug symtab/31897] New: [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST vries at gcc dot gnu.org
  2024-06-15 21:58 ` [Bug symtab/31897] " vries at gcc dot gnu.org
@ 2025-01-21 10:20 ` vries at gcc dot gnu.org
  2025-01-21 14:23 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2025-01-21 10:20 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2025-January/214901.html

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

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

* [Bug symtab/31897] [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST
  2024-06-15  8:34 [Bug symtab/31897] New: [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST vries at gcc dot gnu.org
  2024-06-15 21:58 ` [Bug symtab/31897] " vries at gcc dot gnu.org
  2025-01-21 10:20 ` vries at gcc dot gnu.org
@ 2025-01-21 14:23 ` cvs-commit at gcc dot gnu.org
  2025-01-21 14:24 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2025-01-21 14:23 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

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

commit 8935725a44715b687908dc3daeee26597aa40dab
Author: Tom de Vries <tdevries@suse.de>
Date:   Tue Jan 21 15:23:19 2025 +0100

    [gdb/symtab] Fix gdb.base/fission-macro.exp with unix/-m32

    When running test-case gdb.base/fission-macro.exp on openSUSE Tumbleweed
    (using gcc 14) with target board unix/-m32, I get:
    ...
    (gdb) info macro FIRST^M
    Defined at /data/vries/gdb/src/gdb/testsuite/gdb.base/fission-macro.c:0^M
    -DFIRST=1^M
    (gdb) FAIL: $exp: \
      dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST
    ...
    instead of the expected:
    ...
    (gdb) info macro FIRST^M
    Defined at /data/vries/gdb/src/gdb/testsuite/gdb.base/fission-macro.c:18^M
    (gdb) PASS: $exp: \
      dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST
    ...

    A dwarf-5 .debug_str_offsets section starts with a header consisting of:
    - an initial length (4 bytes for 32-bit and 12 bytes for 64-bit),
    - a 2 byte version string, and
    - 2 bytes padding
    so in total 8 bytes for 32-bit and 16 bytes for 64-bit.

    This offset is calculated here in dwarf_decode_macros:
    ...
          str_offsets_base = cu->header.addr_size;
    ...
    which is wrong for both dwarf-5 cases (and also happens to be wrong for
    dwarf-4).

    Fix this by computing str_offsets_base correctly for dwarf-5, for both the
    32-bit and 64-bit case.

    Likewise, fix this for dwarf-4, using str_offsets_base 0.  We can only test
    this with gcc-15, because gcc 14 and earlier don't have the fix for
    PR debug/115066.

    Tested on x86_64-linux.

    Tested test-case using a current gcc trunk build, and gcc 14.

    Approved-By: Tom Tromey <tom@tromey.com>

    PR symtab/31897
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31897

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

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

* [Bug symtab/31897] [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST
  2024-06-15  8:34 [Bug symtab/31897] New: [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2025-01-21 14:23 ` cvs-commit at gcc dot gnu.org
@ 2025-01-21 14:24 ` vries at gcc dot gnu.org
  2025-03-09  0:10 ` tromey at sourceware dot org
  2025-03-09  0:14 ` sam at gentoo dot org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2025-01-21 14:24 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |17.1

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed.

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

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

* [Bug symtab/31897] [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST
  2024-06-15  8:34 [Bug symtab/31897] New: [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2025-01-21 14:24 ` vries at gcc dot gnu.org
@ 2025-03-09  0:10 ` tromey at sourceware dot org
  2025-03-09  0:14 ` sam at gentoo dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2025-03-09  0:10 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 CC|                            |tromey at sourceware dot org

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
I'm going to close this since it says it's fixed, but
there's a followup - bug#32771

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

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

* [Bug symtab/31897] [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST
  2024-06-15  8:34 [Bug symtab/31897] New: [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2025-03-09  0:10 ` tromey at sourceware dot org
@ 2025-03-09  0:14 ` sam at gentoo dot org
  5 siblings, 0 replies; 7+ messages in thread
From: sam at gentoo dot org @ 2025-03-09  0:14 UTC (permalink / raw)
  To: gdb-prs

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

Sam James <sam at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://linaro.atlassian.ne
                   |                            |t/browse/GNU-1258,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=115066,
                   |                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=32771

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

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

end of thread, other threads:[~2025-03-09  0:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-15  8:34 [Bug symtab/31897] New: [gdb/symtab] FAIL: gdb.base/fission-macro.exp: dwarf_version=5: dwarf_bits=32: strict_dwarf=0: info macro FIRST vries at gcc dot gnu.org
2024-06-15 21:58 ` [Bug symtab/31897] " vries at gcc dot gnu.org
2025-01-21 10:20 ` vries at gcc dot gnu.org
2025-01-21 14:23 ` cvs-commit at gcc dot gnu.org
2025-01-21 14:24 ` vries at gcc dot gnu.org
2025-03-09  0:10 ` tromey at sourceware dot org
2025-03-09  0:14 ` sam at gentoo 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).