From 938459015cab4c4bc4965c78c62672b4f18d1d1b Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 20 Oct 2023 11:56:49 +0200 Subject: [PATCH] [gdb/symtab] Fix more style issues in v9 .gdb_index section support I noticed a few more style issues in commit 8b9c08eddac ("[gdb/symtab] Add name_of_main and language_of_main to the DWARF index"), after checking it with gcc's check_GNU_style.{sh,py}. Fix these. Build on x86_64-linux. --- gdb/NEWS | 2 +- gdb/dwarf2/index-write.c | 2 +- gdb/dwarf2/read-gdb-index.c | 8 ++++---- gdb/dwarf2/read.c | 2 +- gdb/dwarf2/read.h | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gdb/NEWS b/gdb/NEWS index 08d779010f0..30b8cadf825 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -3,7 +3,7 @@ *** Changes since GDB 14 -* GDB index now contains information about the main function. This speeds up +* GDB index now contains information about the main function. This speeds up startup when it is being used for some large binaries. * Python API diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index 8c87f053da6..9c1f4013760 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -1193,7 +1193,7 @@ write_cooked_index (cooked_index *table, } } -/* Write shortcut information. */ +/* Write shortcut information. */ static void write_shortcuts_table (cooked_index *table, data_buf &shortcuts, diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c index 34c5dfd5803..e789e9c2654 100644 --- a/gdb/dwarf2/read-gdb-index.c +++ b/gdb/dwarf2/read-gdb-index.c @@ -88,7 +88,7 @@ struct mapped_gdb_index final : public mapped_index_base /* A pointer to the constant pool. */ gdb::array_view constant_pool; - /* The shortcut table data. */ + /* The shortcut table data. */ gdb::array_view shortcut_table; /* Return the index into the constant pool of the name of the IDXth @@ -771,7 +771,7 @@ create_addrmap_from_gdb_index (dwarf2_per_objfile *per_objfile, = new (&per_bfd->obstack) addrmap_fixed (&per_bfd->obstack, &mutable_map); } -/* Sets the name and language of the main function from the shortcut table. */ +/* Sets the name and language of the main function from the shortcut table. */ static void set_main_name_from_gdb_index (dwarf2_per_objfile *per_objfile, @@ -780,7 +780,7 @@ set_main_name_from_gdb_index (dwarf2_per_objfile *per_objfile, const auto expected_size = 2 * sizeof (offset_type); if (index->shortcut_table.size () < expected_size) /* The data in the section is not present, is corrupted or is in a version - we don't know about. Regardless, we can't make use of it. */ + we don't know about. Regardless, we can't make use of it. */ return; auto ptr = index->shortcut_table.data (); @@ -794,7 +794,7 @@ set_main_name_from_gdb_index (dwarf2_per_objfile *per_objfile, if (dw_lang == 0) { /* Don't bother if the language for the main symbol was not known or if - there was no main symbol at all when the index was built. */ + there was no main symbol at all when the index was built. */ return; } ptr += 4; diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 36c1d9f4cd6..ea0b2328a3e 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -17819,7 +17819,7 @@ leb128_size (const gdb_byte *buf) } } -/* Converts DWARF language names to GDB language names. */ +/* Converts DWARF language names to GDB language names. */ enum language dwarf_lang_to_enum_language (unsigned int lang) diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index 62a40d17648..96f38a9bbcb 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -184,7 +184,7 @@ private: std::atomic> m_lang {language_unknown}; /* The original DW_LANG_* value of the CU, as provided to us by - DW_AT_language. It is interesting to keep this value around in cases where + DW_AT_language. It is interesting to keep this value around in cases where we can't use the values from the language enum, as the mapping to them is lossy, and, while that is usually fine, things like the index have an understandable bias towards not exposing internal GDB structures to the @@ -769,7 +769,7 @@ private: std::unique_ptr> m_dwarf2_cus; }; -/* Converts DWARF language names to GDB language names. */ +/* Converts DWARF language names to GDB language names. */ enum language dwarf_lang_to_enum_language (unsigned int lang); -- 2.30.2