This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Allow 64-bit enum values
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, gdb-patches at sourceware dot org
- Date: Wed, 18 Apr 2012 08:07:20 +0530
- Subject: Re: [PATCH] Allow 64-bit enum values
- References: <20120220132724.GB4753@spoyarek.pnq.redhat.com> <87d397syts.fsf@fleche.redhat.com> <20120229135148.GA32128@spoyarek.pnq.redhat.com> <20120301224428.GA30631@host2.jankratochvil.net> <20120305063542.GA30196@spoyarek.pnq.redhat.com> <20120305080512.GA12311@host2.jankratochvil.net> <20120321100630.GA14496@spoyarek.pnq.redhat.com> <20120327165950.GA1734@host2.jankratochvil.net> <20120328095037.254b22ed@spoyarek> <20120330161521.GA19069@host2.jankratochvil.net> <20120417135819.GA28916@host2.jankratochvil.net>
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