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_typed_address', which is more correct than `extract_long_unsigned_integer'.
Date: Mon, 14 Feb 2011 21:07:00 -0000	[thread overview]
Message-ID: <20110214210720.14067.qmail@sourceware.org> (raw)

The branch, archer-sergiodj-stap has been updated
       via  49b7527b4e10aca253ebaa3159c6e4bbec1cf68e (commit)
      from  f80fe6c9120b317fbff2bbeb70cc1d36bec5574b (commit)

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

- Log -----------------------------------------------------------------
commit 49b7527b4e10aca253ebaa3159c6e4bbec1cf68e
Author: Sergio Durigan Junior <sergiodj@redhat.com>
Date:   Mon Feb 14 19:06:11 2011 -0200

    Using `extract_typed_address', which is more correct than
    `extract_long_unsigned_integer'.

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

Summary of changes:
 gdb/elfread.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

First 500 lines of diff:
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 5101ed3..b7ecac4 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -38,6 +38,8 @@
 #include "demangle.h"
 #include "psympriv.h"
 #include "stap-probe.h"
+#include "arch-utils.h"
+#include "gdbtypes.h"
 
 extern void _initialize_elfread (void);
 
@@ -1051,16 +1053,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 ());
+  struct gdbarch *gdbarch = get_current_arch ();
+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR base_ref;
-  ULONGEST tem;
 
   /* Provider and the name of the probe.  */
   ret->provider = (const char *) &el->data[3 * size];
@@ -1072,17 +1072,14 @@ handle_probe (struct sdt_note *el, struct stap_probe *ret, bfd *abfd,
   ++ret->name;
 
   /* Retrieving the probe's address.  */
-  extract_long_unsigned_integer ((const gdb_byte *) &el->data[0],
-				 size, byte_order, &tem);
-  ret->address = tem;
+  ret->address = extract_typed_address ((const gdb_byte *) &el->data[0],
+					builtin_type (gdbarch)->builtin_data_ptr);
   /* Link-time sh_addr of `.stapsdt.base' section.  */
-  extract_long_unsigned_integer ((const gdb_byte *) &el->data[size],
-				 size, byte_order, &tem);
-  base_ref = tem;
+  base_ref = extract_typed_address ((const gdb_byte *) &el->data[size],
+				    builtin_type (gdbarch)->builtin_data_ptr);
   /* Semaphore address.  */
-  extract_long_unsigned_integer ((const gdb_byte *) &el->data[2 * size],
-				 size, byte_order, &tem);
-  ret->sem_addr = tem;
+  ret->sem_addr = extract_typed_address ((const gdb_byte *) &el->data[2 * size],
+					 builtin_type (gdbarch)->builtin_data_ptr);
 
   ret->address += base - base_ref;
   if (ret->sem_addr)


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


                 reply	other threads:[~2011-02-14 21:07 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=20110214210720.14067.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).