public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gdb] fix-dup-patch: - Fix unwinding of non-CFI (w/o debuginfo) PPC code by recent GCC (BZ
@ 2026-07-23 18:29 Jan Kratochvil
  0 siblings, 0 replies; only message in thread
From: Jan Kratochvil @ 2026-07-23 18:29 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/gdb
            Branch : fix-dup-patch
            Commit : 48f079c103de8106300ae1130682c87a174387e3
            Author : Jan Kratochvil <jkratoch@fedoraproject.org>
            Date   : 2007-01-12T21:07:47+00:00
            Stats  : +60/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/gdb/c/48f079c103de8106300ae1130682c87a174387e3?branch=fix-dup-patch

            Log:
            - Fix unwinding of non-CFI (w/o debuginfo) PPC code by recent GCC (BZ
    140532).
- Related: rhbz#140532

---
diff --git a/gdb-6.3-bz140532-ppcnoncfi-skip_prologue-PIC.patch b/gdb-6.3-bz140532-ppcnoncfi-skip_prologue-PIC.patch
new file mode 100644
index 0000000..602bc33
--- /dev/null
+++ b/gdb-6.3-bz140532-ppcnoncfi-skip_prologue-PIC.patch
@@ -0,0 +1,52 @@
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=140532
+
+
+2007-01-01  Jan Kratochvil <jan.kratochvil@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

diff --git a/gdb.spec b/gdb.spec
index 1b361fd..899795f 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -11,7 +11,7 @@ Name: gdb
 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 @@ Patch222: gdb-6.5-bz165025-DW_CFA_GNU_negative_offset_extended-test.patch
 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 @@ and printing their data.
 %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 @@ fi
 # don't include the files in include, they are part of binutils
 
 %changelog
+* Fri Jan 12 2007 Jan Kratochvil <jan.kratochvil@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@redhat.com> - 6.5-24
 - Backport readline history for input mode commands like `command' (BZ 215816).
 

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

only message in thread, other threads:[~2026-07-23 18:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-23 18:29 [rpms/gdb] fix-dup-patch: - Fix unwinding of non-CFI (w/o debuginfo) PPC code by recent GCC (BZ Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox