public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: sergiodj@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  archer-sergiodj-stap: Using `extract_long_unsigned_integer' instead of casting.
Date: Mon, 14 Feb 2011 18:36:00 -0000	[thread overview]
Message-ID: <20110214183618.21588.qmail@sourceware.org> (raw)

The branch, archer-sergiodj-stap has been updated
       via  ab5ad0fa3b8e8ca06ef7974ae1a218a3b487b4d7 (commit)
      from  18c80cb69448f129b9b13b3b8288a437d260cdb0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit ab5ad0fa3b8e8ca06ef7974ae1a218a3b487b4d7
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Mon Feb 14 16:35:30 2011 -0200

    Using `extract_long_unsigned_integer' instead of casting.

-----------------------------------------------------------------------

Summary of changes:
 gdb/elfread.c |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

First 500 lines of diff:
diff --git a/gdb/elfread.c b/gdb/elfread.c
index c9efdda..101a1c0 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1051,11 +1051,14 @@ elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst)
 	       _("elf/stab section information missing for %s"), filename);
 }
 
+#include "arch-utils.h"
+
 static void
 handle_probe (struct sdt_note *el, struct stap_probe *ret, bfd *abfd,
 	      CORE_ADDR base)
 {
   int size = bfd_get_arch_size (abfd) / 8;
+  enum bfd_endian byte_order = gdbarch_byte_order (get_current_arch ());
   CORE_ADDR base_ref;
 
   /* Provider and the name of the probe.  */
@@ -1068,9 +1071,14 @@ handle_probe (struct sdt_note *el, struct stap_probe *ret, bfd *abfd,
   ++ret->name;
 
   /* Retrieving the probe's address.  */
-  ret->address = ((CORE_ADDR *) el->data)[0];
-  base_ref = ((CORE_ADDR *) el->data)[1];
-  ret->sem_addr = ((CORE_ADDR *) el->data)[2];
+  extract_long_unsigned_integer ((const gdb_byte *) &el->data[0],
+				 size, byte_order, &ret->address);
+  /* Link-time sh_addr of `.stapsdt.base' section.  */
+  extract_long_unsigned_integer ((const gdb_byte *) &el->data[size],
+				 size, byte_order, &base_ref);
+  /* Semaphore address.  */
+  extract_long_unsigned_integer ((const gdb_byte *) &el->data[2 * size],
+				 size, byte_order, &ret->sem_addr);
 
   ret->address += base - base_ref;
   if (ret->sem_addr)
@@ -1126,11 +1134,15 @@ elf_get_probes (struct objfile *objfile, int *num_probes)
     return NULL;
 
   /* Allocating space for probe info.  */
-  for (iter = elf_tdata (obfd)->sdt_note_head; iter; iter = iter->next, ++*num_probes);
+  for (iter = elf_tdata (obfd)->sdt_note_head;
+       iter;
+       iter = iter->next, ++*num_probes);
 
   ret = xmalloc (*num_probes * sizeof (struct stap_probe));
 
-  for (iter = elf_tdata (obfd)->sdt_note_head, i = 0; iter; iter = iter->next, i++)
+  for (iter = elf_tdata (obfd)->sdt_note_head, i = 0;
+       iter;
+       iter = iter->next, i++)
     handle_probe (iter, &ret[i], obfd, base);
 
   return ret;
@@ -1141,9 +1153,10 @@ static int
 elf_get_probe_argument_count (struct objfile *objfile,
 			      const struct stap_probe *probe)
 {
-  return 0;
+
 }
 #endif
+
 \f
 static const struct sym_probe_fns elf_probe_fns =
 {


hooks/post-receive
--
Repository for Project Archer.


                 reply	other threads:[~2011-02-14 18:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20110214183618.21588.qmail@sourceware.org \
    --to=sergiodj@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).