Backport DWARF-5 and breakpoint fixes from upstream stable branch 8.0.
This commit is contained in:
parent
4f1de05c3f
commit
d4a557a0ab
@ -548,3 +548,323 @@ Date: Wed Aug 9 05:01:55 2017 -0700
|
||||
|| attr->form == DW_FORM_GNU_strp_alt)
|
||||
str = DW_STRING (attr);
|
||||
else
|
||||
|
||||
|
||||
|
||||
commit b3e687f4c5e2bd847ea0608fd8960820f3efbda3
|
||||
Author: Maciej W. Rozycki <macro@imgtec.com>
|
||||
Date: Fri Aug 11 10:40:06 2017 +0100
|
||||
|
||||
PR breakpoints/21886: mem-break: Fix breakpoint insertion location
|
||||
|
||||
Fix a commit cd6c3b4ffc4e ("New gdbarch methods breakpoint_kind_from_pc
|
||||
and sw_breakpoint_from_kind") regression and restore the use of
|
||||
`->placed_address' rather than `->reqstd_address' as the location for a
|
||||
memory breakpoint to be inserted at. Previously
|
||||
`gdbarch_breakpoint_from_pc' was used that made that adjustment in
|
||||
`default_memory_insert_breakpoint' from the preinitialized value,
|
||||
however with the said commit that call is gone, so the passed
|
||||
`->placed_address' has to be used for the initialization.
|
||||
|
||||
The regression manifests itself as the inability to debug any MIPS/Linux
|
||||
compressed ISA dynamic executable as GDB corrupts the dynamic loader
|
||||
with one of its implicit breakpoints, causing the program to crash, as
|
||||
seen for example with the `mips-linux-gnu' target, o32 ABI, MIPS16 code,
|
||||
and the gdb.base/advance.exp test case:
|
||||
|
||||
(gdb) continue
|
||||
Continuing.
|
||||
|
||||
Program received signal SIGBUS, Bus error.
|
||||
_dl_debug_initialize (ldbase=0, ns=0) at dl-debug.c:51
|
||||
51 r = &_r_debug;
|
||||
(gdb) FAIL: gdb.base/advance.exp: Can't run to main
|
||||
|
||||
gdb/
|
||||
PR breakpoints/21886
|
||||
* mem-break.c (default_memory_insert_breakpoint): Use
|
||||
`->placed_address' rather than `->reqstd_address' for the
|
||||
breakpoint location.
|
||||
|
||||
(cherry picked from commit ba7b109b296feac8cf8cab74db5f824dfa631610)
|
||||
|
||||
### a/gdb/ChangeLog
|
||||
### b/gdb/ChangeLog
|
||||
## -1,3 +1,10 @@
|
||||
+2017-08-11 Maciej W. Rozycki <macro@imgtec.com>
|
||||
+
|
||||
+ PR breakpoints/21886
|
||||
+ * mem-break.c (default_memory_insert_breakpoint): Use
|
||||
+ `->placed_address' rather than `->reqstd_address' for the
|
||||
+ breakpoint location.
|
||||
+
|
||||
2017-07-25 Yao Qi <yao.qi@linaro.org>
|
||||
|
||||
PR gdb/21555
|
||||
--- a/gdb/mem-break.c
|
||||
+++ b/gdb/mem-break.c
|
||||
@@ -37,7 +37,7 @@ int
|
||||
default_memory_insert_breakpoint (struct gdbarch *gdbarch,
|
||||
struct bp_target_info *bp_tgt)
|
||||
{
|
||||
- CORE_ADDR addr = bp_tgt->reqstd_address;
|
||||
+ CORE_ADDR addr = bp_tgt->placed_address;
|
||||
const unsigned char *bp;
|
||||
gdb_byte *readbuf;
|
||||
int bplen;
|
||||
|
||||
|
||||
|
||||
commit 06f84c95a2d88d03c1c231bfd436ac9d225d6615
|
||||
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Thu Aug 24 10:26:52 2017 +0200
|
||||
|
||||
DWARF-5: Fix -fdebug-types-section
|
||||
|
||||
GDB was now accessing as signatured_type memory allocated only by size of
|
||||
dwarf2_per_cu_data.
|
||||
|
||||
gdb/ChangeLog
|
||||
2017-08-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* dwarf2read.c (build_type_psymtabs_reader): New prototype.
|
||||
(process_psymtab_comp_unit): Accept IS_DEBUG_TYPES.
|
||||
(read_comp_units_from_section): New parameter abbrev_section, use
|
||||
read_and_check_comp_unit_head, allocate signatured_type if needed.
|
||||
(create_all_comp_units): Update read_comp_units_from_section caller.
|
||||
|
||||
### a/gdb/ChangeLog
|
||||
### b/gdb/ChangeLog
|
||||
## -1,3 +1,11 @@
|
||||
+2017-08-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
+
|
||||
+ * dwarf2read.c (build_type_psymtabs_reader): New prototype.
|
||||
+ (process_psymtab_comp_unit): Accept IS_DEBUG_TYPES.
|
||||
+ (read_comp_units_from_section): New parameter abbrev_section, use
|
||||
+ read_and_check_comp_unit_head, allocate signatured_type if needed.
|
||||
+ (create_all_comp_units): Update read_comp_units_from_section caller.
|
||||
+
|
||||
2017-08-11 Maciej W. Rozycki <macro@imgtec.com>
|
||||
|
||||
PR breakpoints/21886
|
||||
--- a/gdb/dwarf2read.c
|
||||
+++ b/gdb/dwarf2read.c
|
||||
@@ -1510,6 +1510,11 @@ static void dwarf2_find_base_address (struct die_info *die,
|
||||
static struct partial_symtab *create_partial_symtab
|
||||
(struct dwarf2_per_cu_data *per_cu, const char *name);
|
||||
|
||||
+static void build_type_psymtabs_reader (const struct die_reader_specs *reader,
|
||||
+ const gdb_byte *info_ptr,
|
||||
+ struct die_info *type_unit_die,
|
||||
+ int has_children, void *data);
|
||||
+
|
||||
static void dwarf2_build_psymtabs_hard (struct objfile *);
|
||||
|
||||
static void scan_partial_symbols (struct partial_die_info *,
|
||||
@@ -6247,8 +6252,6 @@ process_psymtab_comp_unit (struct dwarf2_per_cu_data *this_cu,
|
||||
int want_partial_unit,
|
||||
enum language pretend_language)
|
||||
{
|
||||
- struct process_psymtab_comp_unit_data info;
|
||||
-
|
||||
/* If this compilation unit was already read in, free the
|
||||
cached copy in order to read it in again. This is
|
||||
necessary because we skipped some symbols when we first
|
||||
@@ -6257,12 +6260,17 @@ process_psymtab_comp_unit (struct dwarf2_per_cu_data *this_cu,
|
||||
if (this_cu->cu != NULL)
|
||||
free_one_cached_comp_unit (this_cu);
|
||||
|
||||
- gdb_assert (! this_cu->is_debug_types);
|
||||
- info.want_partial_unit = want_partial_unit;
|
||||
- info.pretend_language = pretend_language;
|
||||
- init_cutu_and_read_dies (this_cu, NULL, 0, 0,
|
||||
- process_psymtab_comp_unit_reader,
|
||||
- &info);
|
||||
+ if (this_cu->is_debug_types)
|
||||
+ init_cutu_and_read_dies (this_cu, NULL, 0, 0, build_type_psymtabs_reader,
|
||||
+ NULL);
|
||||
+ else
|
||||
+ {
|
||||
+ process_psymtab_comp_unit_data info;
|
||||
+ info.want_partial_unit = want_partial_unit;
|
||||
+ info.pretend_language = pretend_language;
|
||||
+ init_cutu_and_read_dies (this_cu, NULL, 0, 0,
|
||||
+ process_psymtab_comp_unit_reader, &info);
|
||||
+ }
|
||||
|
||||
/* Age out any secondary CUs. */
|
||||
age_cached_comp_units ();
|
||||
@@ -6717,6 +6725,7 @@ load_partial_comp_unit (struct dwarf2_per_cu_data *this_cu)
|
||||
static void
|
||||
read_comp_units_from_section (struct objfile *objfile,
|
||||
struct dwarf2_section_info *section,
|
||||
+ struct dwarf2_section_info *abbrev_section,
|
||||
unsigned int is_dwz,
|
||||
int *n_allocated,
|
||||
int *n_comp_units,
|
||||
@@ -6736,20 +6745,33 @@ read_comp_units_from_section (struct objfile *objfile,
|
||||
|
||||
while (info_ptr < section->buffer + section->size)
|
||||
{
|
||||
- unsigned int length, initial_length_size;
|
||||
struct dwarf2_per_cu_data *this_cu;
|
||||
|
||||
sect_offset sect_off = (sect_offset) (info_ptr - section->buffer);
|
||||
|
||||
- /* Read just enough information to find out where the next
|
||||
- compilation unit is. */
|
||||
- length = read_initial_length (abfd, info_ptr, &initial_length_size);
|
||||
+ comp_unit_head cu_header;
|
||||
+ read_and_check_comp_unit_head (&cu_header, section, abbrev_section,
|
||||
+ info_ptr, rcuh_kind::COMPILE);
|
||||
|
||||
/* Save the compilation unit for later lookup. */
|
||||
- this_cu = XOBNEW (&objfile->objfile_obstack, struct dwarf2_per_cu_data);
|
||||
- memset (this_cu, 0, sizeof (*this_cu));
|
||||
+ if (cu_header.unit_type != DW_UT_type)
|
||||
+ {
|
||||
+ this_cu = XOBNEW (&objfile->objfile_obstack,
|
||||
+ struct dwarf2_per_cu_data);
|
||||
+ memset (this_cu, 0, sizeof (*this_cu));
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ auto sig_type = XOBNEW (&objfile->objfile_obstack,
|
||||
+ struct signatured_type);
|
||||
+ memset (sig_type, 0, sizeof (*sig_type));
|
||||
+ sig_type->signature = cu_header.signature;
|
||||
+ sig_type->type_offset_in_tu = cu_header.type_cu_offset_in_tu;
|
||||
+ this_cu = &sig_type->per_cu;
|
||||
+ }
|
||||
+ this_cu->is_debug_types = (cu_header.unit_type == DW_UT_type);
|
||||
this_cu->sect_off = sect_off;
|
||||
- this_cu->length = length + initial_length_size;
|
||||
+ this_cu->length = cu_header.length + cu_header.initial_length_size;
|
||||
this_cu->is_dwz = is_dwz;
|
||||
this_cu->objfile = objfile;
|
||||
this_cu->section = section;
|
||||
@@ -6782,12 +6804,13 @@ create_all_comp_units (struct objfile *objfile)
|
||||
n_allocated = 10;
|
||||
all_comp_units = XNEWVEC (struct dwarf2_per_cu_data *, n_allocated);
|
||||
|
||||
- read_comp_units_from_section (objfile, &dwarf2_per_objfile->info, 0,
|
||||
+ read_comp_units_from_section (objfile, &dwarf2_per_objfile->info,
|
||||
+ &dwarf2_per_objfile->abbrev, 0,
|
||||
&n_allocated, &n_comp_units, &all_comp_units);
|
||||
|
||||
dwz = dwarf2_get_dwz_file ();
|
||||
if (dwz != NULL)
|
||||
- read_comp_units_from_section (objfile, &dwz->info, 1,
|
||||
+ read_comp_units_from_section (objfile, &dwz->info, &dwz->abbrev, 1,
|
||||
&n_allocated, &n_comp_units,
|
||||
&all_comp_units);
|
||||
|
||||
|
||||
|
||||
|
||||
commit f74f69f45570ced87b9f778983a63157b551a129
|
||||
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Thu Aug 24 16:39:11 2017 +0200
|
||||
|
||||
DWARF-5 Fix DW_FORM_implicit_const
|
||||
|
||||
-gdwarf-4:
|
||||
ptype logical
|
||||
type = const char [2]
|
||||
(gdb) PASS: gdb.base/constvars.exp: ptype logical
|
||||
|
||||
-gdwarf-5:
|
||||
ptype logical
|
||||
type = const char []
|
||||
(gdb) FAIL: gdb.base/constvars.exp: ptype logical
|
||||
|
||||
<2><2fc>: Abbrev Number: 1 (DW_TAG_variable)
|
||||
<2fd> DW_AT_name : (indirect string, offset: 0x2eb): logical
|
||||
<301> DW_AT_decl_file : 1
|
||||
|
||||
1 DW_TAG_variable [no children]
|
||||
DW_AT_name DW_FORM_strp
|
||||
DW_AT_decl_file DW_FORM_implicit_const: 1
|
||||
|
||||
During symbol reading, invalid attribute class or form for
|
||||
'DW_FORM_implicit_const' in '(null)'.
|
||||
|
||||
gdb/ChangeLog
|
||||
2017-08-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
PR symtab/22003
|
||||
* dwarf2read.c (dwarf2_const_value_attr, dump_die_shallow)
|
||||
(dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
|
||||
(skip_form_bytes, attr_form_is_constant): Handle DW_FORM_implicit_const.
|
||||
|
||||
### a/gdb/ChangeLog
|
||||
### b/gdb/ChangeLog
|
||||
## -1,5 +1,12 @@
|
||||
2017-08-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
+ PR symtab/22003
|
||||
+ * dwarf2read.c (dwarf2_const_value_attr, dump_die_shallow)
|
||||
+ (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
|
||||
+ (skip_form_bytes, attr_form_is_constant): Handle DW_FORM_implicit_const.
|
||||
+
|
||||
+2017-08-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
+
|
||||
* dwarf2read.c (build_type_psymtabs_reader): New prototype.
|
||||
(process_psymtab_comp_unit): Accept IS_DEBUG_TYPES.
|
||||
(read_comp_units_from_section): New parameter abbrev_section, use
|
||||
--- a/gdb/dwarf2read.c
|
||||
+++ b/gdb/dwarf2read.c
|
||||
@@ -19430,6 +19430,7 @@ dwarf2_const_value_attr (const struct attribute *attr, struct type *type,
|
||||
break;
|
||||
|
||||
case DW_FORM_sdata:
|
||||
+ case DW_FORM_implicit_const:
|
||||
*value = DW_SND (attr);
|
||||
break;
|
||||
|
||||
@@ -20423,6 +20424,10 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
|
||||
fprintf_unfiltered (f,
|
||||
"unexpected attribute form: DW_FORM_indirect");
|
||||
break;
|
||||
+ case DW_FORM_implicit_const:
|
||||
+ fprintf_unfiltered (f, "constant: %s",
|
||||
+ plongest (DW_SND (&die->attrs[i])));
|
||||
+ break;
|
||||
default:
|
||||
fprintf_unfiltered (f, "unsupported attribute form: %d.",
|
||||
die->attrs[i].form);
|
||||
@@ -20514,7 +20519,7 @@ dwarf2_get_ref_die_offset (const struct attribute *attr)
|
||||
static LONGEST
|
||||
dwarf2_get_attr_constant_value (const struct attribute *attr, int default_value)
|
||||
{
|
||||
- if (attr->form == DW_FORM_sdata)
|
||||
+ if (attr->form == DW_FORM_sdata || attr->form == DW_FORM_implicit_const)
|
||||
return DW_SND (attr);
|
||||
else if (attr->form == DW_FORM_udata
|
||||
|| attr->form == DW_FORM_data1
|
||||
@@ -20849,6 +20854,7 @@ dwarf2_fetch_constant_bytes (sect_offset sect_off,
|
||||
break;
|
||||
|
||||
case DW_FORM_sdata:
|
||||
+ case DW_FORM_implicit_const:
|
||||
type = die_type (die, cu);
|
||||
result = write_constant_as_bytes (obstack, byte_order,
|
||||
type, DW_SND (attr), len);
|
||||
@@ -21785,6 +21791,9 @@ skip_form_bytes (bfd *abfd, const gdb_byte *bytes, const gdb_byte *buffer_end,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case DW_FORM_implicit_const:
|
||||
+ break;
|
||||
+
|
||||
default:
|
||||
{
|
||||
complain:
|
||||
@@ -22426,6 +22435,7 @@ attr_form_is_constant (const struct attribute *attr)
|
||||
case DW_FORM_data2:
|
||||
case DW_FORM_data4:
|
||||
case DW_FORM_data8:
|
||||
+ case DW_FORM_implicit_const:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
5
gdb.spec
5
gdb.spec
@ -26,7 +26,7 @@ Version: 8.0
|
||||
|
||||
# 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: 23%{?dist}
|
||||
Release: 24%{?dist}
|
||||
|
||||
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL
|
||||
Group: Development/Debuggers
|
||||
@ -1715,6 +1715,9 @@ then
|
||||
fi
|
||||
|
||||
%changelog
|
||||
* Thu Aug 24 2017 Jan Kratochvil <jan.kratochvil@redhat.com> - 8.0-24.fc26
|
||||
- Backport DWARF-5 and breakpoint fixes from upstream stable branch 8.0.
|
||||
|
||||
* Sat Aug 19 2017 Jan Kratochvil <jan.kratochvil@redhat.com> - 8.0-23.fc26
|
||||
- [s390x] Backport arch12 support and other s390x fixes (RH BZ 1420304).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user