public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
@ 2020-04-20 7:23 vries at gcc dot gnu.org
2020-04-20 7:56 ` [Bug symtab/25858] " vries at gcc dot gnu.org
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-20 7:23 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
Bug ID: 25858
Summary: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break
<NoDebugMixedCaseFunc>
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: ---
When running test-case gdb.ada/bp_c_mixed_case.exp with target board readnow,
we have:
...
(gdb) break <NoDebugMixedCaseFunc>^M
Breakpoint 3 at 0x401f7a: file ../sysdeps/x86_64/crtn.S, line 41.^M
(gdb) FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
...
while with native we have:
...
(gdb) break <NoDebugMixedCaseFunc>^M
Breakpoint 3 at 0x401f7e^M
(gdb) PASS: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
@ 2020-04-20 7:56 ` vries at gcc dot gnu.org
2020-04-20 7:57 ` vries at gcc dot gnu.org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-20 7:56 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
The minimal symbol NoDebugMixedCaseFunc has this address:
...
$ nm outputs/gdb.ada/bp_c_mixed_case/foo_h731_021 | grep NoDebugMixedCaseFunc
0000000000401f7a T NoDebugMixedCaseFunc
...
and originates from source file qux.c, which is compiled without debug info.
But during the process of setting the breakpoint, we try to find out the
source/line info for the function, and hit find_pc_sect_compunit_symtab, which
returns the symtab for crtn.S.
The corresponding CU in the debug info looks like this:
...
<0><1ff76>: Abbrev Number: 1 (DW_TAG_compile_unit)
<1ff77> DW_AT_stmt_list : 0x513d
<1ff7b> DW_AT_ranges : 0x3490
<1ff7f> DW_AT_name : ../sysdeps/x86_64/crtn.S
<1ff83> DW_AT_comp_dir : /home/abuild/rpmbuild/BUILD/glibc-2.26/csu
<1ff87> DW_AT_producer : GNU AS 2.32.0
<1ff8b> DW_AT_language : 32769 (MIPS assembler)
...
and the DW_AT_ranges attribute refers to:
...
00003490 ffffffffffffffff 0000000000000000 (base address)
00003490 0000000000401822 0000000000401827
00003490 000000000040dc98 000000000040dc9d
00003490 <End of list>
...
So, the address of NoDebugMixedCaseFunc 0x401f7e doesn't fall in any of the two
ranges, but the global block for the CU has these
BLOCK_START/BLOCK_END/BLOCK_RANGES values:
...
(gdb) p /x b.startaddr
$8 = 0x401822
(gdb) p /x b.endaddr
$9 = 0x40dc9d
(gdb) p b->ranges
$10 = (blockranges *) 0x0
...
so find_pc_sect_compunit_symtab decides that the symbol is part of that CU.
Note btw that the static block does have ranges:
...
(gdb) p /x cust->blockvector->block[1].startaddr
$20 = 0x401822
(gdb) p /x cust->blockvector->block[1].endaddr
$21 = 0x40dc9d
(gdb) p cust->blockvector->block[1].ranges
$22 = (blockranges *) 0x1ca6860
(gdb) p /x cust->blockvector->block[1].ranges.range[0]
$24 = {startaddr = 0x401822, endaddr = 0x401827}
(gdb) p /x cust->blockvector->block[1].ranges.range[1]
$25 = {startaddr = 0x40dc98, endaddr = 0x40dc9d}
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
2020-04-20 7:56 ` [Bug symtab/25858] " vries at gcc dot gnu.org
@ 2020-04-20 7:57 ` vries at gcc dot gnu.org
2020-04-20 13:49 ` vries at gcc dot gnu.org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-20 7:57 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Tentative patch:
...
diff --git a/gdb/symtab.c b/gdb/symtab.c
index dc079efbc2..63a4b91f12 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2933,6 +2933,9 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct
obj_section *section)
const struct blockvector *bv;
bv = COMPUNIT_BLOCKVECTOR (cust);
+ if (!blockvector_contains_pc (bv, pc))
+ continue;
+
b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
if (BLOCK_START (b) <= pc
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
2020-04-20 7:56 ` [Bug symtab/25858] " vries at gcc dot gnu.org
2020-04-20 7:57 ` vries at gcc dot gnu.org
@ 2020-04-20 13:49 ` vries at gcc dot gnu.org
2020-04-20 13:53 ` vries at gcc dot gnu.org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-20 13:49 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #2)
> Tentative patch:
> ...
> diff --git a/gdb/symtab.c b/gdb/symtab.c
> index dc079efbc2..63a4b91f12 100644
> --- a/gdb/symtab.c
> +++ b/gdb/symtab.c
> @@ -2933,6 +2933,9 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct
> obj_section *section)
> const struct blockvector *bv;
>
> bv = COMPUNIT_BLOCKVECTOR (cust);
> + if (!blockvector_contains_pc (bv, pc))
> + continue;
> +
> b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
>
> if (BLOCK_START (b) <= pc
> ...
There must be some kind of invariant I'm breaking with the usage of
blockvector_contains_pc in the tentative patch, because this assert:
...
diff --git a/gdb/block.c b/gdb/block.c
index 9b582433e4..bb21d72dbe 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -167,7 +167,10 @@ find_block_in_blockvector (const struct blockvector *bl,
CORE_ADDR pc)
{
b = BLOCKVECTOR_BLOCK (bl, bot);
if (BLOCK_END (b) > pc)
- return b;
+ {
+ gdb_assert (BLOCK_START (b) <= pc);
+ return b;
+ }
bot--;
}
...
does not trigger on master, but if I build master with the tentative patch, it
triggers all the time in the testsuite (already counting 127 FAILs in gdb.ada
at gdb.ada/mi_interface.exp).
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
` (2 preceding siblings ...)
2020-04-20 13:49 ` vries at gcc dot gnu.org
@ 2020-04-20 13:53 ` vries at gcc dot gnu.org
2020-04-20 15:03 ` vries at gcc dot gnu.org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-20 13:53 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #3)
> (In reply to Tom de Vries from comment #2)
> > Tentative patch:
> > ...
> > diff --git a/gdb/symtab.c b/gdb/symtab.c
> > index dc079efbc2..63a4b91f12 100644
> > --- a/gdb/symtab.c
> > +++ b/gdb/symtab.c
> > @@ -2933,6 +2933,9 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct
> > obj_section *section)
> > const struct blockvector *bv;
> >
> > bv = COMPUNIT_BLOCKVECTOR (cust);
> > + if (!blockvector_contains_pc (bv, pc))
> > + continue;
> > +
> > b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
> >
> > if (BLOCK_START (b) <= pc
> > ...
>
> There must be some kind of invariant I'm breaking with the usage of
> blockvector_contains_pc in the tentative patch, because this assert:
> ...
> diff --git a/gdb/block.c b/gdb/block.c
> index 9b582433e4..bb21d72dbe 100644
> --- a/gdb/block.c
> +++ b/gdb/block.c
> @@ -167,7 +167,10 @@ find_block_in_blockvector (const struct blockvector
> *bl, CORE_ADDR pc)
> {
> b = BLOCKVECTOR_BLOCK (bl, bot);
> if (BLOCK_END (b) > pc)
> - return b;
> + {
> + gdb_assert (BLOCK_START (b) <= pc);
> + return b;
> + }
> bot--;
> }
>
> ...
> does not trigger on master, but if I build master with the tentative patch,
> it triggers all the time in the testsuite (already counting 127 FAILs in
> gdb.ada at gdb.ada/mi_interface.exp).
Tentative patch for this problem:
...
diff --git a/gdb/block.c b/gdb/block.c
index 9b582433e4..f883724d56 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -166,7 +166,7 @@ find_block_in_blockvector (const struct blockvector *bl,
CORE_ADDR pc)
while (bot >= STATIC_BLOCK)
{
b = BLOCKVECTOR_BLOCK (bl, bot);
- if (BLOCK_END (b) > pc)
+ if (BLOCK_START (b) <= pc && pc < BLOCK_END (b))
return b;
bot--;
}
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
` (3 preceding siblings ...)
2020-04-20 13:53 ` vries at gcc dot gnu.org
@ 2020-04-20 15:03 ` vries at gcc dot gnu.org
2020-04-20 15:29 ` vries at gcc dot gnu.org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-20 15:03 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #2)
> Tentative patch:
> ...
> diff --git a/gdb/symtab.c b/gdb/symtab.c
> index dc079efbc2..63a4b91f12 100644
> --- a/gdb/symtab.c
> +++ b/gdb/symtab.c
> @@ -2933,6 +2933,9 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct
> obj_section *section)
> const struct blockvector *bv;
>
> bv = COMPUNIT_BLOCKVECTOR (cust);
> + if (!blockvector_contains_pc (bv, pc))
> + continue;
> +
> b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
>
> if (BLOCK_START (b) <= pc
> ...
With this tentative patch, I run into:
...
FAIL: gdb.fortran/info-modules.exp: info module functions (timeout)
...
and a similar fail in mi-fortran-modules.exp.
More precisely:
...
(gdb) info module functions^M
All functions in all modules:^M
warning: (Internal error: pc 0x7ffff74b60a0 in read in psymtab, but not in
symtab.)^M
^M
warning: (Internal error: pc 0x7ffff74b60a5 in read in psymtab, but not in
symtab.)^M
^M
warning: (Internal error: pc 0x7ffff74b60aa in read in psymtab, but not in
symtab.)^M
^M
warning: (Internal error: pc 0x7ffff74b60af in read in psymtab, but not in
symtab.)^M
^M
warning: (Internal error: pc 0x7ffff74b60b4 in read in psymtab, but not in
symtab.)^M
^M
warning: (Internal error: pc 0x7ffff74b60b9 in read in psymtab, but not in
symtab.)^M
^M
warning: (Internal error: pc 0x7ffff74b60be in read in psymtab, but not in
symtab.)^M
^M
warning: (Internal error: pc 0x7ffff74b60c8 in read in psymtab, but not in
symtab.)^M
^M
warning: (Internal error: pc 0x7ffff74b60cd in read in psymtab, but not in
symtab.)^M
^M
warning: (Internal error: pc 0x7ffff74c5e50 in read in psymtab, but not in
symtab.)^M
^M
warning: (Internal error: pc 0x7ffff74c5e50 in read in psymtab, but not in
symtab.)^M
...
To reproduce:
...
$ gdb -batch outputs/gdb.fortran/info-modules/info-modules -ex "start" -ex
"info module functions"
...
This warning seems to stem from the fact that blockvector_contains_pc return
false for CU ../../../libgcc/unwind-dw2-fde-dip.c in objfile
/usr/lib/debug/lib64/libgcc_s.so.1-10.0.1+git175688-lp151.17.1.x86_64.debug.
The compunit has no address map:
...
(gdb) p *ps->get_compunit_symtab ()->blockvector
$6 = {nblocks = 19, map = 0x0, block = {0x43d23e0}}
...
despite the fact that the CU has a DW_AT_ranges attribute:
...
<0><db54>: Abbrev Number: 118 (DW_TAG_compile_unit)
<db5a> DW_AT_name : ../../../libgcc/unwind-dw2-fde-dip.c
<db62> DW_AT_ranges : 0x7a00
<db66> DW_AT_low_pc : 0x0
<db6e> DW_AT_stmt_list : 0xf498
...
which maps onto:
...
00007a00 0000000000011030 00000000000130a3
00007a00 00000000000030a0 00000000000030d2
00007a00 <End of list>
...
and the pc we're trying to find is indeed in the CU:
...
(gdb) p /x pc - objf->text_section_offset ()
$14 = 0x30a0
...
It's the minimal symbol:
...
$ nm outputs/gdb.fortran/info-modules/info-modules
00000000000030a0 t read_encoded_value_with_base.cold
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
` (4 preceding siblings ...)
2020-04-20 15:03 ` vries at gcc dot gnu.org
@ 2020-04-20 15:29 ` vries at gcc dot gnu.org
2020-04-20 15:52 ` vries at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-20 15:29 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #5)
> The compunit has no address map:
> ...
> (gdb) p *ps->get_compunit_symtab ()->blockvector
> $6 = {nblocks = 19, map = 0x0, block = {0x43d23e0}}
> ...
> despite the fact that the CU has a DW_AT_ranges attribute:
This seems to be because cu->base_address has not been set. This is a tentative
patch to fix that:
...
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 41db511c85..601c710750 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -9584,6 +9584,8 @@ process_full_comp_unit (struct dwarf2_per_cu_data
*per_cu,
addr = gdbarch_adjust_dwarf2_addr (gdbarch, highpc + baseaddr);
static_block = cu->get_builder ()->end_symtab_get_static_block (addr, 0, 1);
+ dwarf2_find_base_address (cu->dies, cu);
+
/* If the comp unit has DW_AT_ranges, it may have discontiguous ranges.
Also, DW_AT_ranges may record ranges not belonging to any child DIEs
(such as virtual method tables). Record the ranges in STATIC_BLOCK's
...
This indeed fixes this:
...
(gdb) p blockvector_contains_pc (ps->get_compunit_symtab ().blockvector, pc)
$13 = 1
...
But I still run into the same warning.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
` (5 preceding siblings ...)
2020-04-20 15:29 ` vries at gcc dot gnu.org
@ 2020-04-20 15:52 ` vries at gcc dot gnu.org
2020-04-23 8:40 ` vries at gcc dot gnu.org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-20 15:52 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #6)
> But I still run into the same warning.
Because pc does not fit in BLOCK_START/BLOCK_END:
...
(gdb) p /x pc - obj_file->text_section_offset ()
$85 = 0x30a0
(gdb) p /x b.startaddr - obj_file->text_section_offset ()
$86 = 0x11030
(gdb) p /x b.endaddr - obj_file->text_section_offset ()
$87 = 0x12e45
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
` (6 preceding siblings ...)
2020-04-20 15:52 ` vries at gcc dot gnu.org
@ 2020-04-23 8:40 ` vries at gcc dot gnu.org
2020-06-05 6:02 ` vries at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-23 8:40 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
--- Comment #8 from Tom de Vries <vries at gcc dot gnu.org> ---
FWIW, I've just analyzed a -readnow FAIL for gdb.base/info-fun.exp, and ended
up at the same root cause.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
` (7 preceding siblings ...)
2020-04-23 8:40 ` vries at gcc dot gnu.org
@ 2020-06-05 6:02 ` vries at gcc dot gnu.org
2020-06-05 8:29 ` andrew.burgess at embecosm dot com
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-06-05 6:02 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andrew.burgess at embecosm dot com
--- Comment #9 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> When running test-case gdb.ada/bp_c_mixed_case.exp with target board
> readnow, we have:
> ...
> (gdb) break <NoDebugMixedCaseFunc>^M
> Breakpoint 3 at 0x401f7a: file ../sysdeps/x86_64/crtn.S, line 41.^M
> (gdb) FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
> ...
> while with native we have:
> ...
> (gdb) break <NoDebugMixedCaseFunc>^M
> Breakpoint 3 at 0x401f7e^M
> (gdb) PASS: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
> ...
This actually is a regression since commit 3d92a3e313 "gdb: Don't reorder line
table entries too much when sorting."
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
` (8 preceding siblings ...)
2020-06-05 6:02 ` vries at gcc dot gnu.org
@ 2020-06-05 8:29 ` andrew.burgess at embecosm dot com
2020-10-22 11:03 ` vries at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: andrew.burgess at embecosm dot com @ 2020-06-05 8:29 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
--- Comment #10 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
I can reproduce this bug when using GCC 8.0, but not when using GCC 9.3.1.
These are the only two versions I've tried.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
` (9 preceding siblings ...)
2020-06-05 8:29 ` andrew.burgess at embecosm dot com
@ 2020-10-22 11:03 ` vries at gcc dot gnu.org
2020-10-22 15:26 ` vries at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-10-22 11:03 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #11 from Tom de Vries <vries at gcc dot gnu.org> ---
This no longer reproduces in this form, since commit d8cc8af6a1 "[gdb/symtab]
Fix line-table end-of-sequence sorting".
However, the underlying problem: find_pc_sect_compunit_symtab returning the
wrong CU, can still be demonstrated using:
...
$ gdb -batch ./outputs/gdb.ada/bp_c_mixed_case/foo_h731_021 \
-ex "break <NoDebugMixedCaseFunc>" -ex r -ex "show language"
Breakpoint 1 at 0x401f7e
Breakpoint 1, 0x0000000000401f7e in NoDebugMixedCaseFunc ()
The current source language is "auto; currently c".
...
vs:
...
$ gdb -batch ./outputs/gdb.ada/bp_c_mixed_case/foo_h731_021 \
-ex "break <NoDebugMixedCaseFunc>" -ex r -ex "show language" -readnow
Breakpoint 1 at 0x401f7e
Breakpoint 1, 0x0000000000401f7e in NoDebugMixedCaseFunc ()
The current source language is "auto; currently asm".
...
So we could mark this resolved-worksforme, or as a duplicate of PR26772 (for
which a patch was submitted which is roughly similar to the one in comment 2).
Doing the latter.
The patches from comment 4 and comment 6 indicate orthogonal issues, and should
fixed independently.
*** This bug has been marked as a duplicate of bug 26772 ***
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
` (10 preceding siblings ...)
2020-10-22 11:03 ` vries at gcc dot gnu.org
@ 2020-10-22 15:26 ` vries at gcc dot gnu.org
2020-10-26 19:31 ` vries at gcc dot gnu.org
2020-10-28 20:10 ` vries at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-10-22 15:26 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
--- Comment #12 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #4)
> (In reply to Tom de Vries from comment #3)
> > (In reply to Tom de Vries from comment #2)
> > > Tentative patch:
> > > ...
> > > diff --git a/gdb/symtab.c b/gdb/symtab.c
> > > index dc079efbc2..63a4b91f12 100644
> > > --- a/gdb/symtab.c
> > > +++ b/gdb/symtab.c
> > > @@ -2933,6 +2933,9 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct
> > > obj_section *section)
> > > const struct blockvector *bv;
> > >
> > > bv = COMPUNIT_BLOCKVECTOR (cust);
> > > + if (!blockvector_contains_pc (bv, pc))
> > > + continue;
> > > +
> > > b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
> > >
> > > if (BLOCK_START (b) <= pc
> > > ...
> >
> > There must be some kind of invariant I'm breaking with the usage of
> > blockvector_contains_pc in the tentative patch, because this assert:
> > ...
> > diff --git a/gdb/block.c b/gdb/block.c
> > index 9b582433e4..bb21d72dbe 100644
> > --- a/gdb/block.c
> > +++ b/gdb/block.c
> > @@ -167,7 +167,10 @@ find_block_in_blockvector (const struct blockvector
> > *bl, CORE_ADDR pc)
> > {
> > b = BLOCKVECTOR_BLOCK (bl, bot);
> > if (BLOCK_END (b) > pc)
> > - return b;
> > + {
> > + gdb_assert (BLOCK_START (b) <= pc);
> > + return b;
> > + }
> > bot--;
> > }
> >
> > ...
> > does not trigger on master, but if I build master with the tentative patch,
> > it triggers all the time in the testsuite (already counting 127 FAILs in
> > gdb.ada at gdb.ada/mi_interface.exp).
>
> Tentative patch for this problem:
> ...
> diff --git a/gdb/block.c b/gdb/block.c
> index 9b582433e4..f883724d56 100644
> --- a/gdb/block.c
> +++ b/gdb/block.c
> @@ -166,7 +166,7 @@ find_block_in_blockvector (const struct blockvector *bl,
> CORE_ADDR pc)
> while (bot >= STATIC_BLOCK)
> {
> b = BLOCKVECTOR_BLOCK (bl, bot);
> - if (BLOCK_END (b) > pc)
> + if (BLOCK_START (b) <= pc && pc < BLOCK_END (b))
> return b;
> bot--;
> }
> ...
Committed a similar patch at
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5fb4027fae1839cabbea75112c31bd89d46d2af0
.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
` (11 preceding siblings ...)
2020-10-22 15:26 ` vries at gcc dot gnu.org
@ 2020-10-26 19:31 ` vries at gcc dot gnu.org
2020-10-28 20:10 ` vries at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-10-26 19:31 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
--- Comment #13 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #6)
> (In reply to Tom de Vries from comment #5)
> > The compunit has no address map:
> > ...
> > (gdb) p *ps->get_compunit_symtab ()->blockvector
> > $6 = {nblocks = 19, map = 0x0, block = {0x43d23e0}}
> > ...
> > despite the fact that the CU has a DW_AT_ranges attribute:
>
> This seems to be because cu->base_address has not been set. This is a
> tentative patch to fix that:
> ...
> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
> index 41db511c85..601c710750 100644
> --- a/gdb/dwarf2/read.c
> +++ b/gdb/dwarf2/read.c
> @@ -9584,6 +9584,8 @@ process_full_comp_unit (struct dwarf2_per_cu_data
> *per_cu,
> addr = gdbarch_adjust_dwarf2_addr (gdbarch, highpc + baseaddr);
> static_block = cu->get_builder ()->end_symtab_get_static_block (addr, 0,
> 1);
>
> + dwarf2_find_base_address (cu->dies, cu);
> +
> /* If the comp unit has DW_AT_ranges, it may have discontiguous ranges.
> Also, DW_AT_ranges may record ranges not belonging to any child DIEs
> (such as virtual method tables). Record the ranges in STATIC_BLOCK's
> ...
>
Committed a similar fix at
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=1c47ec3ee86fc08d120dae7e63cec552fa456912
.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug symtab/25858] [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc>
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
` (12 preceding siblings ...)
2020-10-26 19:31 ` vries at gcc dot gnu.org
@ 2020-10-28 20:10 ` vries at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: vries at gcc dot gnu.org @ 2020-10-28 20:10 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=25858
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.1
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2020-10-28 20:10 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 7:23 [Bug symtab/25858] New: [readnow] FAIL: gdb.ada/bp_c_mixed_case.exp: break <NoDebugMixedCaseFunc> vries at gcc dot gnu.org
2020-04-20 7:56 ` [Bug symtab/25858] " vries at gcc dot gnu.org
2020-04-20 7:57 ` vries at gcc dot gnu.org
2020-04-20 13:49 ` vries at gcc dot gnu.org
2020-04-20 13:53 ` vries at gcc dot gnu.org
2020-04-20 15:03 ` vries at gcc dot gnu.org
2020-04-20 15:29 ` vries at gcc dot gnu.org
2020-04-20 15:52 ` vries at gcc dot gnu.org
2020-04-23 8:40 ` vries at gcc dot gnu.org
2020-06-05 6:02 ` vries at gcc dot gnu.org
2020-06-05 8:29 ` andrew.burgess at embecosm dot com
2020-10-22 11:03 ` vries at gcc dot gnu.org
2020-10-22 15:26 ` vries at gcc dot gnu.org
2020-10-26 19:31 ` vries at gcc dot gnu.org
2020-10-28 20:10 ` 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).