Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PING][PATCH][gdb/symtab] Support DW_AT_main_subprogram with -readnow.
Date: Fri, 17 May 2019 15:08:00 -0000	[thread overview]
Message-ID: <3a5ffc45-84f5-3dae-8c64-285192938140@suse.de> (raw)
In-Reply-To: <20190505102520.GA5031@delia>

On 05-05-19 12:25, Tom de Vries wrote:
> Hi,
> 
> DW_AT_main_subprogram is supported in normal mode in read_partial_die, but not
> in -readnow mode.
> 
> Fix this by adding support for DW_AT_main_subprogram in read_func_scope.
> 
> Tested on x86_64-linux with native and RFC target board readnow (
> https://sourceware.org/ml/gdb-patches/2019-05/msg00073.html ).
> 
> OK for trunk?
> 
> Thanks,
> - Tom
> 
> [gdb/symtab] Support DW_AT_main_subprogram with -readnow.
> 
> gdb/ChangeLog:
> 
> 2019-05-05  Tom de Vries  <tdevries@suse.de>
> 
> 	PR symtab/16264
> 	PR symtab/24517
> 	* dwarf2read.c (read_func_scope): Handle DW_AT_main_subprogram.
> 
> ---
>  gdb/dwarf2read.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
> index b5ea9e3cc0..3e611b0842 100644
> --- a/gdb/dwarf2read.c
> +++ b/gdb/dwarf2read.c
> @@ -13741,6 +13741,10 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
>    newobj->name = new_symbol (die, read_type_die (die, cu), cu,
>  			     (struct symbol *) templ_func);
>  
> +  if (dwarf2_flag_true_p (die, DW_AT_main_subprogram, cu))
> +    set_objfile_main_name (objfile, SYMBOL_LINKAGE_NAME (newobj->name),
> +			   cu->language);
> +
>    /* If there is a location expression for DW_AT_frame_base, record
>       it.  */
>    attr = dwarf2_attr (die, DW_AT_frame_base, cu);
> 


  parent reply	other threads:[~2019-05-17 15:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-05 10:25 [PATCH][gdb/symtab] " Tom de Vries
2019-05-05 11:42 ` [RFC] How to fix gdb.dwarf2/main-subprogram.exp with cc-with-gdb-index/cc-with-debug-names Tom de Vries
2019-05-10  7:57   ` Tom de Vries
2019-05-13 14:20     ` Tom de Vries
2019-05-17 15:08 ` Tom de Vries [this message]
2019-05-29 13:37 ` [PATCH][gdb/symtab] Support DW_AT_main_subprogram with -readnow Tom Tromey

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=3a5ffc45-84f5-3dae-8c64-285192938140@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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