This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4 08/11] [PR gdb/14441] gdb: python: support rvalue references in the gdb module


One little nit. As I mentioned in #0, I would just reply to this
message, posting the correction.

On 03/21/2016 01:59 PM, Artemiy Volkov wrote:
> diff --git a/gdb/python/py-xmethods.c b/gdb/python/py-xmethods.c
> index d70cdd1..17fdfb2 100644
> --- a/gdb/python/py-xmethods.c
> +++ b/gdb/python/py-xmethods.c
> @@ -548,10 +548,10 @@ gdbpy_get_xmethod_result_type (const struct extension_language_defn *extlang,
>        if (!types_equal (obj_type, this_ptr))
>  	obj = value_cast (this_ptr, obj);
>      }
> -  else if (TYPE_CODE (obj_type) == TYPE_CODE_REF)
> +  else if (TYPE_IS_REFERENCE (obj_type))
>      {
> -      struct type *this_ref = lookup_lvalue_reference_type (this_type);
> -
> +      struct type *this_ref
> +        = lookup_reference_type (this_type, TYPE_CODE (obj_type));
>        if (!types_equal (obj_type, this_ref))
>  	obj = value_cast (this_ref, obj);
>      }
> @@ -634,10 +634,10 @@ gdbpy_invoke_xmethod (const struct extension_language_defn *extlang,
>        if (!types_equal (obj_type, this_ptr))
>  	obj = value_cast (this_ptr, obj);
>      }
> -  else if (TYPE_CODE (obj_type) == TYPE_CODE_REF)
> +  else if (TYPE_IS_REFERENCE (obj_type))
>      {
> -      struct type *this_ref = lookup_lvalue_reference_type (this_type);
> -
> +      struct type *this_ref
> +        = lookup_reference_type (this_type, TYPE_CODE (obj_type));
>        if (!types_equal (obj_type, this_ref))
>  	obj = value_cast (this_ref, obj);
>      }

Both of the above hunks need to keep the deleted whitespace. We like a
blank line between the (last) variable declaration and the first line of
code:

  else if (TYPE_IS_REFERENCE 9obj_type))
    {
      struct type *this_ref
        = lookup_reference_type (this_type, TYPE_CODE (obj_type));

      if (!types_equal (obj_type, this_ref))
        ...
    }

Keith



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]