public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/101598] New: [debug, ada] .loc generated for defs__struct1IP
@ 2021-07-23 12:35 vries at gcc dot gnu.org
  2021-07-23 12:42 ` [Bug debug/101598] " vries at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2021-07-23 12:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101598

            Bug ID: 101598
           Summary: [debug, ada] .loc generated for defs__struct1IP
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

I.

Consider test-case defs.adb/defs.ads from a gdb testcase (
https://sourceware.org/git/?p=binutils-gdb.git;a=tree;f=gdb/testsuite/gdb.ada/formatted_ref
).

When compiled with trunk, we have a .loc in defs__struct1IP:
...
$ ./install/bin/gcc defs.adb -c -save-temps -g
$ more defs.s
        .file   "defs.adb"
        .text
.Ltext0:
        .file 0 "/home/vries/gcc_versions/devel" "defs.adb"
        .align 2
        .globl  defs__struct1IP
        .type   defs__struct1IP, @function
defs__struct1IP:
.LFB2:
        .cfi_startproc
        .file 1 "defs.ads"
        .loc 1 18 9
        pushq   %rbp
...

According to PR 101575 comment 7, that's something that needs to be fixed.

II.

Concretely, the .loc being there means that when stepping through defs___elabs,
we'll step into defs__struct1IP:
...
$ gdb -q formatted_ref -ex "b defs___elabs" -ex run
Reading symbols from formatted_ref...
Breakpoint 1 at 0x402bfe: file defs.ads, line 25.
Starting program: formatted_ref 

Breakpoint 1, <defs___elabs> () at defs.ads:25
25         S1 : Struct1;
(gdb) s
0x0000000000402bcc in defs__struct1IP () at defs.ads:18
18         type Struct1 is limited record
(gdb) s
<defs___elabs> () at defs.ads:27
27      end Defs;
(gdb) 
...

OTOH, with gcc-11, we have no .loc:
...
$ gcc-11 defs.adb -c -save-temps -g -gdwarf-5
$ more defs.s
        .file   "defs.adb"
        .text
.Ltext0:
        .file 0 "/home/vries/gcc_versions/devel" "defs.adb"
        .align 2
        .globl  defs__struct1IP
        .type   defs__struct1IP, @function
defs__struct1IP:
.LFB2:
        .cfi_startproc
        pushq   %rbp
...
which means means we don't step into defs__struct1IP:
...
$ gdb -q formatted_ref -ex "b defs___elabs" -ex run
Reading symbols from formatted_ref...
Breakpoint 1 at 0x402d1a: file defs.ads, line 25.
Starting program: formatted_ref 

Breakpoint 1, <defs___elabs> () at defs.ads:25
25         S1 : Struct1;
(gdb) s
27      end Defs;
(gdb) 
...

III.

The difference is caused by commit e69ac020372 ("Add line debug info for
virtual thunks").

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

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

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-23 12:35 [Bug debug/101598] New: [debug, ada] .loc generated for defs__struct1IP vries at gcc dot gnu.org
2021-07-23 12:42 ` [Bug debug/101598] " vries at gcc dot gnu.org
2021-07-23 12:54 ` bernd.edlinger at hotmail dot de
2021-07-23 12:55 ` vries at gcc dot gnu.org
2021-07-23 13:05 ` vries at gcc dot gnu.org
2021-07-23 13:08 ` bernd.edlinger at hotmail dot de
2021-07-24  6:11 ` bernd.edlinger at hotmail dot de
2021-07-24 19:26 ` bernd.edlinger at hotmail dot de
2021-08-04 14:26 ` bernd.edlinger at hotmail dot de
2021-08-11  5:30 ` cvs-commit at gcc dot gnu.org
2021-08-11  7:20 ` edlinger at gcc dot gnu.org
2022-10-25 10:24 ` cvs-commit at gcc dot gnu.org
2022-10-25 10:25 ` cvs-commit 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).