Backport "fix logic of find_comp_unit and set_comp_unit"
This commit is contained in:
parent
ff1d651389
commit
dfc42b6533
@ -459,3 +459,7 @@ Patch110: gdb-rhbz2012819-ibmz-update-5of5.patch
|
|||||||
# (Carl Love, RHBZ 1870017)
|
# (Carl Love, RHBZ 1870017)
|
||||||
Patch111: gdb-rhbz1870017-p10-plt-prologue-skipping.patch
|
Patch111: gdb-rhbz1870017-p10-plt-prologue-skipping.patch
|
||||||
|
|
||||||
|
# Backport "fix logic of find_comp_unit and set_comp_unit"
|
||||||
|
# (Simon Marchi, RHBZ 2086761)
|
||||||
|
Patch112: gdb-rhbz2086761-unknown-cfa-rule.patch
|
||||||
|
|
||||||
|
@ -109,3 +109,4 @@
|
|||||||
%patch109 -p1
|
%patch109 -p1
|
||||||
%patch110 -p1
|
%patch110 -p1
|
||||||
%patch111 -p1
|
%patch111 -p1
|
||||||
|
%patch112 -p1
|
||||||
|
@ -109,3 +109,4 @@ gdb-rhbz2012819-ibmz-update-3of5.patch
|
|||||||
gdb-rhbz2012819-ibmz-update-4of5.patch
|
gdb-rhbz2012819-ibmz-update-4of5.patch
|
||||||
gdb-rhbz2012819-ibmz-update-5of5.patch
|
gdb-rhbz2012819-ibmz-update-5of5.patch
|
||||||
gdb-rhbz1870017-p10-plt-prologue-skipping.patch
|
gdb-rhbz1870017-p10-plt-prologue-skipping.patch
|
||||||
|
gdb-rhbz2086761-unknown-cfa-rule.patch
|
||||||
|
54
gdb-rhbz2086761-unknown-cfa-rule.patch
Normal file
54
gdb-rhbz2086761-unknown-cfa-rule.patch
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
||||||
|
From: Keith Seitz <keiths@redhat.com>
|
||||||
|
Date: Tue, 24 May 2022 07:39:17 -0700
|
||||||
|
Subject: gdb-rhbz2086761-unknown-cfa-rule.patch
|
||||||
|
|
||||||
|
;; Backport "fix logic of find_comp_unit and set_comp_unit"
|
||||||
|
;; (Simon Marchi, RHBZ 2086761)
|
||||||
|
|
||||||
|
The logic in find_comp_unit and set_comp_unit is reversed. When the BFD
|
||||||
|
requires relocation, we want to put the comp_unit structure in the
|
||||||
|
map where the comp_unit objects are not shared, that is the one indexed
|
||||||
|
by objfile. If the BFD does not require relocation, then, we can share
|
||||||
|
a single comp_unit structure for all users of that BFD, so we want to
|
||||||
|
put it in the BFD-indexed map. The comments on top of
|
||||||
|
dwarf2_frame_bfd_data and dwarf2_frame_objfile_data make that clear.
|
||||||
|
|
||||||
|
Fix it by swapping the two in find_comp_unit and set_comp_unit.
|
||||||
|
|
||||||
|
I don't have a test for this, because I don't see how to write one in a
|
||||||
|
reasonable amount of time.
|
||||||
|
|
||||||
|
gdb/ChangeLog:
|
||||||
|
|
||||||
|
PR gdb/26876
|
||||||
|
* dwarf2/frame.c (find_comp_unit, set_comp_unit): Reverse use of
|
||||||
|
dwarf2_frame_bfd_data and dwarf2_frame_objfile_data.
|
||||||
|
|
||||||
|
diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c
|
||||||
|
--- a/gdb/dwarf2/frame.c
|
||||||
|
+++ b/gdb/dwarf2/frame.c
|
||||||
|
@@ -1640,8 +1640,9 @@ find_comp_unit (struct objfile *objfile)
|
||||||
|
{
|
||||||
|
bfd *abfd = objfile->obfd;
|
||||||
|
if (gdb_bfd_requires_relocations (abfd))
|
||||||
|
- return dwarf2_frame_bfd_data.get (abfd);
|
||||||
|
- return dwarf2_frame_objfile_data.get (objfile);
|
||||||
|
+ return dwarf2_frame_objfile_data.get (objfile);
|
||||||
|
+
|
||||||
|
+ return dwarf2_frame_bfd_data.get (abfd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Store the comp_unit on OBJFILE, or the corresponding BFD, as
|
||||||
|
@@ -1652,8 +1653,9 @@ set_comp_unit (struct objfile *objfile, struct comp_unit *unit)
|
||||||
|
{
|
||||||
|
bfd *abfd = objfile->obfd;
|
||||||
|
if (gdb_bfd_requires_relocations (abfd))
|
||||||
|
- return dwarf2_frame_bfd_data.set (abfd, unit);
|
||||||
|
- return dwarf2_frame_objfile_data.set (objfile, unit);
|
||||||
|
+ return dwarf2_frame_objfile_data.set (objfile, unit);
|
||||||
|
+
|
||||||
|
+ return dwarf2_frame_bfd_data.set (abfd, unit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Find the FDE for *PC. Return a pointer to the FDE, and store the
|
6
gdb.spec
6
gdb.spec
@ -1158,7 +1158,11 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Apr 11 2022 Bruno Larsen <blarsen@redhat.com> - 10.2-10.el9
|
* Tue May 24 2022 Keith Seitz <keiths@redhat.com> - 10.2-10.el9
|
||||||
|
- Backport "fix logic of find_comp_unit and set_comp_unit"
|
||||||
|
(Simon Marchi, RHBZ 2086761)
|
||||||
|
|
||||||
|
* Mon Apr 11 2022 Bruno Larsen <blarsen@redhat.com>
|
||||||
- Backport Add Power 10 PLT instruction patterns
|
- Backport Add Power 10 PLT instruction patterns
|
||||||
(Carl Love, RHBZ 1870017)
|
(Carl Love, RHBZ 1870017)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user