* gdb-symtab-refactor-condition-in-scan_attributes.patch * gdb-symtab-factor-out-m_die_range_map-usage.patch * gdb-symtab-handle-nullptr-parent-in-parent_map-set_p.patch * gdb-symtab-factor-out-m_deferred_entries-usage.patch * gdb-symtab-resolve-deferred-entries-inter-shard-case.patch * gdb-symtab-keep-track-of-processed-dies-in-shard.patch * gdb-symtab-resolve-deferred-entries-intra-shard-case.patch * gdb-symtab-don-t-defer-backward-refs-inter-cu-intra-.patch * gdb-symtab-recurse-into-c-dw_tag_subprogram-dies-for.patch * gdb-symtab-keep-track-of-all-parents-for-cooked-inde.patch * gdb-symtab-fix-dw_tag_inlined_subroutine-entries-in-.patch OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=373
75 lines
1.9 KiB
Diff
75 lines
1.9 KiB
Diff
From 6d472b241c96f181f88867860e92f1dfe7364903 Mon Sep 17 00:00:00 2001
|
|
From: Tom de Vries <tdevries@suse.de>
|
|
Date: Sat, 16 Sep 2023 04:07:22 +0200
|
|
Subject: [PATCH 08/11] [gdb/symtab] Don't defer backward refs, inter-cu
|
|
intra-shard case
|
|
|
|
In patch "[gdb/symtab] Resolve deferred entries, inter-shard case" we've
|
|
solved the generic case of handling deferred entries.
|
|
|
|
Add an optimization that doesn't defer inter-CU intra-shard dependencies that
|
|
are present in the shard's parent map.
|
|
|
|
Tested on x86_64-linux.
|
|
---
|
|
gdb/dwarf2/read.c | 29 ++++++++++++++++++++++++++++-
|
|
1 file changed, 28 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
|
|
index 0ab3e1a1500..d2d50b5c9cc 100644
|
|
--- a/gdb/dwarf2/read.c
|
|
+++ b/gdb/dwarf2/read.c
|
|
@@ -6709,6 +6709,12 @@ class cooked_index_storage
|
|
m_index->set_parent_valid (start, end);
|
|
}
|
|
|
|
+ /* Return true if find_parents can be relied upon. */
|
|
+ bool parent_valid (CORE_ADDR addr)
|
|
+ {
|
|
+ return m_index->parent_valid (addr);
|
|
+ }
|
|
+
|
|
private:
|
|
|
|
/* Hash function for a cutu_reader. */
|
|
@@ -6857,6 +6863,12 @@ class cooked_indexer
|
|
{
|
|
m_index_storage->set_parent_valid (start, end);
|
|
}
|
|
+
|
|
+ /* Return true if find_parents can be relied upon. */
|
|
+ bool parent_valid (CORE_ADDR addr)
|
|
+ {
|
|
+ return m_index_storage->parent_valid (addr);
|
|
+ }
|
|
};
|
|
|
|
/* Subroutine of dwarf2_build_psymtabs_hard to simplify it.
|
|
@@ -18387,7 +18399,22 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu,
|
|
else
|
|
{
|
|
/* Inter-CU case. */
|
|
- *maybe_defer = addr;
|
|
+ if (parent_valid (addr))
|
|
+ {
|
|
+ auto tmp = find_parent (addr);
|
|
+ if (tmp == &parent_map::deferred)
|
|
+ {
|
|
+ /* Defer because origin is deferred. */
|
|
+ *maybe_defer = addr;
|
|
+ }
|
|
+ else
|
|
+ *parent_entry = tmp;
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ /* Defer because origin is in other shard. */
|
|
+ *maybe_defer = addr;
|
|
+ }
|
|
}
|
|
}
|
|
|
|
--
|
|
2.35.3
|
|
|