public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/28298] New: [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main
@ 2021-09-01 14:37 vries at gcc dot gnu.org
  2021-09-01 14:39 ` [Bug testsuite/28298] " vries at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-09-01 14:37 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 28298
           Summary: [gdb/testsuite][make check//unix] FAIL:
                    gdb.dwarf2/fission-base.exp: ptype main
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Consider test-case fission-base.exp.

Let's do a normal make check:
...
$ ( cd build/gdb; make check RUNTESTFLAGS="fission-base.exp" | grep "expected
passes")
# of expected passes            6
...
all looking good.

Now let's specify the target board unix using --target_board:
...
$ ( cd build/gdb; make check RUNTESTFLAGS="--target_board=unix
fission-base.exp" | grep "expected passes")
# of expected passes            6
...
All still looking good.

Now let's try the same target board using check//unix:
...
$ ( cd build/gdb; make check//unix RUNTESTFLAGS="fission-base.exp" | grep
"expected passes")# of expected passes            2
make[2]: *** [Makefile:206: check-single] Error 1
make[1]: *** [Makefile:159: check] Error 2
make: *** [Makefile:1706: check//unix] Error 2
...
Not so good.

In more detail, we have:
...
FAIL: gdb.dwarf2/fission-base.exp: ptype main
FAIL: gdb.dwarf2/fission-base.exp: ptype func
FAIL: gdb.dwarf2/fission-base.exp: continue to func
FAIL: gdb.dwarf2/fission-base.exp: frame in func
...
because:
...
(gdb) file
/home/vries/gdb_versions/devel/build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base^M
Reading symbols from
/home/vries/gdb_versions/devel/build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base...^M
warning: Could not find DWO CU
/home/vries/gdb_versions/devel/build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo(0x807060504030201)
referenced by CU at offset 0xc7 [in module
/home/vries/gdb_versions/devel/build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base]^M
...

Indeed there is no such file:
...
$ ls
/home/vries/gdb_versions/devel/build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo
ls: cannot access
'/home/vries/gdb_versions/devel/build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo':
No such file or directory
...

After adding additional_flags=-save-temps in the .exp file we see in the .s
file after preprocessor expansion:
...
 .asciz
"/home/vries/gdb_versions/devel/build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo"
# DW_AT_GNU_dwo_name
...
and we're expecting testsuite.unix instead of testsuite.1.

This is caused by this trick in fission-base.S:
...
#define XSTR(s) STR(s)
#define STR(s) #s
  ...
        .asciz XSTR(DWO)        # DW_AT_GNU_dwo_name
...
and:
...
$ echo | gcc -E -dD - | grep "define unix"
#define unix 1
...
in combination with -DDWO=.../testsuite.unix/... .

-- 
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 testsuite/28298] [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main
  2021-09-01 14:37 [Bug testsuite/28298] New: [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main vries at gcc dot gnu.org
@ 2021-09-01 14:39 ` vries at gcc dot gnu.org
  2021-09-01 14:40 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-09-01 14:39 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed by f.i.:
...
diff --git a/gdb/testsuite/gdb.dwarf2/fission-base.S
b/gdb/testsuite/gdb.dwarf2/fission-bas
e.S
index 5e10713e938..e11500cf64e 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-base.S
+++ b/gdb/testsuite/gdb.dwarf2/fission-base.S
@@ -20,9 +20,6 @@
    and then massaging the output.
 */

-#define XSTR(s) STR(s)
-#define STR(s) #s
-
        .file   "fission-base.c"

        .text
@@ -146,7 +143,7 @@ main:
        .8byte  .Letext0-.Ltext0        # DW_AT_high_pc
        .4byte  .Ldebug_line0   # DW_AT_stmt_list
        .ascii "/tmp/src/gdb/testsuite\0"       # DW_AT_comp_dir
-       .asciz XSTR(DWO)        # DW_AT_GNU_dwo_name
+       .asciz DWO      # DW_AT_GNU_dwo_name
        .4byte  .Ldebug_pubnames0       # DW_AT_GNU_pubnames
        .4byte  .Ldebug_pubtypes0       # DW_AT_GNU_pubtypes
        .4byte  .Ldebug_addr0_begin     # DW_AT_GNU_addr_base
diff --git a/gdb/testsuite/gdb.dwarf2/fission-base.exp
b/gdb/testsuite/gdb.dwarf2/fission-b
ase.exp
index 00eb7fec1b0..e5933103d79 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-base.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-base.exp
@@ -36,7 +36,7 @@ set obj [standard_output_file "${testfile}.o"]
 set dwo [standard_output_file "${testfile}.dwo"]
 if [build_executable_and_dwo_files "$testfile.exp" "${binfile}" {nodebug} \
        [list $srcfile \
-            [list nodebug split-dwo additional_flags=-DDWO=$dwo] \
+            [list nodebug split-dwo additional_flags=-DDWO=\"$dwo\"] \
             $obj]] {
     return -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 testsuite/28298] [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main
  2021-09-01 14:37 [Bug testsuite/28298] New: [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main vries at gcc dot gnu.org
  2021-09-01 14:39 ` [Bug testsuite/28298] " vries at gcc dot gnu.org
@ 2021-09-01 14:40 ` vries at gcc dot gnu.org
  2021-09-01 14:53 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-09-01 14:40 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #1)
> Fixed by f.i.:

Or:
...
diff --git a/gdb/testsuite/gdb.dwarf2/fission-base.exp
b/gdb/testsuite/gdb.dwarf2/fission-b
ase.exp
index 00eb7fec1b0..2fd97d07ce4 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-base.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-base.exp
@@ -36,7 +36,8 @@ set obj [standard_output_file "${testfile}.o"]
 set dwo [standard_output_file "${testfile}.dwo"]
 if [build_executable_and_dwo_files "$testfile.exp" "${binfile}" {nodebug} \
        [list $srcfile \
-            [list nodebug split-dwo additional_flags=-DDWO=$dwo] \
+            [list nodebug split-dwo additional_flags=-DDWO=$dwo \
+                 additional_flags=-undef] \
             $obj]] {
     return -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 testsuite/28298] [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main
  2021-09-01 14:37 [Bug testsuite/28298] New: [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main vries at gcc dot gnu.org
  2021-09-01 14:39 ` [Bug testsuite/28298] " vries at gcc dot gnu.org
  2021-09-01 14:40 ` vries at gcc dot gnu.org
@ 2021-09-01 14:53 ` vries at gcc dot gnu.org
  2021-09-01 16:18 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-09-01 14:53 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #1)
> -       .asciz XSTR(DWO)        # DW_AT_GNU_dwo_name
> +       .asciz DWO      # DW_AT_GNU_dwo_name

> -            [list nodebug split-dwo additional_flags=-DDWO=$dwo] \
> +            [list nodebug split-dwo additional_flags=-DDWO=\"$dwo\"] \

I'll go for this solution, I found other test-cases that use the same pattern.

-- 
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 testsuite/28298] [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main
  2021-09-01 14:37 [Bug testsuite/28298] New: [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-09-01 14:53 ` vries at gcc dot gnu.org
@ 2021-09-01 16:18 ` cvs-commit at gcc dot gnu.org
  2021-09-01 18:14 ` cvs-commit at gcc dot gnu.org
  2021-09-01 18:15 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-01 16:18 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from cvs-commit at gcc dot gnu.org <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=250e8e0d7fe4afcb125f9c7838fca9ec66ecc407

commit 250e8e0d7fe4afcb125f9c7838fca9ec66ecc407
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Sep 1 18:18:05 2021 +0200

    [gdb/testsuite] Fix dwo path in fission-*.S

    [ Using $build for /home/vries/gdb_versions/devel/build to make things a
bit
    more readable. ]

    When using make check// to run test-case gdb.dwarf2/fission-base.exp:
    ...
    ( cd $build/gdb; make check//unix RUNTESTFLAGS="fission-base.exp" )
    ...
    we run into:
    ...
    (gdb) file \
      $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base^M
    Reading symbols from \
     
$build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base...^M
    warning: Could not find DWO CU \
      $build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo \
      (0x807060504030201) referenced by CU at offset 0xc7 [in module \
      $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base]^M
    ...

    The problem is that the executable refers to the dwo file using path name
    $build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo,
    while the actual dwo file is at
    $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base.dwo.

    This is caused by this trick in fission-base.S:
    ...
     #define XSTR(s) STR(s)
     #define STR(s) #s
       ...
       .asciz XSTR(DWO)        # DW_AT_GNU_dwo_name
    ...
    and:
    ...
    $ echo | gcc -E -dD - | grep "define unix"
    ...

    I used this trick to avoid doing additional_flags=-DDWO=\"$dwo\", since I
was
    concerned that there could be quoting issues.

    However, I've found other uses of this pattern, f.i. in
    gdb/testsuite/gdb.base/corefile-buildid.exp:
    ...
      additional_flags=-DSHLIB_NAME=\"$dlopen_lib\"]
    ...

    So, fix this by:
    - using additional_flags=-DDWO=\"$dwo\" and
    - using plain DWO instead of XSTR(DWO)

    Likewise in other gdb.dwarf2/fission*.exp test-cases.

    Tested on x86_64-linux, using make check//unix.

    gdb/testsuite/ChangeLog:

    2021-09-01  Tom de Vries  <tdevries@suse.de>

            PR testsuite/28298
            * gdb.dwarf2/fission-base.S: Use DWO instead of XSTR(DWO).
            * gdb.dwarf2/fission-loclists-pie.S: Same.
            * gdb.dwarf2/fission-loclists.S: Same.
            * gdb.dwarf2/fission-reread.S: Same.
            * gdb.dwarf2/fission-base.exp: Use additional_flags=-DDWO=\"$dwo\".
            * gdb.dwarf2/fission-loclists-pie.exp: Same.
            * gdb.dwarf2/fission-loclists.exp: Same.
            * gdb.dwarf2/fission-reread.exp: Same.

-- 
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 testsuite/28298] [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main
  2021-09-01 14:37 [Bug testsuite/28298] New: [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-09-01 16:18 ` cvs-commit at gcc dot gnu.org
@ 2021-09-01 18:14 ` cvs-commit at gcc dot gnu.org
  2021-09-01 18:15 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-01 18:14 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-11-branch branch has been updated by Tom de Vries
<vries@sourceware.org>:

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

commit c52e9db30f3e288b0b574aa471d87291945df304
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Sep 1 20:14:53 2021 +0200

    [gdb/testsuite] Fix dwo path in fission-*.S

    [ Using $build for /home/vries/gdb_versions/devel/build to make things a
bit
    more readable. ]

    When using make check// to run test-case gdb.dwarf2/fission-base.exp:
    ...
    ( cd $build/gdb; make check//unix RUNTESTFLAGS="fission-base.exp" )
    ...
    we run into:
    ...
    (gdb) file \
      $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base^M
    Reading symbols from \
     
$build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base...^M
    warning: Could not find DWO CU \
      $build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo \
      (0x807060504030201) referenced by CU at offset 0xc7 [in module \
      $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base]^M
    ...

    The problem is that the executable refers to the dwo file using path name
    $build/gdb/testsuite.1/outputs/gdb.dwarf2/fission-base/fission-base.dwo,
    while the actual dwo file is at
    $build/gdb/testsuite.unix/outputs/gdb.dwarf2/fission-base/fission-base.dwo.

    This is caused by this trick in fission-base.S:
    ...
     #define XSTR(s) STR(s)
     #define STR(s) #s
       ...
       .asciz XSTR(DWO)        # DW_AT_GNU_dwo_name
    ...
    and:
    ...
    $ echo | gcc -E -dD - | grep "define unix"
    ...

    I used this trick to avoid doing additional_flags=-DDWO=\"$dwo\", since I
was
    concerned that there could be quoting issues.

    However, I've found other uses of this pattern, f.i. in
    gdb/testsuite/gdb.base/corefile-buildid.exp:
    ...
      additional_flags=-DSHLIB_NAME=\"$dlopen_lib\"]
    ...

    So, fix this by:
    - using additional_flags=-DDWO=\"$dwo\" and
    - using plain DWO instead of XSTR(DWO)

    Likewise in other gdb.dwarf2/fission*.exp test-cases.

    Tested on x86_64-linux, using make check//unix.

    gdb/testsuite/ChangeLog:

    2021-09-01  Tom de Vries  <tdevries@suse.de>

            PR testsuite/28298
            * gdb.dwarf2/fission-base.S: Use DWO instead of XSTR(DWO).
            * gdb.dwarf2/fission-loclists-pie.S: Same.
            * gdb.dwarf2/fission-loclists.S: Same.
            * gdb.dwarf2/fission-reread.S: Same.
            * gdb.dwarf2/fission-base.exp: Use additional_flags=-DDWO=\"$dwo\".
            * gdb.dwarf2/fission-loclists-pie.exp: Same.
            * gdb.dwarf2/fission-loclists.exp: Same.
            * gdb.dwarf2/fission-reread.exp: Same.

-- 
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 testsuite/28298] [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main
  2021-09-01 14:37 [Bug testsuite/28298] New: [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-09-01 18:14 ` cvs-commit at gcc dot gnu.org
@ 2021-09-01 18:15 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-09-01 18:15 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |11.1

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
Patch committed to trunk and backported to gdb-11-branch, marking
resolved-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

end of thread, other threads:[~2021-09-01 18:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 14:37 [Bug testsuite/28298] New: [gdb/testsuite][make check//unix] FAIL: gdb.dwarf2/fission-base.exp: ptype main vries at gcc dot gnu.org
2021-09-01 14:39 ` [Bug testsuite/28298] " vries at gcc dot gnu.org
2021-09-01 14:40 ` vries at gcc dot gnu.org
2021-09-01 14:53 ` vries at gcc dot gnu.org
2021-09-01 16:18 ` cvs-commit at gcc dot gnu.org
2021-09-01 18:14 ` cvs-commit at gcc dot gnu.org
2021-09-01 18:15 ` 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).