aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-11-17 11:04:08 -0700
committerTom Tromey <tom@tromey.com>2023-11-17 11:06:34 -0700
commit4a2530397b87c66bd45b21cf20e2cc12bf26879f (patch)
treea189959ed114de99caae5a08ab14021113aada32 /gdb/dwarf2
parent5070b0e66c56eff4e197721c884760030df76822 (diff)
downloadgdb-4a2530397b87c66bd45b21cf20e2cc12bf26879f.zip
gdb-4a2530397b87c66bd45b21cf20e2cc12bf26879f.tar.gz
gdb-4a2530397b87c66bd45b21cf20e2cc12bf26879f.tar.bz2
Remove extraneous blocks from dwarf2/read.c:new_symbol
dwarf2/read.c:new_symbol has some extra braces in a couple of 'case's. These read weirdly to me, and since they aren't necessary, this patch removes the braces and reindents the bodies. Tested by rebuilding.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/read.c84
1 files changed, 41 insertions, 43 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 7a3b9c6..e8ff4d8 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -19212,39 +19212,38 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
sym->set_aclass_index (LOC_TYPEDEF);
sym->set_domain (STRUCT_DOMAIN);
}
- {
- /* NOTE: carlton/2003-11-10: C++ class symbols shouldn't
- really ever be static objects: otherwise, if you try
- to, say, break of a class's method and you're in a file
- which doesn't mention that class, it won't work unless
- the check for all static symbols in lookup_symbol_aux
- saves you. See the OtherFileClass tests in
- gdb.c++/namespace.exp. */
-
- if (!suppress_add)
- {
- buildsym_compunit *builder = cu->get_builder ();
- list_to_add
- = (cu->list_in_scope == builder->get_file_symbols ()
- && cu->lang () == language_cplus
- ? builder->get_global_symbols ()
- : cu->list_in_scope);
-
- /* The semantics of C++ state that "struct foo {
- ... }" also defines a typedef for "foo". */
- if (cu->lang () == language_cplus
- || cu->lang () == language_ada
- || cu->lang () == language_d
- || cu->lang () == language_rust)
- {
- /* The symbol's name is already allocated along
- with this objfile, so we don't need to
- duplicate it for the type. */
- if (sym->type ()->name () == 0)
- sym->type ()->set_name (sym->search_name ());
- }
- }
- }
+
+ /* NOTE: carlton/2003-11-10: C++ class symbols shouldn't
+ really ever be static objects: otherwise, if you try
+ to, say, break of a class's method and you're in a file
+ which doesn't mention that class, it won't work unless
+ the check for all static symbols in lookup_symbol_aux
+ saves you. See the OtherFileClass tests in
+ gdb.c++/namespace.exp. */
+
+ if (!suppress_add)
+ {
+ buildsym_compunit *builder = cu->get_builder ();
+ list_to_add
+ = (cu->list_in_scope == builder->get_file_symbols ()
+ && cu->lang () == language_cplus
+ ? builder->get_global_symbols ()
+ : cu->list_in_scope);
+
+ /* The semantics of C++ state that "struct foo {
+ ... }" also defines a typedef for "foo". */
+ if (cu->lang () == language_cplus
+ || cu->lang () == language_ada
+ || cu->lang () == language_d
+ || cu->lang () == language_rust)
+ {
+ /* The symbol's name is already allocated along
+ with this objfile, so we don't need to
+ duplicate it for the type. */
+ if (sym->type ()->name () == 0)
+ sym->type ()->set_name (sym->search_name ());
+ }
+ }
break;
case DW_TAG_unspecified_type:
if (cu->lang () == language_ada)
@@ -19265,16 +19264,15 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
{
dwarf2_const_value (attr, sym, cu);
}
- {
- /* NOTE: carlton/2003-11-10: See comment above in the
- DW_TAG_class_type, etc. block. */
-
- list_to_add
- = (cu->list_in_scope == cu->get_builder ()->get_file_symbols ()
- && cu->lang () == language_cplus
- ? cu->get_builder ()->get_global_symbols ()
- : cu->list_in_scope);
- }
+
+ /* NOTE: carlton/2003-11-10: See comment above in the
+ DW_TAG_class_type, etc. block. */
+
+ list_to_add
+ = (cu->list_in_scope == cu->get_builder ()->get_file_symbols ()
+ && cu->lang () == language_cplus
+ ? cu->get_builder ()->get_global_symbols ()
+ : cu->list_in_scope);
break;
case DW_TAG_imported_declaration:
case DW_TAG_namespace: