rpms/gdb/devel gdb-6.3-bz140532-ppcnoncfi-skip_prologue-PIC.patch, NONE, 1.1 gdb.spec, 1.214, 1.215

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Jan 12 21:07:49 UTC 2007


Author: jkratoch

Update of /cvs/dist/rpms/gdb/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv15293

Modified Files:
	gdb.spec 
Added Files:
	gdb-6.3-bz140532-ppcnoncfi-skip_prologue-PIC.patch 
Log Message:
* Fri Jan 12 2007 Jan Kratochvil <jan.kratochvil at redhat.com> - 6.5-25
- Fix unwinding of non-CFI (w/o debuginfo) PPC code by recent GCC (BZ 140532).
- Related: rhbz#140532


gdb-6.3-bz140532-ppcnoncfi-skip_prologue-PIC.patch:
 rs6000-tdep.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+)

--- NEW FILE gdb-6.3-bz140532-ppcnoncfi-skip_prologue-PIC.patch ---
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=140532


2007-01-01  Jan Kratochvil <jan.kratochvil at redhat.com>

	* rs6000-tdep.c (skip_prologue): Handle bl->brlr used by PIC code.


diff -u -rup gdb-6.5-orig/gdb/rs6000-tdep.c gdb-6.5/gdb/rs6000-tdep.c
--- gdb-6.5-orig/gdb/rs6000-tdep.c	2006-12-30 15:53:52.000000000 -0500
+++ gdb-6.5/gdb/rs6000-tdep.c	2006-12-31 19:06:28.000000000 -0500
@@ -1182,6 +1182,40 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
       else if ((op & 0xfc000001) == 0x48000001)
 	{			/* bl foo, 
 				   to save fprs??? */
+	  CORE_ADDR bl_target;
+	  gdb_byte bl_target_op_buf[4];
+
+	  /* Safely skip:
+	     prologue: ...
+		       bl addr
+		       ...
+	     addr:     blrl
+	     as it could break the prologue by `prologue_sal.line'
+	     or `prologue_sal.line != this_sal.line' conditions below.  */
+	  /* Sign-extend it to the upper 6 bits.  */
+	  if (op & 0x02000000)
+	    bl_target = pc + -(long) (((~op) & 0x03fffffc) + 4);
+	  else
+	    bl_target = pc + (op & 0x03fffffc);
+	  if (target_read_memory (bl_target, bl_target_op_buf, 4) == 0)
+	    {
+	      unsigned long bl_target_op;
+
+	      bl_target_op = extract_signed_integer (bl_target_op_buf, 4);
+	      if (bl_target_op == 0x4e800021)	/* blrl  */
+		{
+		  /* If we did not yet retrieved LR into some GPR
+		     all our chances are lost.  On the other hand already
+		     stored LR is still kept intact in its GPR.  */
+		  if (lr_reg == -1)
+		    {
+		      /* Invalidate lr_reg, but don't set it to -1.
+			 That would mean that it had never been set.  */
+		      lr_reg = -2;
+		    }
+		  continue;
+		}
+	    }
 
 	  fdata->frameless = 0;
 	  /* Don't skip over the subroutine call if it is not within


Index: gdb.spec
===================================================================
RCS file: /cvs/dist/rpms/gdb/devel/gdb.spec,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -r1.214 -r1.215
--- gdb.spec	11 Jan 2007 21:28:57 -0000	1.214
+++ gdb.spec	12 Jan 2007 21:07:47 -0000	1.215
@@ -11,7 +11,7 @@
 Version: 6.5
 
 # The release always contains a leading reserved number, start it at 0.
-Release: 24%{?dist}
+Release: 25%{?dist}
 
 License: GPL
 Group: Development/Debuggers
@@ -322,6 +322,9 @@
 Patch224: gdb-6.5-bz109921-DW_AT_decl_file-fix.patch
 Patch225: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
 
+# Fix unwinding of non-CFI (w/o debuginfo) PPC code by recent GCC (BZ 140532).
+Patch226: gdb-6.3-bz140532-ppcnoncfi-skip_prologue-PIC.patch
+
 BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu gettext
 BuildRequires: flex bison sharutils
 
@@ -451,6 +454,7 @@
 %patch222 -p1
 %patch224 -p1
 %patch225 -p1
+%patch226 -p1
 
 # Change the version that gets printed at GDB startup, so it is RedHat
 # specific.
@@ -613,6 +617,9 @@
 # don't include the files in include, they are part of binutils
 
 %changelog
+* Fri Jan 12 2007 Jan Kratochvil <jan.kratochvil at redhat.com> - 6.5-25
+- Fix unwinding of non-CFI (w/o debuginfo) PPC code by recent GCC (BZ 140532).
+
 * Thu Jan 11 2007 Jan Kratochvil <jan.kratochvil at redhat.com> - 6.5-24
 - Backport readline history for input mode commands like `command' (BZ 215816).
 




More information about the fedora-cvs-commits mailing list