This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: simple typo with cache_ovly_table
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: Mike Stump <mikestump at comcast dot net>, <gdb-patches at sourceware dot org>
- Date: Wed, 21 Oct 2015 14:00:53 -0400
- Subject: Re: simple typo with cache_ovly_table
- Authentication-results: sourceware.org; auth=none
- References: <B2B5BD3D-8DF9-46EF-B3BF-4C2147528948 at comcast dot net>
On 15-10-21 01:51 PM, Mike Stump wrote:
> So our port causes a warning on failure of the types in question to be the same. This fixes it. Our CORE_ADDR is 64-bits, our ints are 32-bits.
>
> Could someone shepherd it in?
>
>
> diff --git a/gdb/symfile.c b/gdb/symfile.c
> index f03fca7..e63a1c5 100644
> --- a/gdb/symfile.c
> +++ b/gdb/symfile.c
> @@ -3613,7 +3613,7 @@ simple_read_overlay_table (void)
> cache_novlys = read_memory_integer (BMSYMBOL_VALUE_ADDRESS (novlys_msym),
> 4, byte_order);
> cache_ovly_table
> - = (unsigned int (*)[4]) xmalloc (cache_novlys * sizeof (*cache_ovly_table));
> + = (CORE_ADDR (*)[4]) xmalloc (cache_novlys * sizeof (*cache_ovly_table));
> cache_ovly_table_base = BMSYMBOL_VALUE_ADDRESS (ovly_table_msym);
> read_target_long_array (cache_ovly_table_base,
> (CORE_ADDR *) cache_ovly_table,
>
Hi Mike,
cache_ovly_table seems to be a
unsigned (*cache_ovly_table)[4]
so why does it make sense to cast it to a
CORE_ADDR (*)[4]
?
Simon