public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Aaron Merey <amerey@redhat.com>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] [gdb/symtab] Add name_of_main and language_of_main to the DWARF index
Date: Mon, 23 Oct 2023 12:26:17 -0400	[thread overview]
Message-ID: <CAJDtP-RFb3-V7mLCQbuz_Hr4KEniVnZY_tvSRrsJQF3u2LZcBQ@mail.gmail.com> (raw)
In-Reply-To: <3f08d572-0043-4d43-9ab8-b4f48865b6ab@suse.de>

Hi Tom,

I tried to generate a v9 .gdb_index for a hello world C program and
for my local gdb build.  In both cases the name and language of the main
function are missing.  I looked into this and it seems that main
information is set in the index only when DW_AT_main_subprogram
is found or DW_AT_calling_convention == DW_CC_program.

From gcc/dwarf2out.cc:add_calling_convention_attribute it looks like
DW_AT_main_subprogram is only set for Fortran programs.  And as far as
I can tell DW_AT_calling_convention is not set for C/C++ programs.

Am I missing something or is the range of cases where a v9 index actually
contains the name and laguage of main quite limited?  When writing an index
maybe gdb should try to infer the main name and language from the current
progspace if this information isn't available in the debuginfo.

Aaron


  reply	other threads:[~2023-10-23 16:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 18:31 [PATCH 0/2] " Tom de Vries
2023-10-06 18:31 ` [PATCH 1/2] [gdb/symtab] " Tom de Vries
2023-10-10 19:19   ` Tom Tromey
2023-10-10 19:22     ` Tom Tromey
2023-10-11 15:37     ` Tom de Vries
2023-10-23 16:26       ` Aaron Merey [this message]
2023-10-24  7:43         ` Tom de Vries
2023-10-24  8:04           ` Tom de Vries
2023-10-24  8:20           ` Tom de Vries
2023-10-24 22:04           ` Aaron Merey
2023-10-06 18:31 ` [PATCH 2/2] [readelf] Handle .gdb_index section version 9 Tom de Vries
2023-10-06 18:33 ` [PATCH 0/2] Add name_of_main and language_of_main to the DWARF index Tom de Vries

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=CAJDtP-RFb3-V7mLCQbuz_Hr4KEniVnZY_tvSRrsJQF3u2LZcBQ@mail.gmail.com \
    --to=amerey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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).