asymbol **symbol_table = NULL, **dyn_symbol_table = NULL;
asymbol *synthsyms;
- if (symtab_create_debug)
- {
- gdb_printf (gdb_stdlog,
- "Reading minimal symbols of objfile %s ...\n",
- objfile_name (objfile));
- }
+ symtab_create_debug_printf ("reading minimal symbols of objfile %s",
+ objfile_name (objfile));
/* If we already have minsyms, then we can skip some work here.
However, if there were stabs or mdebug sections, we go ahead and
&& ei->mdebugsect == NULL
&& ei->ctfsect == NULL)
{
- if (symtab_create_debug)
- gdb_printf (gdb_stdlog,
- "... minimal symbols previously read\n");
+ symtab_create_debug_printf ("minimal symbols were previously read");
return;
}
reader.install ();
- if (symtab_create_debug)
- gdb_printf (gdb_stdlog, "Done reading minimal symbols.\n");
+ symtab_create_debug_printf ("done reading minimal symbols");
}
/* Scan and build partial symbols for a symbol file.
if (ms_type == mst_file_text && startswith (name, "__gnu_compiled"))
return (NULL);
- if (symtab_create_debug >= 2)
- gdb_printf (gdb_stdlog,
- "Recording minsym: %-21s %18s %4d %.*s\n",
- mst_str (ms_type), hex_string (address), section,
- (int) name.size (), name.data ());
+ symtab_create_debug_printf_v ("recording minsym: %-21s %18s %4d %.*s",
+ mst_str (ms_type), hex_string (address), section,
+ (int) name.size (), name.data ());
if (m_msym_bunch_index == BUNCH_SIZE)
{
if (m_msym_count > 0)
{
- if (symtab_create_debug)
- {
- gdb_printf (gdb_stdlog,
- "Installing %d minimal symbols of objfile %s.\n",
- m_msym_count, objfile_name (m_objfile));
- }
+ symtab_create_debug_printf ("installing %d minimal symbols of objfile %s",
+ m_msym_count, objfile_name (m_objfile));
/* Allocate enough space, into which we will gather the bunches
of new and existing minimal symbols, sort them, and then
filename = objfile_per_bfd->intern (filename_);
- if (symtab_create_debug)
+ if (symtab_create_debug >= 1)
{
/* Be a bit clever with debugging messages, and don't print objfile
every time, only when it changes. */
if (last_bfd_name.empty () || last_bfd_name != this_bfd_name)
{
last_bfd_name = this_bfd_name;
- gdb_printf (gdb_stdlog,
- "Creating one or more psymtabs for %s ...\n",
- this_bfd_name);
+
+ symtab_create_debug_printf ("creating one or more psymtabs for %s",
+ this_bfd_name);
}
- gdb_printf (gdb_stdlog,
- "Created psymtab %s for module %s.\n",
- host_address_to_string (this), filename);
+
+ symtab_create_debug_printf ("created psymtab %s for module %s",
+ host_address_to_string (this), filename);
}
}
if (last_objfile_name.empty () || last_objfile_name != this_objfile_name)
{
last_objfile_name = this_objfile_name;
- gdb_printf (gdb_stdlog,
- "Creating one or more symtabs for objfile %s ...\n",
- this_objfile_name);
+
+ symtab_create_debug_printf_v
+ ("creating one or more symtabs for objfile %s", this_objfile_name);
}
- gdb_printf (gdb_stdlog,
- "Created symtab %s for module %s.\n",
- host_address_to_string (symtab), filename);
+
+ symtab_create_debug_printf_v ("created symtab %s for module %s",
+ host_address_to_string (symtab), filename);
}
/* Add it to CUST's list of symtabs. */
cu->set_debugformat ("unknown");
- if (symtab_create_debug)
- {
- gdb_printf (gdb_stdlog,
- "Created compunit symtab %s for %s.\n",
- host_address_to_string (cu),
- cu->name);
- }
+ symtab_create_debug_printf_v ("created compunit symtab %s for %s",
+ host_address_to_string (cu),
+ cu->name);
return cu;
}
extern unsigned int symtab_create_debug;
+/* Print a "symtab-create" debug statement. */
+
+#define symtab_create_debug_printf(fmt, ...) \
+ debug_prefixed_printf_cond (symtab_create_debug >= 1, "symtab-create", fmt, ##__VA_ARGS__)
+
+/* Print a verbose "symtab-create" debug statement, only if
+ "set debug symtab-create" is set to 2 or higher. */
+
+#define symtab_create_debug_printf_v(fmt, ...) \
+ debug_prefixed_printf_cond (symtab_create_debug >= 2, "symtab-create", fmt, ##__VA_ARGS__)
+
extern unsigned int symbol_lookup_debug;
extern bool basenames_may_differ;