* gdb-rhbz1773651-gdb-index-internal-error.patch - Patches added (backport from master): * gdb-support-rseq-auxvs.patch * gdb-symtab-fix-line-number-of-static-const-class-mem.patch * gdb-symtab-fix-too-many-symbols-in-gdbpy_lookup_stat.patch * gdb-symtab-handle-pu-in-iterate_over_some_symtabs.patch * gdb-symtab-work-around-pr-gas-29517.patch * gdb-testsuite-add-kfail-for-pr-ada-30908.patch * gdb-testsuite-add-xfail-for-gdb-29965-in-gdb.threads.patch * gdb-testsuite-fix-gdb.ada-mi_task_arg.exp-with-newer.patch * gdb-testsuite-fix-gdb.arch-i386-signal.exp-on-x86_64.patch * gdb-testsuite-fix-gdb.cp-m-static.exp-regression-on-.patch * gdb-testsuite-fix-gdb.dwarf2-nullptr_t.exp-with-cc-w.patch * gdb-testsuite-fix-regexps-in-gdb.base-step-over-sysc.patch * gdb-symtab-find-main-language-without-symtab-expansi.patch * gdb-testsuite-add-wait-for-index-cache-in-gdb.dwarf2.patch - Patches moved (from "Backport from gdb-patches" to "Backports from master, available in next release"): * gdb-cli-handle-pending-c-after-rl_callback_read_char.patch * gdb-testsuite-add-have_host_locale.patch - Maintenance script qa.sh: * Remove PR28463, PR28108, PR29247 and PR29160 kfails. * Remove PR30540, PR30908, PR29965 kfails. * Remove gdb.ada/mi_task_arg.exp kfail. - Limit "Suggests: %{python}-Pygments" to SLE-15 and later. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=365
85 lines
3.1 KiB
Diff
85 lines
3.1 KiB
Diff
From e5972def532f3ed248dfbd2f220f28dc367f4ca1 Mon Sep 17 00:00:00 2001
|
|
From: Tom de Vries <tdevries@suse.de>
|
|
Date: Fri, 24 Mar 2023 15:45:56 +0100
|
|
Subject: [PATCH 07/12] [gdb/symtab] Fix line number of static const class
|
|
member
|
|
|
|
Since commit 6d263fe46e0 ("Avoid bad breakpoints with --gc-sections"), there
|
|
was a silent regression on openSUSE Leap 15.4 for test-case
|
|
gdb.cp/m-static.exp, from:
|
|
...
|
|
(gdb) info variable everywhere^M
|
|
All variables matching regular expression "everywhere":^M
|
|
^M
|
|
File /home/vries/tmp.local-remote-host-native/m-static.h:^M
|
|
8: const int gnu_obj_4::everywhere;^M
|
|
(gdb)
|
|
...
|
|
to:
|
|
...
|
|
(gdb) info variable everywhere^M
|
|
All variables matching regular expression "everywhere":^M
|
|
^M
|
|
File /data/vries/gdb/src/gdb/testsuite/gdb.cp/m-static.h:^M
|
|
8: const int gnu_obj_4::everywhere;^M
|
|
^M
|
|
File /data/vries/gdb/src/gdb/testsuite/gdb.cp/m-static1.cc:^M
|
|
8: const int gnu_obj_4::everywhere;^M
|
|
(gdb)
|
|
...
|
|
|
|
Another regression was found due to that commit, and it was fixed in commit
|
|
99d679e7b30 ("[gdb/symtab] Fix "file index out of range" complaint") by
|
|
limiting the scope of the fix in the original commit.
|
|
|
|
Fix this regression by yet further limiting the scope of that fix, making sure
|
|
that this bit in dwarf_decode_lines is executed again for m-static1.cc:
|
|
...
|
|
/* Make sure a symtab is created for every file, even files
|
|
which contain only variables (i.e. no code with associated
|
|
line numbers). */
|
|
...
|
|
|
|
Tested on x86_64-linux.
|
|
|
|
PR symtab/30265
|
|
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30265
|
|
---
|
|
gdb/dwarf2/read.c | 3 +--
|
|
gdb/testsuite/gdb.cp/m-static.exp | 4 +++-
|
|
2 files changed, 4 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
|
index f39eba7a008..04bc0e1cbbd 100644
|
|
--- a/gdb/dwarf2/read.c
|
|
+++ b/gdb/dwarf2/read.c
|
|
@@ -9633,8 +9633,7 @@ handle_DW_AT_stmt_list (struct die_info *die, struct dwarf2_cu *cu,
|
|
then there won't be any interesting code in the CU, but a check later on
|
|
(in lnp_state_machine::check_line_address) will fail to properly exclude
|
|
an entry that was removed via --gc-sections. */
|
|
- if (have_code)
|
|
- dwarf_decode_lines (cu->line_header, cu, lowpc, decode_mapping);
|
|
+ dwarf_decode_lines (cu->line_header, cu, lowpc, decode_mapping && have_code);
|
|
}
|
|
|
|
/* Process DW_TAG_compile_unit or DW_TAG_partial_unit. */
|
|
diff --git a/gdb/testsuite/gdb.cp/m-static.exp b/gdb/testsuite/gdb.cp/m-static.exp
|
|
index a67b4cd3736..049e88299da 100644
|
|
--- a/gdb/testsuite/gdb.cp/m-static.exp
|
|
+++ b/gdb/testsuite/gdb.cp/m-static.exp
|
|
@@ -183,8 +183,10 @@ gdb_test "print test4.somewhere" "\\$\[0-9\].* = 3.14\[0-9\]*" "static const flo
|
|
if { $non_dwarf } { setup_xfail *-*-* }
|
|
gdb_test "info variable everywhere" \
|
|
[multi_line \
|
|
+ {All variables matching regular expression "everywhere":} \
|
|
+ "" \
|
|
"File (.*/)?m-static\[.\]h:" \
|
|
- "$decimal:\tconst int gnu_obj_4::everywhere;.*"]
|
|
+ "$decimal:\tconst int gnu_obj_4::everywhere;"]
|
|
|
|
# Perhaps at some point test4 should also include a test for a static
|
|
# const int that was initialized in the header file. But I'm not sure
|
|
--
|
|
2.35.3
|
|
|