This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING] [PATCH] [Python] Fix gdb.Value.dynamic_type for reference values
- From: Doug Evans <dje at google dot com>
- To: Siva Chandra <sivachandra at google dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Fri, 4 Apr 2014 12:12:12 -0700
- Subject: Re: [PING] [PATCH] [Python] Fix gdb.Value.dynamic_type for reference values
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gwhndLZEvGc_JgXGtDmYTs-T1P2rYFgc9ZJ1vK9-9NLvQ at mail dot gmail dot com>
On Wed, Apr 2, 2014 at 1:46 PM, Siva Chandra <sivachandra@google.com> wrote:
> Original post: https://sourceware.org/ml/gdb-patches/2014-03/msg00542.html
>
> gdb.Value.dynamic_type is supposed to work for reference and pointer
> values. However, the value object in the function 'valpy_get_dynamic_type'
> was being dereferenced using 'value_ind' irrespective of the value type
> being TYPE_CODE_PTR or TYPE_CODE_REF. This patch fixes that to use
> 'coerce_ref' for TYPE_CODE_REF values.
>
> ChangeLog:
> 2014-04-02 Siva Chandra Reddy <sivachandra@google.com>
>
> * python/py-value.c (valpy_get_dynamic_type): Use coerce_ref to
> dereference TYPE_CODE_REF values.
>
> testsuite/
> * gdb.python/py-value.c: Improve test case.
> * gdb.python/py-value.exp: Add new test.
LGTM.