public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/30276] New: [gdb/symtab] function name is _Dmain instead of "D main"
Date: Mon, 27 Mar 2023 10:46:45 +0000	[thread overview]
Message-ID: <bug-30276-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 30276
           Summary: [gdb/symtab] function name is _Dmain instead of "D
                    main"
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Consider the test-case src/gdb/testsuite/gdb.dlang/simple.d, compiled with the
dmd compiler and debug info:
...
$ dmd src/gdb/testsuite/gdb.dlang/simple.d -g
...

When doing start, we stop at "_Dmain ()":
...
$ gdb -q -batch simple -ex start 
Temporary breakpoint 1 at 0x43844e: file src/gdb/testsuite/gdb.dlang/simple.d,
line 17.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Temporary breakpoint 1, _Dmain () at src/gdb/testsuite/gdb.dlang/simple.d:17
17      }
...

In contrast, without debug info we have instead "D main ()":
...
$ gdb -q -batch simple -ex start 
Temporary breakpoint 1 at 0x438448
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Temporary breakpoint 1, 0x0000000000438448 in D main ()
...

It seems that gdb could know the name, given that the debug info contains:
...
 <1><10a>: Abbrev Number: 3 (DW_TAG_subprogram)
    <10b>   DW_AT_name        : D main
    <112>   DW_AT_MIPS_linkage_name: _Dmain
...

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

             reply	other threads:[~2023-03-27 10:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 10:46 vries at gcc dot gnu.org [this message]
2023-03-27 10:51 ` [Bug symtab/30276] " vries at gcc dot gnu.org
2023-03-27 11:29 ` vries at gcc dot gnu.org
2023-03-27 11:30 ` vries at gcc dot gnu.org
2023-03-27 11:37 ` vries at gcc dot gnu.org
2023-03-27 11:53 ` vries at gcc dot gnu.org
2023-03-27 15:05 ` tromey at sourceware dot org
2024-03-30 20:07 ` tromey at sourceware dot org
2024-03-30 20:09 ` tromey at sourceware dot org
2024-03-30 20:10 ` tromey at sourceware dot org
2024-04-02 20:06 ` cvs-commit at gcc dot gnu.org
2024-04-02 20:08 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30276-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).