public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/32398] New: GDB 9+ can't examine any exported D symbols from another CU
@ 2024-11-28  0:12 liushuyu011 at gmail dot com
  2024-11-28  0:25 ` [Bug d/32398] " liushuyu011 at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: liushuyu011 at gmail dot com @ 2024-11-28  0:12 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 32398
           Summary: GDB 9+ can't examine any exported D symbols from
                    another CU
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: d
          Assignee: unassigned at sourceware dot org
          Reporter: liushuyu011 at gmail dot com
  Target Milestone: ---

Created attachment 15807
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15807&action=edit
Suggested patch for this issue

This seems to be a regression: GDB 9+ can't examine exported D symbols from
another D module when the imported symbol is imported inside a function
(subprogram).

For example, in file a.d, we have:

__gshared float b_Glob = 55.22;

In file b.d, we have:

void main()
{
  import a;
  b_Glob = 99.88; // GDB: p b_Glob
  return; //#break
}

When you build the program using:

gdc -ggdb3 -O0 a.d b.d -o a

And then run `gdb ./a` with the following command inputs, and you will see:

(gdb) b b.d:5
Breakpoint 1 at 0x252da: file /tmp/b.d, line 5.
(gdb) r
Starting program: /tmp/a
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Breakpoint 1, D main () at /tmp/b.d:5
5         return; //#break
(gdb) p b_Glob
No symbol "b_Glob" in current context.
(gdb)

With GDB 9, you will see the expected print-out (on amd64) of:

$1 = 99.8799973

-----------------

I suspect this is an issue with how GDB reads imported modules and investigated
this to be an accidental regression caused by a refactor to dwarf2/read.c.
Please see my suggested patch attached.

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

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

* [Bug d/32398] GDB 9+ can't examine any exported D symbols from another CU
  2024-11-28  0:12 [Bug d/32398] New: GDB 9+ can't examine any exported D symbols from another CU liushuyu011 at gmail dot com
@ 2024-11-28  0:25 ` liushuyu011 at gmail dot com
  2024-11-28  0:27 ` sam at gentoo dot org
  2024-12-10 16:15 ` tromey at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: liushuyu011 at gmail dot com @ 2024-11-28  0:25 UTC (permalink / raw)
  To: gdb-prs

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

liushuyu <liushuyu011 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |https://github.com/ldc-deve
                   |                            |lopers/ldc/issues/4389#issu
                   |                            |ecomment-2501786839

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

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

* [Bug d/32398] GDB 9+ can't examine any exported D symbols from another CU
  2024-11-28  0:12 [Bug d/32398] New: GDB 9+ can't examine any exported D symbols from another CU liushuyu011 at gmail dot com
  2024-11-28  0:25 ` [Bug d/32398] " liushuyu011 at gmail dot com
@ 2024-11-28  0:27 ` sam at gentoo dot org
  2024-12-10 16:15 ` tromey at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: sam at gentoo dot org @ 2024-11-28  0:27 UTC (permalink / raw)
  To: gdb-prs

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

Sam James <sam at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |a.horodniceanu at proton dot me,
                   |                            |ibuclaw at gdcproject dot org

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

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

* [Bug d/32398] GDB 9+ can't examine any exported D symbols from another CU
  2024-11-28  0:12 [Bug d/32398] New: GDB 9+ can't examine any exported D symbols from another CU liushuyu011 at gmail dot com
  2024-11-28  0:25 ` [Bug d/32398] " liushuyu011 at gmail dot com
  2024-11-28  0:27 ` sam at gentoo dot org
@ 2024-12-10 16:15 ` tromey at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: tromey at sourceware dot org @ 2024-12-10 16:15 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Hi.  Thanks for the patch.

gdb doesn't really review patches in bugzilla.  Instead they
should be sent to the mailing list.  See the contribution
instructions:

https://sourceware.org/gdb/wiki/ContributionChecklist

No one really seems to work on the D support right now.
This is probably why this failure snuck in.
A regression test would be a good addition to the patch,
to help avoid future problems.

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

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-28  0:12 [Bug d/32398] New: GDB 9+ can't examine any exported D symbols from another CU liushuyu011 at gmail dot com
2024-11-28  0:25 ` [Bug d/32398] " liushuyu011 at gmail dot com
2024-11-28  0:27 ` sam at gentoo dot org
2024-12-10 16:15 ` tromey at sourceware 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).