public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/29468] New: GDB test gdb.base/ctf-constvars.exp fails.
@ 2022-08-10 20:30 cel at us dot ibm.com
  2022-09-20 15:43 ` [Bug gdb/29468] " vries at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: cel at us dot ibm.com @ 2022-08-10 20:30 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 29468
           Summary: GDB test gdb.base/ctf-constvars.exp fails.
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: cel at us dot ibm.com
  Target Milestone: ---

The gdb test gdb.base/ctf-constvars.exp fails with gcc (GCC) 12.1.1 20220507
(Red Hat 12.1.1-1)

The test is for the new CTF debug support in gdb/gcc.

In discussing the issue with the test author, they indicate that the issue may
be with ld.  

When the test is run with the command:

 make check RUNTESTFLAGS='GDB=/home/carll/bin/gdb gdb.base/ctf-constvars.exp  '
> out

two files are generated in gdb/testsuite/outputs/gdb.base/ctf-constvars, they
are ctf-constvars0.o  and ctf-constvars.  If you check for the CFT information
in the files using:

objdump --ctf ctf-constvars > ctf-constvars.dump
objdump --ctf ctf-constvars0.o > ctf-constvars0.o.dump

you will find a section "Variables".  in ctf-constvars0.o.dump the section
contains values, i.e.

  Variables:
    caveat -> 0x7: (kind 11) const char *volatile (size 0x8) (aligned at 0x8)
-> 0x5: (kind 3) const char * (size 0x8) (aligned at 0x8) -> 0x2: (kind 12)
const char (size 0x1) (aligned at 0x1) -> 0x1: (kind 1) char (format 0x2) (size
0x1) (aligned at 0x1)
    cavern -> 0x3c: (kind 12) const volatile char *const (size 0x8) (aligned at
0x8) -> 0x3b: (kind 3) const volatile char * (size 0x8) (aligned at 0x8) ->
0x4: (kind 12) const volatile char (size 0x1) (aligned at 0x1) -> 0x3: (kind
11) volatile char (size 0x1) (aligned at 0x1) -> 0x1: (kind 1) char (format
0x2) (size 0x1) (aligned at 0x1)

 etc.

However in the final binary, ctf-constvars.dump all you see is:

  Function objects:

  Variables:

  Types:
    0x1: (kind 1) char (format 0x2) (size 0x1) (aligned at 0x1)
  etc.

Basically, the Variables section is blank in the final binary output. 
Apparently, the ld tool didn't include the data as expected.

The result of all this is the gdb test fails as it can't find the needed debug
information.

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

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

* [Bug gdb/29468] GDB test gdb.base/ctf-constvars.exp fails.
  2022-08-10 20:30 [Bug gdb/29468] New: GDB test gdb.base/ctf-constvars.exp fails cel at us dot ibm.com
@ 2022-09-20 15:43 ` vries at gcc dot gnu.org
  2022-09-27 15:34 ` vries at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-09-20 15:43 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
-Wl,-ctf-variables improves things for me:
...
$ objdump --ctf outputs/gdb.base/ctf-constvars/ctf-constvars | grep vox
    vox -> 0x3: (kind 11) volatile char (size 0x1) (aligned at 0x1) -> 0x1:
(kind 1) char (format 0x3) (size 0x1) (aligned at 0x1)
    0x21d: vox
...

That still doesn't fix things:
...
$ gdb -q -batch outputs/gdb.base/ctf-constvars/ctf-constvars -ex "print vox"
'vox' has unknown type; cast it to its declared type
...
because the dwarf info is in the way.

After stripping the dwarf info:
...
$ strip --strip-debug outputs/gdb.base/ctf-constvars/ctf-constvars
...
we have:
...
$ gdb -q -batch outputs/gdb.base/ctf-constvars/ctf-constvars -ex "print vox"

$1 = 66 'B'
...

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

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

* [Bug gdb/29468] GDB test gdb.base/ctf-constvars.exp fails.
  2022-08-10 20:30 [Bug gdb/29468] New: GDB test gdb.base/ctf-constvars.exp fails cel at us dot ibm.com
  2022-09-20 15:43 ` [Bug gdb/29468] " vries at gcc dot gnu.org
