From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14110 invoked by alias); 14 Feb 2011 21:07:21 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 14082 invoked by uid 9813); 14 Feb 2011 21:07:20 -0000 Date: Mon, 14 Feb 2011 21:07:00 -0000 Message-ID: <20110214210720.14067.qmail@sourceware.org> 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'. X-Git-Refname: refs/heads/archer-sergiodj-stap X-Git-Reftype: branch X-Git-Oldrev: f80fe6c9120b317fbff2bbeb70cc1d36bec5574b X-Git-Newrev: 49b7527b4e10aca253ebaa3159c6e4bbec1cf68e X-SW-Source: 2011-q1/txt/msg00119.txt.bz2 List-Id: 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 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.