Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 11/20] Add reprocessing flag to struct attribute
Date: Mon, 30 Mar 2020 11:32:36 -0400	[thread overview]
Message-ID: <95abbf1c-cfa2-c031-d89e-d495dc0d4449@simark.ca> (raw)
In-Reply-To: <20200328192208.11324-12-tom@tromey.com>

On 2020-03-28 3:21 p.m., Tom Tromey wrote:
> diff --git a/gdb/dwarf2/attribute.c b/gdb/dwarf2/attribute.c
> index 72ec13c11f9..73c1ef9f792 100644
> --- a/gdb/dwarf2/attribute.c
> +++ b/gdb/dwarf2/attribute.c
> @@ -206,3 +206,17 @@ attribute::form_is_unsigned () const
>  	  || form == DW_FORM_ref8
>  	  || form == DW_FORM_ref_udata);
>  }
> +
> +/* See attribute.h.  */
> +
> +bool
> +attribute::form_is_reprocessed () const

The name is odd, the "form" isn't reprocessed.  What would you think of
"form_requires_processing"?  The "requires_reprocessing" field implicitly
means "attribute_requires_reprocessing".  But if we want to avoid confusion
between the two, the field could be renamed "reprocessing_done", and its
logic inverted.

> @@ -179,8 +193,22 @@ struct attribute
>      u.unsnd = unsnd;
>    }
>  
> +  /* Temporarily this attribute to an unsigned integer.  This is used

Missing a word here?

> +     only for those forms that require reprocessing.  */
> +  void set_unsigned_reprocess (ULONGEST unsnd)
> +  {
> +    gdb_assert (form_is_reprocessed ());
> +    u.unsnd = unsnd;
> +    requires_reprocessing = 1;
> +  }
> +
> +
> +  ENUM_BITFIELD(dwarf_attribute) name : 15;
> +
> +  /* If this requires reprocessing, is it in its final form, or is it
> +     still stored as an unsigned?  */
> +  unsigned int requires_reprocessing : 1;

It would be good to explain what we mean by "reprocessing", here would be a good
place.  It would be good to give the example of the DW_FORM_strx form, where we
could encounter this form before having seen the corresponding
DW_AT_str_offsets_base attribute.  So we first store the offset as an unsigned
integer in the attribute, then "reprocess" it later to fetch the actual string.

Simon



  reply	other threads:[~2020-03-30 15:32 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 19:21 [PATCH 00/20] Make DWARF attribute references safe Tom Tromey
2020-03-28 19:21 ` [PATCH 01/20] Add attribute::value_as_string method Tom Tromey
2020-03-28 19:21 ` [PATCH 02/20] Rename struct attribute accessors Tom Tromey
2020-03-30  8:58   ` Aktemur, Tankut Baris
2020-03-30 23:39     ` Tom Tromey
2020-03-30 14:45   ` Simon Marchi
2020-03-30 23:39     ` Tom Tromey
2020-03-28 19:21 ` [PATCH 03/20] Avoid using DW_* macros in dwarf2/attribute.c Tom Tromey
2020-03-28 19:21 ` [PATCH 04/20] Change some uses of DW_STRING to string method Tom Tromey
2020-03-30 14:56   ` Simon Marchi
2020-03-30 23:53     ` Tom Tromey
2020-03-28 19:21 ` [PATCH 05/20] Remove some uses of DW_STRING_IS_CANONICAL Tom Tromey
2020-03-30 15:02   ` Simon Marchi
2020-03-31  0:01     ` Tom Tromey
2020-03-28 19:21 ` [PATCH 06/20] Remove DW_STRING and DW_STRING_IS_CANONICAL Tom Tromey
2020-03-30 15:10   ` Simon Marchi
2020-03-31  0:23     ` Tom Tromey
2020-03-28 19:21 ` [PATCH 07/20] Remove DW_BLOCK Tom Tromey
2020-03-30 15:13   ` Simon Marchi
2020-03-28 19:21 ` [PATCH 08/20] Remove DW_SIGNATURE Tom Tromey
2020-03-28 19:21 ` [PATCH 09/20] Remove DW_SND Tom Tromey
2020-03-28 19:21 ` [PATCH 10/20] Use setter for attribute's unsigned value Tom Tromey
2020-03-28 19:21 ` [PATCH 11/20] Add reprocessing flag to struct attribute Tom Tromey
2020-03-30 15:32   ` Simon Marchi [this message]
2020-04-04 14:02     ` Tom Tromey
2020-03-28 19:22 ` [PATCH 12/20] Remove DW_ADDR Tom Tromey
2020-03-30 15:40   ` Simon Marchi
2020-04-04 14:05     ` Tom Tromey
2020-03-28 19:22 ` [PATCH 13/20] Change how reprocessing is done Tom Tromey
2020-03-30 15:46   ` Simon Marchi
2020-04-04 14:14     ` Tom Tromey
2020-03-28 19:22 ` [PATCH 14/20] Change how accessibility is handled in dwarf2/read.c Tom Tromey
2020-03-30 15:50   ` Simon Marchi
2020-03-28 19:22 ` [PATCH 15/20] Add attribute::get_unsigned method Tom Tromey
2020-03-30 15:57   ` Simon Marchi
2020-04-04 14:17     ` Tom Tromey
2020-03-28 19:22 ` [PATCH 16/20] Change is_valid_DW_AT_defaulted to a method on attribute Tom Tromey
2020-03-30 16:00   ` Simon Marchi
2020-04-04 14:23     ` Tom Tromey
2020-03-28 19:22 ` [PATCH 17/20] Change die_info methods to check the attribute's form Tom Tromey
2020-03-30 16:02   ` Simon Marchi
2020-03-30 19:04     ` Tom Tromey
2020-03-30 20:18       ` Simon Marchi
2020-03-30 20:26         ` Tom Tromey
2020-03-28 19:22 ` [PATCH 18/20] Add attribute::virtuality method Tom Tromey
2020-03-28 19:22 ` [PATCH 19/20] Add attribute::boolean method Tom Tromey
2020-03-28 19:22 ` [PATCH 20/20] Remove DW_UNSND 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=95abbf1c-cfa2-c031-d89e-d495dc0d4449@simark.ca \
    --to=simark@simark.ca \
    --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