public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/27336] New: [dwarf-5] abort on info addr in gdb.cp/temargs.exp
@ 2021-02-03 14:17 vries at gcc dot gnu.org
2021-02-03 15:28 ` [Bug symtab/27336] " vries at gcc dot gnu.org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-03 14:17 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27336
Bug ID: 27336
Summary: [dwarf-5] abort on info addr in gdb.cp/temargs.exp
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: symtab
Assignee: unassigned at sourceware dot org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
With test-case gdb.cp/temargs.exp on target board
unix/gdb:debug_flags=-gdwarf-5 I run into:
...
(gdb) PASS: gdb.cp/temargs.exp: continue to breakpoint: continue to fourth
breakpoint for temargs
ptype T^M
type = double^M
(gdb) PASS: gdb.cp/temargs.exp: test type of T in templ_m
print I^M
$10 = 23^M
(gdb) PASS: gdb.cp/temargs.exp: test value of I in templ_m
info addr I^M
ERROR: GDB process no longer exists
GDB process exited with wait status 32286 exp19 0 0 CHILDKILLED SIGABRT SIGABRT
UNRESOLVED: gdb.cp/temargs.exp: test address of I in templ_m
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug symtab/27336] [dwarf-5] abort on info addr in gdb.cp/temargs.exp
2021-02-03 14:17 [Bug symtab/27336] New: [dwarf-5] abort on info addr in gdb.cp/temargs.exp vries at gcc dot gnu.org
@ 2021-02-03 15:28 ` vries at gcc dot gnu.org
2021-02-03 16:51 ` vries at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-03 15:28 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27336
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Bisects to commit 529908cbd0a "Remove DW_UNSND".
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug symtab/27336] [dwarf-5] abort on info addr in gdb.cp/temargs.exp
2021-02-03 14:17 [Bug symtab/27336] New: [dwarf-5] abort on info addr in gdb.cp/temargs.exp vries at gcc dot gnu.org
2021-02-03 15:28 ` [Bug symtab/27336] " vries at gcc dot gnu.org
@ 2021-02-03 16:51 ` vries at gcc dot gnu.org
2021-02-03 18:18 ` vries at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-03 16:51 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27336
--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
So, we got a DW_AT_decl_file:
...
<1><221>: Abbrev Number: 4 (DW_TAG_structure_type)
<222> DW_AT_name : (indirect string, offset: 0x2e7): Base<double,
23, (& a_global), &S::f>
<226> DW_AT_byte_size : 1
<226> DW_AT_decl_file : 1
<226> DW_AT_decl_line : 30
<227> DW_AT_sibling : <0x299>
...
with form DW_FORM_implicit_const:
...
4 DW_TAG_structure_type [has children]
DW_AT_name DW_FORM_strp
DW_AT_byte_size DW_FORM_implicit_const: 1
DW_AT_decl_file DW_FORM_implicit_const: 1
DW_AT_decl_line DW_FORM_data1
DW_AT_sibling DW_FORM_ref4
DW_AT value: 0 DW_FORM value: 0
...
which fails here:
...
attr = dwarf2_attr (die,
inlined_func ? DW_AT_call_file : DW_AT_decl_file,
cu);
if (attr != nullptr && attr->form_is_unsigned ())
...
because DW_FORM_implicit_const encodes a signed LEB128, so
attr->form_is_unsigned () return false.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug symtab/27336] [dwarf-5] abort on info addr in gdb.cp/temargs.exp
2021-02-03 14:17 [Bug symtab/27336] New: [dwarf-5] abort on info addr in gdb.cp/temargs.exp vries at gcc dot gnu.org
2021-02-03 15:28 ` [Bug symtab/27336] " vries at gcc dot gnu.org
2021-02-03 16:51 ` vries at gcc dot gnu.org
@ 2021-02-03 18:18 ` vries at gcc dot gnu.org
2021-02-04 10:08 ` vries at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-03 18:18 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27336
--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
Tentative fix:
...
diff --git a/gdb/dwarf2/attribute.h b/gdb/dwarf2/attribute.h
index aded129764a..baf93903d19 100644
--- a/gdb/dwarf2/attribute.h
+++ b/gdb/dwarf2/attribute.h
@@ -70,7 +70,7 @@ struct attribute
form. */
LONGEST as_signed () const
{
- gdb_assert (form == DW_FORM_sdata || form == DW_FORM_implicit_const);
+ gdb_assert (form_is_signed ());
return u.snd;
}
@@ -92,6 +92,28 @@ struct attribute
return u.unsnd;
}
+ /* Return true if the value is nonnegative. Requires that that
+ reprocessing not be needed. */
+ bool is_nonnegative () const
+ {
+ if (form_is_unsigned ())
+ return true;
+ if (form_is_signed ())
+ return as_signed () >= (LONGEST)0;
+ return false;
+ }
+
+ /* Return the nonnegative value. Requires that that reprocessing not be
+ needed. */
+ ULONGEST as_nonnegative () const
+ {
+ if (form_is_unsigned ())
+ return as_unsigned ();
+ if (form_is_signed ())
+ return (ULONGEST)as_signed ();
+ gdb_assert (false);
+ }
+
/* Return non-zero if ATTR's value is a section offset --- classes
lineptr, loclistptr, macptr or rangelistptr --- or zero, otherwise.
You may use the as_unsigned method to retrieve such offsets.
@@ -147,6 +169,9 @@ struct attribute
/* Check if the attribute's form is an unsigned integer form. */
bool form_is_unsigned () const;
+ /* Check if the attribute's form is a signed integer form. */
+ bool form_is_signed () const;
+
/* Check if the attribute's form is a form that requires
"reprocessing". */
bool form_requires_reprocessing () const;
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index bcac94ed36a..35e6ba0044a 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -21427,10 +21427,10 @@ new_symbol (struct die_info *die, struct type *type,
struct
dwarf2_cu *cu,
attr = dwarf2_attr (die,
inlined_func ? DW_AT_call_file : DW_AT_decl_file,
cu);
- if (attr != nullptr && attr->form_is_unsigned ())
+ if (attr != nullptr && attr->is_nonnegative ())
{
file_name_index file_index
- = (file_name_index) attr->as_unsigned ();
+ = (file_name_index) attr->as_nonnegative ();
struct file_entry *fe;
if (cu->line_header != NULL)
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug symtab/27336] [dwarf-5] abort on info addr in gdb.cp/temargs.exp
2021-02-03 14:17 [Bug symtab/27336] New: [dwarf-5] abort on info addr in gdb.cp/temargs.exp vries at gcc dot gnu.org
` (2 preceding siblings ...)
2021-02-03 18:18 ` vries at gcc dot gnu.org
@ 2021-02-04 10:08 ` vries at gcc dot gnu.org
2021-02-05 12:32 ` vries at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-04 10:08 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27336
--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
Conservative fix:
...
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 68fc47fb028..932eb7bb11d 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -17243,6 +17243,9 @@ read_array_type (struct die_info *die, struct dwarf2_cu
*cu)
}
}
+ if (type == element_type)
+ return NULL;
+
/* Understand Dwarf2 support for vector types (like they occur on
the PowerPC w/ AltiVec). Gcc just adds another attribute to the
array type. This is not part of the Dwarf2/3 standard yet, but a
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug symtab/27336] [dwarf-5] abort on info addr in gdb.cp/temargs.exp
2021-02-03 14:17 [Bug symtab/27336] New: [dwarf-5] abort on info addr in gdb.cp/temargs.exp vries at gcc dot gnu.org
` (3 preceding siblings ...)
2021-02-04 10:08 ` vries at gcc dot gnu.org
@ 2021-02-05 12:32 ` vries at gcc dot gnu.org
2021-02-22 2:37 ` tromey at sourceware dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-05 12:32 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27336
--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2021-February/175787.html
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug symtab/27336] [dwarf-5] abort on info addr in gdb.cp/temargs.exp
2021-02-03 14:17 [Bug symtab/27336] New: [dwarf-5] abort on info addr in gdb.cp/temargs.exp vries at gcc dot gnu.org
` (4 preceding siblings ...)
2021-02-05 12:32 ` vries at gcc dot gnu.org
@ 2021-02-22 2:37 ` tromey at sourceware dot org
2021-02-24 22:58 ` cvs-commit at gcc dot gnu.org
2021-02-24 22:59 ` vries at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: tromey at sourceware dot org @ 2021-02-22 2:37 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27336
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |27453
Referenced Bugs:
https://sourceware.org/bugzilla/show_bug.cgi?id=27453
[Bug 27453] [meta] DWARF 5 support
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug symtab/27336] [dwarf-5] abort on info addr in gdb.cp/temargs.exp
2021-02-03 14:17 [Bug symtab/27336] New: [dwarf-5] abort on info addr in gdb.cp/temargs.exp vries at gcc dot gnu.org
` (5 preceding siblings ...)
2021-02-22 2:37 ` tromey at sourceware dot org
@ 2021-02-24 22:58 ` cvs-commit at gcc dot gnu.org
2021-02-24 22:59 ` vries at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-24 22:58 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27336
--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aa659cfad638376ab535bc5a7b65c164327e9e21
commit aa659cfad638376ab535bc5a7b65c164327e9e21
Author: Tom de Vries <tdevries@suse.de>
Date: Wed Feb 24 23:58:42 2021 +0100
[gdb/symtab] Handle DW_AT_decl_file with form DW_FORM_implicit_const
With test-case gdb.cp/temargs.exp on target board \
unix/gdb:debug_flags=-gdwarf-5 I run into:
...
(gdb) info addr I^M
ERROR: GDB process no longer exists
GDB process exited with wait status 32286 exp19 0 0 CHILDKILLED SIGABRT
SIGABRT
UNRESOLVED: gdb.cp/temargs.exp: test address of I in templ_m
...
This is a regression since commit 529908cbd0a "Remove DW_UNSND".
The problem is that this DW_AT_decl_file:
...
<1><221>: Abbrev Number: 4 (DW_TAG_structure_type)
<222> DW_AT_name : Base<double, 23, (& a_global), &S::f>
<226> DW_AT_byte_size : 1
<226> DW_AT_decl_file : 1
<226> DW_AT_decl_line : 30
<227> DW_AT_sibling : <0x299>
...
is not read by this code in new_symbol:
....
attr = dwarf2_attr (die,
inlined_func ? DW_AT_call_file : DW_AT_decl_file,
cu);
if (attr != nullptr && attr->form_is_unsigned ())
...
because DW_AT_decl_file has form DW_FORM_implicit_const:
...
4 DW_TAG_structure_type [has children]
DW_AT_name DW_FORM_strp
DW_AT_byte_size DW_FORM_implicit_const: 1
DW_AT_decl_file DW_FORM_implicit_const: 1
DW_AT_decl_line DW_FORM_data1
DW_AT_sibling DW_FORM_ref4
DW_AT value: 0 DW_FORM value: 0
...
which is a signed LEB128, so attr->form_is_unsigned () returns false.
Fix this by introducing new functions is_nonnegative and as_nonnegative,
and
use these instead of form_is_unsigned and as_unsigned.
Tested on x86_64-linux.
gdb/ChangeLog:
2021-02-24 Tom de Vries <tdevries@suse.de>
PR symtab/27336
* dwarf2/attribute.c (attribute::form_is_signed): New function
factored out of ...
* dwarf2/attribute.h (attribute::as_signed): ... here.
(attribute::is_nonnegative, attribute::as_nonnegative): New
function.
(attribute::form_is_signed): Declare.
* dwarf2/read.c (new_symbol): Use is_nonnegative and as_nonnegative
for DW_AT_decl_file.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug symtab/27336] [dwarf-5] abort on info addr in gdb.cp/temargs.exp
2021-02-03 14:17 [Bug symtab/27336] New: [dwarf-5] abort on info addr in gdb.cp/temargs.exp vries at gcc dot gnu.org
` (6 preceding siblings ...)
2021-02-24 22:58 ` cvs-commit at gcc dot gnu.org
@ 2021-02-24 22:59 ` vries at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-24 22:59 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27336
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |11.1
--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
Committed patch, marking resolved-fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-02-24 22:59 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 14:17 [Bug symtab/27336] New: [dwarf-5] abort on info addr in gdb.cp/temargs.exp vries at gcc dot gnu.org
2021-02-03 15:28 ` [Bug symtab/27336] " vries at gcc dot gnu.org
2021-02-03 16:51 ` vries at gcc dot gnu.org
2021-02-03 18:18 ` vries at gcc dot gnu.org
2021-02-04 10:08 ` vries at gcc dot gnu.org
2021-02-05 12:32 ` vries at gcc dot gnu.org
2021-02-22 2:37 ` tromey at sourceware dot org
2021-02-24 22:58 ` cvs-commit at gcc dot gnu.org
2021-02-24 22:59 ` vries at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).