@ 2022-09-27 15:34 ` vries at gcc dot gnu.org
  2022-10-12 15:18 ` [Bug testsuite/29468] " vries at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-09-27 15:34 UTC (permalink / raw)
  To: gdb-prs

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

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

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

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

* [Bug testsuite/29468] GDB test gdb.base/ctf-constvars.exp fails.
  2022-08-10 20:30 [Bug gdb/29468] New: GDB test gdb.base/ctf-constvars.exp fails cel at us dot ibm.com
  2022-09-20 15:43 ` [Bug gdb/29468] " vries at gcc dot gnu.org
  2022-09-27 15:34 ` vries at gcc dot gnu.org
@ 2022-10-12 15:18 ` vries at gcc dot gnu.org
  2022-10-12 15:39 ` cel at us dot ibm.com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-10-12 15:18 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |HEAD
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |13.1
          Component|gdb                         |testsuite

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=908a926ec4ecd48571aafb560d97b927b6f94b5e

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

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

* [Bug testsuite/29468] GDB test gdb.base/ctf-constvars.exp fails.
  2022-08-10 20:30 [Bug gdb/29468] New: GDB test gdb.base/ctf-constvars.exp fails cel at us dot ibm.com
                   ` (2 preceding siblings ...)
  2022-10-12 15:18 ` [Bug testsuite/29468] " vries at gcc dot gnu.org
@ 2022-10-12 15:39 ` cel at us dot ibm.com
  2022-10-12 15:55 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cel at us dot ibm.com @ 2022-10-12 15:39 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Carl E Love <cel at us dot ibm.com> ---
I pulled down the latest gdb on PowerPC, specifically a Power 10 system running 
Fedora release 36 (Thirty Six).


The test still fails.  I see the following errors still:

(gdb) break -qualified main
Breakpoint 1 at 0x10000698
(gdb) run 
Starting program:
/home/carll/GDB/build-hardware-watchpoint/gdb/testsuite/outpu\
ts/gdb.base/ctf-constvars/ctf-constvars 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, 0x0000000010000698 in main ()
(gdb) print vox
'vox' has unknown type; cast it to its declared type
(gdb) FAIL: gdb.base/ctf-constvars.exp: print vox
ptype vox
type = <data variable, no debug info>
(gdb) FAIL: gdb.base/ctf-constvars.exp: ptype vox
print victuals
'victuals' has unknown type; cast it to its declared type
(gdb) FAIL: gdb.base/ctf-constvars.exp: print victuals
ptype victuals
type = <data variable, no debug info>
...

I will take a look and see if I can figure out why this is not fixing the issue
on PowerPC.

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

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

* [Bug testsuite/29468] GDB test gdb.base/ctf-constvars.exp fails.
  2022-08-10 20:30 [Bug gdb/29468] New: GDB test gdb.base/ctf-constvars.exp fails cel at us dot ibm.com
                   ` (3 preceding siblings ...)
  2022-10-12 15:39 ` cel at us dot ibm.com
@ 2022-10-12 15:55 ` vries at gcc dot gnu.org
  2022-10-12 15:56 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-10-12 15:55 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 14394
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14394&action=edit
gdb.log on x86_64-linux

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

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

* [Bug testsuite/29468] GDB test gdb.base/ctf-constvars.exp fails.
  2022-08-10 20:30 [Bug gdb/29468] New: GDB test gdb.base/ctf-constvars.exp fails cel at us dot ibm.com
                   ` (4 preceding siblings ...)
  2022-10-12 15:55 ` vries at gcc dot gnu.org
