public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-sergiodj-stap: Using `extract_long_unsigned_integer' instead of casting.
@ 2011-02-14 18:36 sergiodj
  0 siblings, 0 replies; only message in thread
From: sergiodj @ 2011-02-14 18:36 UTC (permalink / raw)
  To: archer-commits

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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-14 18:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-14 18:36 [SCM] archer-sergiodj-stap: Using `extract_long_unsigned_integer' instead of casting sergiodj

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).