This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v4 08/11] [PR gdb/14441] gdb: python: support rvalue references in the gdb module
- From: Keith Seitz <keiths at redhat dot com>
- To: Artemiy Volkov <artemiyv at acm dot org>, gdb-patches at sourceware dot org
- Date: Thu, 31 Mar 2016 13:35:37 -0700
- Subject: Re: [PATCH v4 08/11] [PR gdb/14441] gdb: python: support rvalue references in the gdb module
- Authentication-results: sourceware.org; auth=none
- References: <1457147955-21871-1-git-send-email-artemiyv at acm dot org> <1458593958-25656-1-git-send-email-artemiyv at acm dot org> <1458593958-25656-9-git-send-email-artemiyv at acm dot org>
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