const uint8_t offset_size = dwarf5_is_dwarf64 ? 8 : 4;
if (addr + entry_length > section->buffer + section->size)
{
- warn->warn (_("Section .debug_aranges in %s entry at offset %s "
+ warn->warn (_("Section .debug_aranges in %ps entry at offset %s "
"length %s exceeds section length %s, "
"ignoring .debug_aranges."),
- objfile_name (objfile),
+ styled_string (file_name_style.style (),
+ objfile_name (objfile)),
plongest (entry_addr - section->buffer),
plongest (bytes_read + entry_length),
pulongest (section->size));
if (version != 2)
{
warn->warn
- (_("Section .debug_aranges in %s entry at offset %s "
+ (_("Section .debug_aranges in %ps entry at offset %s "
"has unsupported version %d, ignoring .debug_aranges."),
- objfile_name (objfile),
+ styled_string (file_name_style.style (),
+ objfile_name (objfile)),
plongest (entry_addr - section->buffer), version);
return false;
}
= debug_info_offset_to_per_cu.find (sect_offset (debug_info_offset));
if (per_cu_it == debug_info_offset_to_per_cu.cend ())
{
- warn->warn (_("Section .debug_aranges in %s entry at offset %s "
+ warn->warn (_("Section .debug_aranges in %ps entry at offset %s "
"debug_info_offset %s does not exists, "
"ignoring .debug_aranges."),
- objfile_name (objfile),
+ styled_string (file_name_style.style (),
+ objfile_name (objfile)),
plongest (entry_addr - section->buffer),
pulongest (debug_info_offset));
return false;
= debug_info_offset_seen.insert (sect_offset (debug_info_offset));
if (!insertpair.second)
{
- warn->warn (_("Section .debug_aranges in %s has duplicate "
+ warn->warn (_("Section .debug_aranges in %ps has duplicate "
"debug_info_offset %s, ignoring .debug_aranges."),
- objfile_name (objfile),
+ styled_string (file_name_style.style (),
+ objfile_name (objfile)),
sect_offset_str (sect_offset (debug_info_offset)));
return false;
}
if (address_size < 1 || address_size > 8)
{
warn->warn
- (_("Section .debug_aranges in %s entry at offset %s "
+ (_("Section .debug_aranges in %ps entry at offset %s "
"address_size %u is invalid, ignoring .debug_aranges."),
- objfile_name (objfile),
+ styled_string (file_name_style.style (),
+ objfile_name (objfile)),
plongest (entry_addr - section->buffer), address_size);
return false;
}
const uint8_t segment_selector_size = *addr++;
if (segment_selector_size != 0)
{
- warn->warn (_("Section .debug_aranges in %s entry at offset %s "
+ warn->warn (_("Section .debug_aranges in %ps entry at offset %s "
"segment_selector_size %u is not supported, "
"ignoring .debug_aranges."),
- objfile_name (objfile),
+ styled_string (file_name_style.style (),
+ objfile_name (objfile)),
plongest (entry_addr - section->buffer),
segment_selector_size);
return false;
{
if (addr + 2 * address_size > entry_end)
{
- warn->warn (_("Section .debug_aranges in %s entry at offset %s "
+ warn->warn (_("Section .debug_aranges in %ps entry at offset %s "
"address list is not properly terminated, "
"ignoring .debug_aranges."),
- objfile_name (objfile),
+ styled_string (file_name_style.style (),
+ objfile_name (objfile)),
plongest (entry_addr - section->buffer));
return false;
}
#include "gdbsupport/pathstuff.h"
#include "gdbsupport/scoped_fd.h"
#include "run-on-main-thread.h"
+#include "cli/cli-style.h"
const char *
dwz_file::read_string (struct objfile *objfile, LONGEST str_offset)
dwz_bfd = gdb_bfd_open (alt_filename.get (), gnutarget);
if (dwz_bfd == nullptr)
- warning (_("File \"%s\" from debuginfod cannot be opened as bfd"),
- alt_filename.get ());
+ warning (_("File \"%ps\" from debuginfod cannot be opened as bfd"),
+ styled_string (file_name_style.style (),
+ alt_filename.get ()));
else if (!verify_id (dwz_bfd.get (), buildid_len, buildid.get (),
dwarf5))
dwz_bfd.reset (nullptr);
#include "record.h"
#include "extract-store-integer.h"
#include "producer.h"
+#include "cli/cli-style.h"
#include "complaints.h"
#include "dwarf2/frame.h"
catch (const gdb_exception_error &e)
{
- warning (_("skipping .eh_frame info of %s: %s"),
- objfile_name (objfile), e.what ());
+ warning (_("skipping .eh_frame info of %ps: %s"),
+ styled_string (file_name_style.style (),
+ objfile_name (objfile)),
+ e.what ());
fde_table.clear ();
/* The cie_table is discarded below. */
}
catch (const gdb_exception_error &e)
{
- warning (_("skipping .debug_frame info of %s: %s"),
- objfile_name (objfile), e.what ());
+ warning (_("skipping .debug_frame info of %ps: %s"),
+ styled_string (file_name_style.style (),
+ objfile_name (objfile)),
+ e.what ());
fde_table.resize (num_old_fde_entries);
}
#include "stringify.h"
#include "extract-store-integer.h"
#include "gdbsupport/thread-pool.h"
+#include "cli/cli-style.h"
/* This is just like cooked_index_functions, but overrides a single
method so the test suite can distinguish the .debug_names case from
default:
/* A warning instead of a complaint, because this one is
more like a bug in gdb. */
- warning (_("Unsupported .debug_names form %s [in module %s].\n"
+ warning (_("Unsupported .debug_names form %s [in module %ps].\n"
"This normally should not happen, please file a bug report."),
dwarf_form_name (attr.form),
- bfd_get_filename (abfd));
+ styled_string (file_name_style.style (),
+ bfd_get_filename (abfd)));
return nullptr;
}
switch (attr.dw_idx)
if (bytes_read + length != section->size)
{
/* There may be multiple per-CU indices. */
- warning (_("Section .debug_names in %s length %s does not match "
+ warning (_("Section .debug_names in %ps length %s does not match "
"section length %s, ignoring .debug_names."),
- filename, plongest (bytes_read + length),
+ styled_string (file_name_style.style (),
+ filename),
+ plongest (bytes_read + length),
pulongest (section->size));
return false;
}
addr += 2;
if (version != 5)
{
- warning (_("Section .debug_names in %s has unsupported version %d, "
+ warning (_("Section .debug_names in %ps has unsupported version %d, "
"ignoring .debug_names."),
- filename, version);
+ styled_string (file_name_style.style (),
+ filename),
+ version);
return false;
}
addr += 2;
if (padding != 0)
{
- warning (_("Section .debug_names in %s has unsupported padding %d, "
+ warning (_("Section .debug_names in %ps has unsupported padding %d, "
"ignoring .debug_names."),
- filename, padding);
+ styled_string (file_name_style.style (),
+ filename),
+ padding);
return false;
}
addr += 4;
if (foreign_tu_count != 0)
{
- warning (_("Section .debug_names in %s has unsupported %lu foreign TUs, "
+ warning (_("Section .debug_names in %ps has unsupported %lu foreign TUs, "
"ignoring .debug_names."),
- filename, static_cast<unsigned long> (foreign_tu_count));
+ styled_string (file_name_style.style (),
+ filename),
+ static_cast<unsigned long> (foreign_tu_count));
return false;
}
= map.abbrev_map.emplace (index_num, mapped_debug_names_reader::index_val ());
if (!insertpair.second)
{
- warning (_("Section .debug_names in %s has duplicate index %s, "
+ warning (_("Section .debug_names in %ps has duplicate index %s, "
"ignoring .debug_names."),
- filename, pulongest (index_num));
+ styled_string (file_name_style.style (),
+ filename),
+ pulongest (index_num));
return false;
}
mapped_debug_names_reader::index_val &indexval = insertpair.first->second;
}
if (addr != abbrev_table_start + abbrev_table_size)
{
- warning (_("Section .debug_names in %s has abbreviation_table "
+ warning (_("Section .debug_names in %ps has abbreviation_table "
"of size %s vs. written as %u, ignoring .debug_names."),
- filename, plongest (addr - abbrev_table_start),
+ styled_string (file_name_style.style (),
+ filename),
+ plongest (addr - abbrev_table_start),
abbrev_table_size);
return false;
}
bfd_get_filename (dwz->dwz_bfd.get ()),
&dwz->debug_names, dwz_map))
{
- warning (_("could not read '.debug_names' section from %s; skipping"),
- bfd_get_filename (dwz->dwz_bfd.get ()));
+ warning (_("could not read '.debug_names' section from %ps; skipping"),
+ styled_string (file_name_style.style (),
+ bfd_get_filename (dwz->dwz_bfd.get ())));
return false;
}
}
#include "extract-store-integer.h"
#include "cp-support.h"
#include "symtab.h"
+#include "cli/cli-style.h"
/* When true, do not reject deprecated .gdb_index sections. */
static bool use_deprecated_index_sections = false;
static int warning_printed = 0;
if (!warning_printed)
{
- warning (_("Skipping obsolete .gdb_index section in %s."),
- filename);
+ warning (_("Skipping obsolete .gdb_index section in %ps."),
+ styled_string (file_name_style.style (),
+ filename));
warning_printed = 1;
}
return 0;
&dwz_types_ignore,
&dwz_types_elements_ignore))
{
- warning (_("could not read '.gdb_index' section from %s; skipping"),
- dwz->filename ());
+ warning (_("could not read '.gdb_index' section from %ps; skipping"),
+ styled_string (file_name_style.style (),
+ dwz->filename ()));
return false;
}
}
#include "dwarf2/error.h"
#include "gdbsupport/unordered_set.h"
#include "extract-store-integer.h"
+#include "cli/cli-style.h"
/* When == 1, print basic high level tracing messages.
When > 1, be more verbose.
{
bfd_size_type size = sectp->size;
warning (_("Discarding section %s which has an invalid size (%s) "
- "[in module %s]"),
+ "[in module %ps]"),
bfd_section_name (sectp), phex_nz (size),
- this->filename ());
+ styled_string (file_name_style.style (),
+ this->filename ()));
}
else if (names.info.matches (sectp->name))
{
else
{
warning (_("Multiple .debug_macro.dwo sections found in "
- "%s, ignoring them."), dwo_file.dbfd->filename);
+ "%ps, ignoring them."),
+ styled_string (file_name_style.style (),
+ dwo_file.dbfd->filename));
dwo_sections.macro = dwarf2_section_info {};
complained_about_macro_already = true;
lbasename (dwp_file->name));
warning (_("Could not find DWO %s %s(%s)%s referenced by %s at offset %s"
- " [in module %s]"),
+ " [in module %ps]"),
kind, dwo_name, hex_string (signature), dwp_text.c_str (), kind,
- sect_offset_str (cu->per_cu->sect_off ()), objfile_name (objfile));
+ sect_offset_str (cu->per_cu->sect_off ()),
+ styled_string (file_name_style.style (),
+ objfile_name (objfile)));
}
return NULL;
}