public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>,
	Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH][gdb/ada] Handle artificial local symbols
Date: Sat, 18 Sep 2021 01:28:01 +0200	[thread overview]
Message-ID: <91f01f82-446e-9e80-692f-11cfefb7c4ee@suse.de> (raw)
In-Reply-To: <87zgsbng4x.fsf@tromey.com>

On 9/17/21 9:42 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Tom> Fix this instead by marking the symbol as artificial, and:
> Tom> - ignoring such symbols in ada_resolve_variable, which fixes the FAIL
> Tom> - ignoring such ada symbols in do_print_variable_and_value, which prevents
> Tom>   them from showing up in "info locals"
> 
> Tom> Note that a fix for the latter was submitted here (
> Tom> https://sourceware.org/pipermail/gdb-patches/2008-January/054994.html ), and
> Tom> this patch borrows from it.
> 
> Thanks for doing this.
> 
> Tom> +      /* Handle DW_AT_artificial.  */
> Tom> +      attr = dwarf2_attr (die, DW_AT_artificial, cu);
> Tom> +      if (attr != nullptr)
> Tom> +	sym->artificial = 1;
> 
> This should also check attr->as_boolean.
> Probably also use '= true', though
> 
>    sym->artificial = attr->as_boolean ()
> 
> would also be fine.
> 

Ack.

> Tom> +  if (language_def (sym->language ())->symbol_printing_suppressed (sym))
> Tom> +    return;
> 
> Seems fine though I also wonder if it would be better to just always
> suppress artificial variables here.
> 

There may be trouble with other languages though.  So for now I'm going
ahead with this approach.

> Tom> +  /* Whether this symbol is artificial.  */
> Tom> +
> Tom> +  unsigned int artificial : 1;
> 
> I think making this bool would be better.

Hmm, the struct is advertised as space-critical, and a 1-bit bitfield is
smaller than an 8-bit bool.  So I wonder why you prefer bool here.

Thanks,
- Tom

  reply	other threads:[~2021-09-17 23:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24 11:13 Tom de Vries
2021-09-14 12:59 ` [PING][PATCH][gdb/ada] " Tom de Vries
2021-09-17 19:42 ` [PATCH][gdb/ada] " Tom Tromey
2021-09-17 23:28   ` Tom de Vries [this message]
2021-09-18  1:15     ` 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=91f01f82-446e-9e80-692f-11cfefb7c4ee@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).