we created the subfile, and we may have altered our
opinion of what language it is from things we found in
the symbols. */
- symtab->language = subfile->language;
+ symtab->set_language (subfile->language);
}
/* Make sure the filetab of main_subfile is the primary filetab of the CU. */
compilation is from a C file generated by language preprocessors, do
not set the language if it was already deduced by start_subfile. */
if (!(cu->per_cu->lang == language_c
- && cust->primary_filetab ()->language != language_unknown))
- cust->primary_filetab ()->language = cu->per_cu->lang;
+ && cust->primary_filetab ()->language () != language_unknown))
+ cust->primary_filetab ()->set_language (cu->per_cu->lang);
/* GCC-4.0 has started to support -fvar-tracking. GCC-3.x still can
produce DW_AT_location with location lists but it can be possibly
do not set the language if it was already deduced by
start_subfile. */
if (!(cu->per_cu->lang == language_c
- && cust->primary_filetab ()->language != language_c))
- cust->primary_filetab ()->language = cu->per_cu->lang;
+ && cust->primary_filetab ()->language () != language_c))
+ cust->primary_filetab ()->set_language (cu->per_cu->lang);
}
}
else
which we don't have debug info. Check for a minimal symbol in
this case. */
if (prev_len == info->result.symbols->size ()
- && elt->language == language_asm)
+ && elt->language () == language_asm)
search_minsyms_for_name (info, lookup_name, pspace, elt);
}
}
/* The proper language was already determined when building
the psymtab, use it. */
- cust->primary_filetab ()->language = PST_PRIVATE (pst)->pst_language;
+ cust->primary_filetab ()->set_language
+ (PST_PRIVATE (pst)->pst_language);
}
- psymtab_language = cust->primary_filetab ()->language;
+ psymtab_language = cust->primary_filetab ()->language ();
lines = cust->primary_filetab ()->linetable ();
{
#ifdef HAVE_SOURCE_HIGHLIGHT
bool already_styled = false;
- const char *lang_name = get_language_name (SYMTAB_LANGUAGE (s));
+ const char *lang_name = get_language_name (s->language ());
if (lang_name != nullptr && use_gnu_source_highlight)
{
/* The global source highlight object, or null if one was
printf_filtered (_("Contains %d line%s.\n"), (int) offsets->size (),
offsets->size () == 1 ? "" : "s");
- printf_filtered (_("Source language is %s.\n"), language_str (s->language));
+ printf_filtered (_("Source language is %s.\n"),
+ language_str (s->language ()));
printf_filtered (_("Producer is %s.\n"),
(cust->producer ()) != nullptr
? cust->producer () : _("unknown"));
if (s)
printf_filtered (" source language %s.\n",
- language_str (s->language));
+ language_str (s->language ()));
{
/* Address of the argument list for this frame, or 0. */
symtab->filename = objfile->intern (filename);
symtab->fullname = NULL;
- symtab->language = deduce_language_from_filename (filename);
+ symtab->set_language (deduce_language_from_filename (filename));
/* This can be very verbose with lots of headers.
Only print at higher debug levels. */
objfile_name (objfile),
host_address_to_string (objfile));
fprintf_filtered (outfile, "Language: %s\n",
- language_str (symtab->language));
+ language_str (symtab->language ()));
/* First print the line table. */
l = symtab->linetable ();
because certain routines used during dump_symtab() use the current
language to print an image of the symbol. We'll restore it later.
But use only real languages, not placeholders. */
- if (symtab->language != language_unknown
- && symtab->language != language_auto)
+ if (symtab->language () != language_unknown
+ && symtab->language () != language_auto)
{
scoped_restore_current_language save_lang;
- set_language (symtab->language);
+ set_language (symtab->language ());
dump_symtab_1 (symtab, outfile);
}
else
/* The language of the compunit symtab is the language of its primary
source file. */
- return SYMTAB_LANGUAGE (symtab);
+ return symtab->language ();
}
/* See symtab.h. */
if (funfirstline && sal.symtab != NULL
&& (sal.symtab->compunit ()->locations_valid ()
- || SYMTAB_LANGUAGE (sal.symtab) == language_asm))
+ || sal.symtab->language () == language_asm))
{
struct gdbarch *gdbarch = SYMTAB_OBJFILE (sal.symtab)->arch ();
is likely to be the wrong choice. */
if (sal->symtab != nullptr
&& sal->explicit_line
- && SYMTAB_LANGUAGE (sal->symtab) == language_asm)
+ && sal->symtab->language () == language_asm)
return;
scoped_restore_current_pspace_and_thread restore_pspace_thread;
The GNU assembler emits separate line notes for each instruction
in a multi-instruction macro, but compilers generally will not
do this. */
- if (prologue_sal.symtab->language != language_asm)
+ if (prologue_sal.symtab->language () != language_asm)
{
struct linetable *linetable = prologue_sal.symtab->linetable ();
int idx = 0;
m_linetable = linetable;
}
+ enum language language () const
+ {
+ return m_language;
+ }
+
+ void set_language (enum language language)
+ {
+ m_language = language;
+ }
+
/* Unordered chain of all filetabs in the compunit, with the exception
that the "main" source file is the first entry in the list. */
/* Language of this source file. */
- enum language language;
+ enum language m_language;
/* Full name of file as found by searching the source path.
NULL if not yet known. */
using symtab_range = next_range<symtab>;
-#define SYMTAB_LANGUAGE(symtab) ((symtab)->language)
#define SYMTAB_BLOCKVECTOR(symtab) \
(symtab->compunit ()->blockvector ())
#define SYMTAB_OBJFILE(symtab) \