aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/cu.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/dwarf2/cu.h')
-rw-r--r--gdb/dwarf2/cu.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h
index 6979b7c..6eda19b 100644
--- a/gdb/dwarf2/cu.h
+++ b/gdb/dwarf2/cu.h
@@ -1,6 +1,6 @@
/* DWARF CU data structure
- Copyright (C) 2021-2024 Free Software Foundation, Inc.
+ Copyright (C) 2021-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -99,6 +99,15 @@ struct dwarf2_cu
void add_dependence (dwarf2_per_cu *ref_per_cu)
{ m_dependencies.emplace (ref_per_cu); }
+ /* Find the DIE at section offset SECT_OFF.
+
+ Return nullptr if not found. */
+ die_info *find_die (sect_offset sect_off) const
+ {
+ auto it = die_hash.find (sect_off);
+ return it != die_hash.end () ? *it : nullptr;
+ }
+
/* The header of the compilation unit. */
struct comp_unit_head header;