Use symbol_set_language to set a symbol's language
authorChristian Biesinger <cbiesinger@google.com>
Sat, 14 Dec 2019 20:47:22 +0000 (15:47 -0500)
committerChristian Biesinger <cbiesinger@google.com>
Mon, 16 Dec 2019 06:39:50 +0000 (00:39 -0600)
Instead of using SYMBOL_LANGUAGE (sym) = foo.

Having only a single way to set a symbol's language is clearer and this
is also a requirement for making set_language a member function.

gdb/ChangeLog:

2019-12-15  Christian Biesinger  <cbiesinger@google.com>

* ada-exp.y (write_ambiguous_var): Call symbol_set_language to
set the language of sym.
* language.c (language_alloc_type_symbol): Likewise.

Change-Id: I85338ea2e4121155f2da222fe0aa6b7d3ffe26f7

gdb/ChangeLog
gdb/ada-exp.y
gdb/language.c

index 1a452be1756109f1c8787de7e9ad75cb937c2bf0..8cc1c6b594847f547ead22895d4e7a1757858c22 100644 (file)
@@ -1,3 +1,9 @@
+2019-12-15  Christian Biesinger  <cbiesinger@google.com>
+
+       * ada-exp.y (write_ambiguous_var): Call symbol_set_language to
+       set the language of sym.
+       * language.c (language_alloc_type_symbol): Likewise.
+
 2019-12-14  Sergio Durigan Junior  <sergiodj@redhat.com>
 
        https://bugzilla.redhat.com/show_bug.cgi?id=1728147
index 00020cd0677b1aa241b9dd2feb474508cb1f8ad1..6b1bdfa139cd1340704c7fef48b2629f2e3838dd 100644 (file)
@@ -1106,7 +1106,7 @@ write_ambiguous_var (struct parser_state *par_state,
 
   SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN;
   sym->set_linkage_name (obstack_strndup (&temp_parse_space, name, len));
-  SYMBOL_LANGUAGE (sym) = language_ada;
+  symbol_set_language (sym, language_ada, nullptr);
 
   write_exp_elt_opcode (par_state, OP_VAR_VALUE);
   write_exp_elt_block (par_state, block);
index 6ab0ca323d20e2afa5a6f1ab2be56d60b8028779..ed850350b17694a76b9344d0c8ae54aef492bd17 100644 (file)
@@ -1051,7 +1051,7 @@ language_alloc_type_symbol (enum language lang, struct type *type)
   symbol = new (gdbarch_obstack (gdbarch)) struct symbol ();
 
   symbol->name = TYPE_NAME (type);
-  symbol->language = lang;
+  symbol_set_language (symbol, lang, nullptr);
   symbol->owner.arch = gdbarch;
   SYMBOL_OBJFILE_OWNED (symbol) = 0;
   SYMBOL_TYPE (symbol) = type;
This page took 0.031086 seconds and 4 git commands to generate.