@ 2022-10-12 15:56 ` vries at gcc dot gnu.org
  2022-10-12 16:06 ` cel at us dot ibm.com
  2022-10-12 16:09 ` vries at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-10-12 15:56 UTC (permalink / raw)
  To: gdb-prs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|FIXED                       |---

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
Ok, reopening then until we've got this figured out.

Thanks for verifying.

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

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

* [Bug testsuite/29468] GDB test gdb.base/ctf-constvars.exp fails.
  2022-08-10 20:30 [Bug gdb/29468] New: GDB test gdb.base/ctf-constvars.exp fails cel at us dot ibm.com
                   ` (5 preceding siblings ...)
  2022-10-12 15:56 ` vries at gcc dot gnu.org
@ 2022-10-12 16:06 ` cel at us dot ibm.com
  2022-10-12 16:09 ` vries at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cel at us dot ibm.com @ 2022-10-12 16:06 UTC (permalink / raw)
  To: gdb-prs

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

Carl E Love <cel at us dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #7 from Carl E Love <cel at us dot ibm.com> ---
OK, my bad.  I did the testing in the wrong directory.  Argh.  So, when I build
and test using the correct build directory on PowerPC I get

(gdb) run 
Starting program:
/home/carll/GDB/binutils-gdb-next-reverse-bkpt-over-sr/gdb/te\
stsuite/outputs/gdb.base/ctf-constvars/ctf-constvars 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, 0x0000000010000698 in main ()
(gdb) print vox
$1 = 66 'B'
(gdb) PASS: gdb.base/ctf-constvars.exp: print vox
ptype vox
type = volatile char
(gdb) PASS: gdb.base/ctf-constvars.exp: ptype vox
print victuals
$2 = 67 'C'
(gdb) PASS: gdb.base/ctf-constvars.exp: print victuals
ptype victuals
type = volatile unsigned char
(gdb) PASS: gdb.base/ctf-constvars.exp: ptype victuals
print vixen
$3 = 200
(gdb) PASS: gdb.base/ctf-constvars.exp: print vixen
ptype vixen
type = volatile short

,,,

type = const volatile unsigned char [2]
(gdb) PASS: gdb.base/ctf-constvars.exp: ptype vegetation
testcase
/home/carll/GDB/binutils-gdb-next-reverse-bkpt-over-sr/gdb/testsuite/g\
db.base/ctf-constvars.exp completed in 0 seconds

                === gdb Summary ===

# of expected passes            56
Executing on host: /home/carll/bin/gdb -nw -nx -iex "set height 0" -iex "set
wi\
dth 0" --version    (timeout = 300)

So, yes the patch does fix the error on PowerPC.  Sorry for the confusion.

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

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

* [Bug testsuite/29468] GDB test gdb.base/ctf-constvars.exp fails.
  2022-08-10 20:30 [Bug gdb/29468] New: GDB test gdb.base/ctf-constvars.exp fails cel at us dot ibm.com
                   ` (6 preceding siblings ...)
  2022-10-12 16:06 ` cel at us dot ibm.com
@ 2022-10-12 16:09 ` vries at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2022-10-12 16:09 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Carl E Love from comment #7)
> OK, my bad.  I did the testing in the wrong directory.  Argh. 

Eh, it happens :)

> So, yes the patch does fix the error on PowerPC.  Sorry for the confusion.

Wonderful, thanks again for verifying.

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

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10 20:30 [Bug gdb/29468] New: GDB test gdb.base/ctf-constvars.exp fails cel at us dot ibm.com
2022-09-20 15:43 ` [Bug gdb/29468] " vries at gcc dot gnu.org
2022-09-27 15:34 ` vries at gcc dot gnu.org
2022-10-12 15:18 ` [Bug testsuite/29468] " vries at gcc dot gnu.org
2022-10-12 15:39 ` cel at us dot ibm.com
2022-10-12 15:55 ` vries at gcc dot gnu.org
2022-10-12 15:56 ` vries at gcc dot gnu.org
2022-10-12 16:06 ` cel at us dot ibm.com
2022-10-12 16:09 ` 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).