Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/symtab] Factor out new_symbol_file_line
Date: Thu, 23 Apr 2026 15:01:10 +0200	[thread overview]
Message-ID: <5ab6406d-b9f6-4866-8be1-a2f98b3c848f@suse.de> (raw)
In-Reply-To: <87jytzq6p7.fsf@tromey.com>

On 4/22/26 6:51 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> I was looking at a patch [1] modifying the DW_AT_decl_file / DW_AT_call_file
> Tom> handling of new_symbol, and noticed that:
> Tom> - the code is fairly nested, and
> Tom> - the patch adds another nesting layer.
> 
> Tom> Factor out function new_symbol_file_line out of new_symbol, handling both the
> Tom> DW_AT_decl_file / DW_AT_call_file and DW_AT_call_line / DW_AT_decl_line
> Tom> attributes.
> 
> Thanks for doing this.
> 
> I think new_symbol really needs to be split up, the way it is now is
> pretty bad, and your patch is a nice step in that direction.
>

Hi Tom,

Thanks for the review, pushed with the nit pointed out below fixed.

I don't know whether this is what you had in mind, but I've attempted a 
split up here ( 
https://sourceware.org/pipermail/gdb-patches/2026-April/226731.html ).

Thanks,
- Tom


> Tom> Having factored out the code, simplify it using return, and modernize it using
> Tom> bool and nullptr.
> 
> Tom> +  struct attribute *attr = nullptr;
> Tom> +
> Tom> +  bool inlined_func = (die->tag == DW_TAG_inlined_subroutine);
> Tom> +
> Tom> +  /* Handle DW_AT_call_line / DW_AT_decl_line.  */
> Tom> +  attr = dwarf2_attr (die,
> Tom> +		      inlined_func ? DW_AT_call_line : DW_AT_decl_line,
> Tom> +		      cu);
> 
> This line could be combined with the declaration and then the
> initialization removed like
> 
> attribute *attr = dwarf2_attr (...)
> 
> Approved-By: Tom Tromey <tom@tromey.com>
> 
> Tom


      reply	other threads:[~2026-04-23 13:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 16:03 Tom de Vries
2026-04-22 16:51 ` Tom Tromey
2026-04-23 13:01   ` Tom de Vries [this message]

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=5ab6406d-b9f6-4866-8be1-a2f98b3c848f@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