* [PATCH] Fix linespec.c vs padding on 32bit targets
@ 2011-12-09 5:40 Andrew Pinski
2011-12-09 15:54 ` Tom Tromey
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Pinski @ 2011-12-09 5:40 UTC (permalink / raw)
To: gdb-patches, Tom Tromey
[-- Attachment #1: Type: text/plain, Size: 428 bytes --]
Hi,
The problem here is there is padding in address_entry so
iterative_hash_object on the full object cannot be done as the padding
would be some junk. This causes lots of gdb failures on
mips64-linux-gnu.
OK? Tested on mips64-linux-gnu.
Thanks,
Andrew Pinski
PS I don't have write access for gdb.
gdb/ChangeLog:
* linespec.c (hash_address_entry): Use iterative_hash_object on each
field rather than the struct itself.
[-- Attachment #2: fixhash.diff.txt --]
[-- Type: text/plain, Size: 621 bytes --]
? .elfread.c.swp
Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.133
diff -u -p -r1.133 linespec.c
--- linespec.c 6 Dec 2011 19:57:47 -0000 1.133
+++ linespec.c 9 Dec 2011 03:49:07 -0000
@@ -253,8 +253,9 @@ static hashval_t
hash_address_entry (const void *p)
{
const struct address_entry *aep = p;
-
- return iterative_hash_object (*aep, 0);
+ hashval_t hash;
+ hash = iterative_hash_object (aep->pspace, 0);
+ return iterative_hash_object (aep->addr, hash);
}
/* An equality function for address_entry. */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix linespec.c vs padding on 32bit targets
2011-12-09 5:40 [PATCH] Fix linespec.c vs padding on 32bit targets Andrew Pinski
@ 2011-12-09 15:54 ` Tom Tromey
2011-12-09 19:53 ` Andrew Pinski
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2011-12-09 15:54 UTC (permalink / raw)
To: Andrew Pinski; +Cc: gdb-patches
>>>>> "Andrew" == Andrew Pinski <andrew.pinski@caviumnetworks.com> writes:
Andrew> The problem here is there is padding in address_entry so
Andrew> iterative_hash_object on the full object cannot be done as the padding
Andrew> would be some junk. This causes lots of gdb failures on
Andrew> mips64-linux-gnu.
Thanks Andrew.
Andrew> OK? Tested on mips64-linux-gnu.
One tiny nit, see below.
Andrew> PS I don't have write access for gdb.
If you have write access to binutils then you do.
If you still don't, let me know and I will commit it.
Andrew> + hashval_t hash;
Andrew> + hash = iterative_hash_object (aep->pspace, 0);
Andrew> + return iterative_hash_object (aep->addr, hash);
The gdb style puts a blank line between declarations and code.
Ok with that change.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix linespec.c vs padding on 32bit targets
2011-12-09 15:54 ` Tom Tromey
@ 2011-12-09 19:53 ` Andrew Pinski
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Pinski @ 2011-12-09 19:53 UTC (permalink / raw)
To: Tom Tromey; +Cc: Pinski, Andrew, gdb-patches
On Fri, 2011-12-09 at 07:40 -0800, Tom Tromey wrote:
> >>>>> "Andrew" == Andrew Pinski <andrew.pinski@caviumnetworks.com> writes:
>
> Andrew> The problem here is there is padding in address_entry so
> Andrew> iterative_hash_object on the full object cannot be done as the padding
> Andrew> would be some junk. This causes lots of gdb failures on
> Andrew> mips64-linux-gnu.
>
> Thanks Andrew.
>
> Andrew> OK? Tested on mips64-linux-gnu.
>
> One tiny nit, see below.
>
> Andrew> PS I don't have write access for gdb.
>
> If you have write access to binutils then you do.
> If you still don't, let me know and I will commit it.
>
> Andrew> + hashval_t hash;
> Andrew> + hash = iterative_hash_object (aep->pspace, 0);
> Andrew> + return iterative_hash_object (aep->addr, hash);
>
> The gdb style puts a blank line between declarations and code.
> Ok with that change.
Thanks I committed the patch.
Thanks,
Andrew Pinski
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-09 19:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-09 5:40 [PATCH] Fix linespec.c vs padding on 32bit targets Andrew Pinski
2011-12-09 15:54 ` Tom Tromey
2011-12-09 19:53 ` Andrew Pinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox