Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Pinski <andrew.pinski@caviumnetworks.com>
To: gdb-patches@sourceware.org, Tom Tromey <tromey@redhat.com>
Subject: [PATCH] Fix linespec.c vs padding on 32bit targets
Date: Fri, 09 Dec 2011 05:40:00 -0000	[thread overview]
Message-ID: <CA+=Sn1km=U-HzHLednrV0V5d5eZ9gjqFOgcpRmgaryVd_=TSyg@mail.gmail.com> (raw)

[-- 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.  */

             reply	other threads:[~2011-12-09  3:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09  5:40 Andrew Pinski [this message]
2011-12-09 15:54 ` Tom Tromey
2011-12-09 19:53   ` Andrew Pinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+=Sn1km=U-HzHLednrV0V5d5eZ9gjqFOgcpRmgaryVd_=TSyg@mail.gmail.com' \
    --to=andrew.pinski@caviumnetworks.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox