[gdb/f16] Fix `corrupt probe' complaint when reading SystemTap probes.

sergiosdj sergiosdj at fedoraproject.org
Thu Mar 1 19:23:41 UTC 2012


commit b3beac1a00dbdcef6f7d3184169b1bff69d839ac
Author: Sergio Durigan Junior <sergiodj at redhat.com>
Date:   Thu Mar 1 16:22:48 2012 -0300

    Fix `corrupt probe' complaint when reading SystemTap probes.

 gdb-stap-corrupt-probes-fix.patch |   50 +++++++++++++++++++++++++++++++++++++
 gdb.spec                          |    8 +++++-
 2 files changed, 57 insertions(+), 1 deletions(-)
---
diff --git a/gdb-stap-corrupt-probes-fix.patch b/gdb-stap-corrupt-probes-fix.patch
new file mode 100644
index 0000000..8494186
--- /dev/null
+++ b/gdb-stap-corrupt-probes-fix.patch
@@ -0,0 +1,50 @@
+Index: gdb-7.3.50.20110722/gdb/elfread.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/elfread.c	2012-02-29 15:26:27.445214760 -0300
++++ gdb-7.3.50.20110722/gdb/elfread.c	2012-02-29 15:27:46.556248946 -0300
+@@ -2612,30 +2612,31 @@
+   bfd *abfd = objfile->obfd;
+   int size = bfd_get_arch_size (abfd) / 8;
+   struct gdbarch *gdbarch = get_objfile_arch (objfile);
++  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+   struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
+   CORE_ADDR base_ref;
+ 
+   /* Provider and the name of the probe.  */
+-  ret->provider = (const char *) &el->data[3 * size];
++  ret->provider = &el->data[3 * size];
+   ret->name = memchr (ret->provider, '\0',
+-		      (unsigned long *) el->data
+-		      + el->size - (unsigned long *) ret->provider);
++		      (char *) el->data + el->size - ret->provider);
+   /* Making sure there is a name.  */
+   if (!ret->name)
+-    complaint (&symfile_complaints, _("corrupt probe when reading `%s'"),
+-	       objfile->name);
++    {
++      complaint (&symfile_complaints, _("corrupt probe when reading `%s'"),
++		 objfile->name);
++      ret->provider = NULL;
++      ret->name = NULL;
++    }
+   else
+     ++ret->name;
+ 
+   /* Retrieving the probe's address.  */
+-  ret->address = extract_typed_address ((const gdb_byte *) &el->data[0],
+-					ptr_type);
++  ret->address = extract_typed_address (&el->data[0], ptr_type);
+   /* Link-time sh_addr of `.stapsdt.base' section.  */
+-  base_ref = extract_typed_address ((const gdb_byte *) &el->data[size],
+-				    ptr_type);
++  base_ref = extract_typed_address (&el->data[size], ptr_type);
+   /* Semaphore address.  */
+-  ret->sem_addr = extract_typed_address ((const gdb_byte *) &el->data[2 * size],
+-					 ptr_type);
++  ret->sem_addr = extract_typed_address (&el->data[2 * size], ptr_type);
+ 
+   ret->address += (ANOFFSET (objfile->section_offsets,
+ 			     SECT_OFF_TEXT (objfile))
+@@ -2650,15 +2651,19 @@
+   if (ret->name)
+     {
diff --git a/gdb.spec b/gdb.spec
index 76f33dc..07c997f 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -27,7 +27,7 @@ Version: 7.3.50.20110722
 
 # The release always contains a leading reserved number, start it at 1.
 # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 11%{?_with_upstream:.upstream}%{?dist}
+Release: 12%{?_with_upstream:.upstream}%{?dist}
 
 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain
 Group: Development/Debuggers
@@ -556,6 +556,9 @@ Patch632: gdb-optimized-out-internal-error.patch
 # Hack for proper PIE run of the testsuite.
 Patch634: gdb-runtest-pie-override.patch
 
+# Fix `corrupt probe' warnings for SystemTap probes.
+Patch647: gdb-stap-corrupt-probes-fix.patch
+
 BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa}
 # --without-system-readline
 # Requires: readline%{?_isa}
@@ -1252,6 +1255,9 @@ fi
 %{_infodir}/gdb.info*
 
 %changelog
+* Wed Mar 1 2012 Sergio Durigan Junior <sergiodj at redhat.com> - 7.3.50.20110722-12.fc16
+- Fix `corrupt probe' complaint when reading SystemTap probes.
+
 * Tue Nov 29 2011 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.3.50.20110722-11.fc16
 - No longer build bundled libstdc++ pretty printers on RHELs >= 7.
 


More information about the scm-commits mailing list