Re: [PATCH 06/20] Remove DW_STRING and DW_STRING_IS_CANONICAL

Simon Marchi
2020-03-30T15:10:15Z

On 2020-03-28 3:21 p.m., Tom Tromey wrote:
> + /* Initialize this attribute to hold a string value. */
> + void string_init (const char *str)
> + {
> + gdb_assert (form_is_string ());
> + u.str = str;
> + string_is_canonical = 0;
> + }
> +
> + /* Set the canonical string value for this attribute. */
> + void string_set (const char *str)
> + {
> + gdb_assert (form_is_string ());
> + u.str = str;
> + string_is_canonical = 1;
> + }

I don't find the "string_init" and "string_set" names very descriptive. When
reading them in their call sites, it's not really obvious to me what's the
difference. Perhaps "set_string_canonical" and "set_string_non_canonical"?

Simon