From: Tom de Vries Date: Tue, 2 Dec 2025 21:30:46 +0000 (+0100) Subject: [gdb] Fix typos in gdb/dwarf2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f7fcbcabe3355d4f6dd3c652d60550e6b4bb449;p=thirdparty%2Fbinutils-gdb.git [gdb] Fix typos in gdb/dwarf2 Fix the following typos: ... gdb/dwarf2/cooked-index-shard.c:296: re-use ==> reuse gdb/dwarf2/read-gdb-index.c:629: re-use ==> reuse gdb/dwarf2/read.c:2399: re-using ==> reusing gdb/dwarf2/read.c:11692: endianity ==> endianness gdb/dwarf2/read.c:11694: endianity ==> endianness gdb/dwarf2/read.c:11696: endianity ==> endianness gdb/dwarf2/read.c:11709: endianity ==> endianness ... Add aranges to the ignore list. Also replace readin by "read_in". Approved-By: Simon Marchi --- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0601516d757..180c330a5f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -71,7 +71,7 @@ repos: rev: v2.4.1 hooks: - id: codespell - files: '^(gdbsupport|gdbserver|gdb/(tui|target|data-directory|po|system-gdbinit|mi|syscalls|arch|regformats|compile|python|guile|config|unittests|cli|testsuite/gdb.(ctf|dap|debuginfod|gdb|go|guile|mi|modula2|objc|opencl|opt|pascal|perf|replay|reverse|rocm|server|stabs|testsuite|tui|xml)))/' + files: '^(gdbsupport|gdbserver|gdb/(dwarf2|tui|target|data-directory|po|system-gdbinit|mi|syscalls|arch|regformats|compile|python|guile|config|unittests|cli|testsuite/gdb.(ctf|dap|debuginfod|gdb|go|guile|mi|modula2|objc|opencl|opt|pascal|perf|replay|reverse|rocm|server|stabs|testsuite|tui|xml)))/' args: [--config, gdb/contrib/setup.cfg] - repo: local hooks: diff --git a/gdb/contrib/codespell-ignore-words.txt b/gdb/contrib/codespell-ignore-words.txt index 881b1d206e5..c07df0c001d 100644 --- a/gdb/contrib/codespell-ignore-words.txt +++ b/gdb/contrib/codespell-ignore-words.txt @@ -1,3 +1,4 @@ configury SME Synopsys +aranges diff --git a/gdb/dwarf2/abbrev.c b/gdb/dwarf2/abbrev.c index e3c268e7c47..3aed737838d 100644 --- a/gdb/dwarf2/abbrev.c +++ b/gdb/dwarf2/abbrev.c @@ -82,7 +82,7 @@ abbrev_table::read (struct dwarf2_section_info *section, struct obstack *obstack = &abbrev_table->m_abbrev_obstack; /* Caller must ensure this. */ - gdb_assert (section->readin); + gdb_assert (section->read_in); abbrev_ptr = section->buffer + to_underlying (sect_off); while (true) diff --git a/gdb/dwarf2/aranges.c b/gdb/dwarf2/aranges.c index fec15cdd7cc..59cd9fdec9f 100644 --- a/gdb/dwarf2/aranges.c +++ b/gdb/dwarf2/aranges.c @@ -30,7 +30,7 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile, deferred_warnings *warn) { /* Caller must ensure that the section has already been read. */ - gdb_assert (section->readin); + gdb_assert (section->read_in); if (section->empty ()) return false; diff --git a/gdb/dwarf2/cooked-index-shard.c b/gdb/dwarf2/cooked-index-shard.c index 58a02316e63..2a0dbdb9969 100644 --- a/gdb/dwarf2/cooked-index-shard.c +++ b/gdb/dwarf2/cooked-index-shard.c @@ -293,7 +293,7 @@ cooked_index_shard::finalize (const parent_map_map *parent_maps) } else { - /* An entry with that name was present, re-use its canonical + /* An entry with that name was present, reuse its canonical name. */ entry->canonical = (*it)->canonical; } diff --git a/gdb/dwarf2/dwz.c b/gdb/dwarf2/dwz.c index 1aa0d035d22..d6bd6a5ccb6 100644 --- a/gdb/dwarf2/dwz.c +++ b/gdb/dwarf2/dwz.c @@ -37,7 +37,7 @@ dwz_file::read_string (struct objfile *objfile, LONGEST str_offset) { /* This must be true because the sections are read in when the dwz_file is created. */ - gdb_assert (str.readin); + gdb_assert (str.read_in); if (str.buffer == NULL) error (_("supplementary DWARF file missing .debug_str " diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index dd77be5310e..175f1a03a94 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -876,7 +876,7 @@ private: explicit debug_str_lookup (dwarf2_per_bfd *per_bfd) : m_per_bfd (per_bfd) { - gdb_assert (per_bfd->str.readin); + gdb_assert (per_bfd->str.read_in); const gdb_byte *data = per_bfd->str.buffer; if (data == nullptr) return; diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c index 69a8a87b257..df35adec70b 100644 --- a/gdb/dwarf2/read-gdb-index.c +++ b/gdb/dwarf2/read-gdb-index.c @@ -626,7 +626,7 @@ create_addrmap_from_gdb_index (dwarf2_per_objfile *per_objfile, return false; }; - /* Cache the section for possible re-use on the next entry. */ + /* Cache the section for possible reuse on the next entry. */ struct obj_section *prev_sect = nullptr; const gdb_byte *iter = index->address_table.data (); diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index d9cc5b9f98f..162c0bd57bb 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -2396,7 +2396,7 @@ dwarf2_initialize_objfile (struct objfile *objfile, /* Was a GDB index already read when we processed an objfile sharing PER_BFD? */ else if (per_bfd->index_table != nullptr) - dwarf_read_debug_printf ("re-using symbols"); + dwarf_read_debug_printf ("reusing symbols"); else if (dwarf2_read_debug_names (per_objfile)) dwarf_read_debug_printf ("found debug names"); else if (dwarf2_read_gdb_index (per_objfile, @@ -2707,7 +2707,7 @@ cutu_reader::init_cu_die_reader (dwarf2_cu *cu, dwarf2_section_info *section, struct dwo_file *dwo_file, const struct abbrev_table *abbrev_table) { - gdb_assert (section->readin && section->buffer != NULL); + gdb_assert (section->read_in && section->buffer != NULL); m_abfd = section->get_bfd_owner (); m_cu = cu; m_dwo_file = dwo_file; @@ -7149,8 +7149,8 @@ create_dwp_v2_or_v5_section (dwarf2_per_bfd *per_bfd, result.virtual_offset = offset; result.size = size; - gdb_assert (section->readin); - result.readin = true; + gdb_assert (section->read_in); + result.read_in = true; result.buffer = section->buffer + offset; return result; } @@ -7733,7 +7733,7 @@ cutu_reader::locate_dwo_sections (objfile *objfile, dwo_file &dwo_file) { /* Make sure we don't overwrite a section info that has been filled in already. */ - gdb_assert (!dw_sect->readin); + gdb_assert (!dw_sect->read_in); dw_sect->s.section = sec; dw_sect->size = bfd_section_size (sec); @@ -7810,7 +7810,7 @@ dwarf2_locate_common_dwp_sections (struct objfile *objfile, bfd *abfd, { /* Make sure we don't overwrite a section info that has been filled in already. */ - gdb_assert (!dw_sect->readin); + gdb_assert (!dw_sect->read_in); dw_sect->s.section = sectp; dw_sect->size = bfd_section_size (sectp); @@ -7859,7 +7859,7 @@ dwarf2_locate_v2_dwp_sections (struct objfile *objfile, bfd *abfd, { /* Make sure we don't overwrite a section info that has been filled in already. */ - gdb_assert (!dw_sect->readin); + gdb_assert (!dw_sect->read_in); dw_sect->s.section = sectp; dw_sect->size = bfd_section_size (sectp); @@ -7906,7 +7906,7 @@ dwarf2_locate_v5_dwp_sections (struct objfile *objfile, bfd *abfd, { /* Make sure we don't overwrite a section info that has been filled in already. */ - gdb_assert (!dw_sect->readin); + gdb_assert (!dw_sect->read_in); dw_sect->s.section = sectp; dw_sect->size = bfd_section_size (sectp); @@ -11701,11 +11701,11 @@ die_byte_order (die_info *die, dwarf2_cu *cu, enum bfd_endian *byte_order) attribute *attr = dwarf2_attr (die, DW_AT_endianity, cu); if (attr != nullptr && attr->form_is_constant ()) { - std::optional endianity = attr->unsigned_constant (); + std::optional endianness = attr->unsigned_constant (); - if (endianity.has_value ()) + if (endianness.has_value ()) { - switch (*endianity) + switch (*endianness) { case DW_END_default: /* Nothing. */ @@ -11718,7 +11718,7 @@ die_byte_order (die_info *die, dwarf2_cu *cu, enum bfd_endian *byte_order) break; default: complaint (_("DW_AT_endianity has unrecognized value %s"), - pulongest (*endianity)); + pulongest (*endianness)); break; } } diff --git a/gdb/dwarf2/section.c b/gdb/dwarf2/section.c index 0a790f43fc3..31d0ad7b36a 100644 --- a/gdb/dwarf2/section.c +++ b/gdb/dwarf2/section.c @@ -122,10 +122,10 @@ dwarf2_section_info::read (struct objfile *objfile) bfd *abfd; gdb_byte *buf, *retbuf; - if (readin) + if (read_in) return; buffer = NULL; - readin = true; + read_in = true; if (empty ()) return; diff --git a/gdb/dwarf2/section.h b/gdb/dwarf2/section.h index fbdb025dda8..ca511a4e88e 100644 --- a/gdb/dwarf2/section.h +++ b/gdb/dwarf2/section.h @@ -30,7 +30,7 @@ /* A descriptor for dwarf sections. S.ASECTION, SIZE are typically initialized when the objfile is first - scanned. BUFFER, READIN are filled in later when the section is read. + scanned. BUFFER, READ_IN are filled in later when the section is read. If the section contained compressed data then SIZE is updated to record the uncompressed size of the section. @@ -100,7 +100,7 @@ struct dwarf2_section_info section. */ struct dwarf2_section_info *containing_section; } s; - /* Pointer to section data, only valid if readin. */ + /* Pointer to section data, only valid if read_in. */ const gdb_byte *buffer; /* The size of the section, real or virtual. */ bfd_size_type size; @@ -108,7 +108,7 @@ struct dwarf2_section_info Only valid if is_virtual. */ bfd_size_type virtual_offset; /* True if we have tried to read this section. */ - bool readin; + bool read_in; /* True if this is a virtual section, False otherwise. This specifies which of s.section and s.containing_section to use. */ bool is_virtual;