Re: [PATCH] Allow 64-bit enum values

Siddhesh Poyarekar
2012-04-18T02:37:09Z

On Tue, 17 Apr 2012 15:58:19 +0200, Jan wrote:
> According to Tom it should the review should not depend on C++ so:
>
> I made there these changes, particularly to really test 64-bit enums:
>
> ### a/gdb/gdbtypes.c
> - TYPE_FIELD_ENUMVAL (type, i));
> + TYPE_FIELD_ENUMVAL (type, i));
> ### a/gdb/python/py-type.c
> - if (TYPE_CODE(type) == TYPE_CODE_ENUM)
> + if (TYPE_CODE (type) == TYPE_CODE_ENUM)
> - arg = PyLong_FromLong (TYPE_FIELD_ENUMVAL (type, field));
> + arg = gdb_py_long_from_longest (TYPE_FIELD_ENUMVAL (type,
> field)); ### a/gdb/testsuite/gdb.base/enumval.c
> -enum e { I, J = 0xffffffffU } e = J;
> +enum e { I, J = 0xffffffffU, K = 0xf000000000000000ULL } e = J, f =
> K; ### a/gdb/testsuite/gdb.base/enumval.exp
> +gdb_test "print f" "= K"
> +gdb_test "print K" "= K"
>
> The patch needs small rebase on HEAD due to other changes and due to:
> [commit] Do not rely on FIELD_LOC_KIND_BITPOS being zero
> http://sourceware.org/ml/gdb-patches/2012-04/msg00460.html
>
> and it should be checked in along with:
> [patch!] Support 64-bit constants/enums on 32-bit host [Re:
> [PATCH] Allow 64-bit enum values]
> http://sourceware.org/ml/gdb-patches/2012-04/msg00463.html
>
> OK to check it in with these changes.
>

Thanks, I will resubmit the patch with these changes and the rebase,
hopefully by today or latest by tomorrow.

--
Siddhesh