2017-12-10 22:00:49 +00:00
|
|
|
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
2017-12-04 19:24:00 +00:00
|
|
|
From: Fedora GDB patches <invalid@email.com>
|
|
|
|
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
|
|
|
Subject: gdb-archer-pie-addons.patch
|
|
|
|
|
2017-12-08 04:31:26 +00:00
|
|
|
;;=push+jan: May get obsoleted by Tom's unrelocated objfiles patch.
|
2017-12-04 19:24:00 +00:00
|
|
|
|
2017-12-08 04:31:26 +00:00
|
|
|
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
|
|
|
|
--- a/gdb/gdbtypes.h
|
|
|
|
+++ b/gdb/gdbtypes.h
|
2019-05-02 03:08:41 +00:00
|
|
|
@@ -511,6 +511,7 @@ enum field_loc_kind
|
2010-01-16 22:32:10 +00:00
|
|
|
{
|
2014-06-19 20:14:32 +00:00
|
|
|
FIELD_LOC_KIND_BITPOS, /**< bitpos */
|
|
|
|
FIELD_LOC_KIND_ENUMVAL, /**< enumval */
|
2010-01-16 22:32:10 +00:00
|
|
|
+ /* This address is unrelocated by the objfile's ANOFFSET. */
|
2014-06-19 20:14:32 +00:00
|
|
|
FIELD_LOC_KIND_PHYSADDR, /**< physaddr */
|
|
|
|
FIELD_LOC_KIND_PHYSNAME, /**< physname */
|
|
|
|
FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */
|
2019-05-02 03:08:41 +00:00
|
|
|
@@ -562,6 +563,7 @@ union field_location
|
2015-05-31 18:47:21 +00:00
|
|
|
field. Otherwise, physname is the mangled label of the
|
|
|
|
static field. */
|
2010-01-16 22:32:10 +00:00
|
|
|
|
2015-05-31 18:47:21 +00:00
|
|
|
+ /* This address is unrelocated by the objfile's ANOFFSET. */
|
|
|
|
CORE_ADDR physaddr;
|
|
|
|
const char *physname;
|
2012-01-03 15:00:12 +00:00
|
|
|
|
2019-06-02 04:02:45 +00:00
|
|
|
@@ -1451,6 +1453,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
|
2012-06-03 17:40:44 +00:00
|
|
|
#define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval)
|
|
|
|
#define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0)
|
2010-01-12 22:15:57 +00:00
|
|
|
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
|
|
|
|
+/* This address is unrelocated by the objfile's ANOFFSET. */
|
|
|
|
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
|
2012-01-03 15:00:12 +00:00
|
|
|
#define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
|
2010-01-12 22:15:57 +00:00
|
|
|
#define SET_FIELD_BITPOS(thisfld, bitpos) \
|
2019-06-02 04:02:45 +00:00
|
|
|
@@ -1462,6 +1465,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
|
2010-01-12 22:15:57 +00:00
|
|
|
#define SET_FIELD_PHYSNAME(thisfld, name) \
|
|
|
|
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
|
|
|
|
FIELD_STATIC_PHYSNAME (thisfld) = (name))
|
|
|
|
+/* This address is unrelocated by the objfile's ANOFFSET. */
|
|
|
|
#define SET_FIELD_PHYSADDR(thisfld, addr) \
|
|
|
|
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
|
|
|
|
FIELD_STATIC_PHYSADDR (thisfld) = (addr))
|
2019-06-02 04:02:45 +00:00
|
|
|
@@ -1478,6 +1482,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
|
2010-01-12 22:15:57 +00:00
|
|
|
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
|
2012-06-03 17:40:44 +00:00
|
|
|
#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n))
|
2010-01-12 22:15:57 +00:00
|
|
|
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
|
|
|
|
+/* This address is unrelocated by the objfile's ANOFFSET. */
|
|
|
|
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
|
2012-01-03 15:00:12 +00:00
|
|
|
#define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n))
|
2010-01-12 22:15:57 +00:00
|
|
|
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
|
2017-12-08 04:31:26 +00:00
|
|
|
diff --git a/gdb/value.c b/gdb/value.c
|
|
|
|
--- a/gdb/value.c
|
|
|
|
+++ b/gdb/value.c
|
2019-04-12 20:35:20 +00:00
|
|
|
@@ -2825,7 +2825,8 @@ value_static_field (struct type *type, int fieldno)
|
2010-01-12 22:15:57 +00:00
|
|
|
{
|
2010-07-21 21:30:20 +00:00
|
|
|
case FIELD_LOC_KIND_PHYSADDR:
|
|
|
|
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
|
|
|
|
- TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
|
|
|
|
+ TYPE_FIELD_STATIC_PHYSADDR (type, fieldno)
|
|
|
|
+ + (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
|
|
|
|
break;
|
|
|
|
case FIELD_LOC_KIND_PHYSNAME:
|
2010-01-12 22:15:57 +00:00
|
|
|
{
|