public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/103436] New: gnatD debug info refers to original rather than generated file
@ 2021-11-26  8:44 vries at gcc dot gnu.org
  2022-01-07 17:27 ` [Bug ada/103436] " ebotcazou at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: vries at gcc dot gnu.org @ 2021-11-26  8:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103436
           Summary: gnatD debug info refers to original rather than
                    generated file
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Consider gdb test-case:
...
$ cat src/gdb/testsuite/gdb.ada/dgopt/x.adb 
--  Copyright 2019-2021 Free Software Foundation, Inc.
--
--  This program is free software; you can redistribute it and/or modify
--  it under the terms of the GNU General Public License as published by
--  the Free Software Foundation; either version 3 of the License, or
--  (at your option) any later version.
--
--  This program is distributed in the hope that it will be useful,
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--  GNU General Public License for more details.
--
--  You should have received a copy of the GNU General Public License
--  along with this program.  If not, see <http://www.gnu.org/licenses/>.

procedure X is
begin
   null;
end X;
...

Compiled with gnatmake:
...
$ gnatmake x.adb -gnatDG -f
-I/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.ada/dgopt -g  -lm  -o x
gcc -c -I./ -gnatDG
-I/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.ada/dgopt -g -lm -I-
/home/vries/gdb_versions/devel/binutils-gdb.git/gdb/testsuite/gdb.ada/dgopt/x.adb
gnatbind -I/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.ada/dgopt -x
x.ali
gnatlink x.ali -g -o x
...

We find a compile unit in .debug_info with:
...
    <7bf>   DW_AT_name        :
/home/vries/gdb_versions/devel/binutils-gdb.git/gdb/testsuite/gdb.ada/dgopt/x.adb
    <7c3>   DW_AT_comp_dir    : /home/vries/gdb_versions/devel
...
and a corresponding .debug_line contribution:
...
 The Directory Table is empty.

 The File Name Table (offset 0x1a9):
  Entry Dir     Time    Size    Name
  1     0       0       0       x.adb.dg
...

The documentation for gnatD (
https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gnat_ugn/Debugging-Control.html#index--gnatD-_0028gcc_0029
) states that:
...
The debugging information generated by the gcc -g switch will refer to the
generated xxx.dg file.
...

For the .debug_line part, that seems to be the case.  For the .debug_info part,
not so.

So AFAIU the option doesn't match the spec.

My understanding is that this should be fixed in the compiler.  If not, then
the documentation should be updated to clarify that it's related to line
information.

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

* [Bug ada/103436] gnatD debug info refers to original rather than generated file
  2021-11-26  8:44 [Bug ada/103436] New: gnatD debug info refers to original rather than generated file vries at gcc dot gnu.org
@ 2022-01-07 17:27 ` ebotcazou at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2022-01-07 17:27 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-01-07
                 CC|                            |ebotcazou at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
           Severity|normal                      |minor
     Ever confirmed|0                           |1
           Keywords|wrong-debug                 |

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
I guess that we could add a hack to gnat_post_options but I think that nobody
else really cares in the end, so feel free to suggest a documentation change.

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

end of thread, other threads:[~2022-01-07 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26  8:44 [Bug ada/103436] New: gnatD debug info refers to original rather than generated file vries at gcc dot gnu.org
2022-01-07 17:27 ` [Bug ada/103436] " ebotcazou 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).