/* FIXME! Addr and Mainline are not used yet -- this will not work for
shared libraries or add_file! */
+/* ARGSUSED */
void
coff_symfile_read (sf, addr, mainline)
struct sym_fns *sf;
/* Go over the misc symbol bunches and install them in vector. */
- condense_misc_bunches (0);
+ condense_misc_bunches (!mainline);
/* Make a default for file to list. */
select_source_symtab (0); /* FIXME, this might be too slow, see dbxread */
}
-void
-coff_symfile_discard ()
-{
- /* There seems to be nothing to do here. */
-}
-
void
coff_new_init ()
{
{
int val;
+ linetab_offset = offset;
+ linetab_size = size;
+
+ if (size == 0)
+ return 0;
+
if (lseek (chan, offset, 0) < 0)
return -1;
if (val != size)
return -1;
- linetab_offset = offset;
- linetab_size = size;
make_cleanup (free, linetab); /* Be sure it gets de-allocated. */
return 0;
}
Also defines the symbols that represent the values of the type. */
/* Currently assumes it's sizeof (int) and doesn't use length. */
+/* ARGSUSED */
static struct type *
read_enum_type (index, length, lastsym)
int index;
#else /* not TDESC */
"coff", 4,
#endif /* not TDESC */
- coff_new_init, coff_symfile_init,
- coff_symfile_read, coff_symfile_discard
+ coff_new_init, coff_symfile_init, coff_symfile_read,
};
void
/* destructor */
if (type[0] == '_' && type[1] == CPLUS_MARKER && type[2] == '_')
{
- int n = (strlen (type) - 3)*2 + 3 + 2 + 1;
- char *tem = (char *) xmalloc (n);
+ char *tem = (char *) xmalloc ((strlen (type) - 3)*2 + 3 + 2 + 1);
strcpy (tem, type + 3);
strcat (tem, "::~");
strcat (tem, type + 3);
/* static data member */
if (*type != '_' && (p = strchr (type, CPLUS_MARKER)) != NULL)
{
- int n = strlen (type) + 2;
- char *tem = (char *) xmalloc (n);
+ char *tem = (char *) xmalloc (strlen (type) + 2);
memcpy (tem, type, p - type);
strcpy (tem + (p - type), "::");
strcpy (tem + (p - type) + 2, p + 1);
/* virtual table "_vt$" */
if (type[0] == '_' && type[1] == 'v' && type[2] == 't' && type[3] == CPLUS_MARKER)
{
- int n = strlen (type + 4) + 14 + 1;
- char *tem = (char *) xmalloc (n);
+ char *tem = (char *) xmalloc (strlen (type + 4) + 14 + 1);
strcpy (tem, type + 4);
strcat (tem, " virtual table");
return tem;
This file is part of GDB.
-GDB is free software; you can redistribute it and/or modify
+This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
-GDB is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include "defs.h"
struct sym_fns *symtab_fns = NULL;
/* Saves the sym_fns of the current symbol table, so we can call
- the right sym_discard function when we free it. */
+ the right XXX_new_init function when we free it. FIXME. This
+ should be extended to calling the new_init function for each
+ existing symtab or psymtab, since the main symbol file and
+ subsequent added symbol files can have different types. */
static struct sym_fns *symfile_fns;
struct psymbol_allocation_list global_psymbols = {0}, static_psymbols = {0};
+/* Flag for whether user will be reloading symbols multiple times.
+ Defaults to ON for VxWorks, otherwise OFF. */
+
+#ifdef SYMBOL_RELOADING_DEFAULT
+int symbol_reloading = SYMBOL_RELOADING_DEFAULT;
+#else
+int symbol_reloading = 0;
+#endif
+
/* Structure to manage complaints about symbol file contents. */
struct complaint complaint_root[1] = {
(*pst->read_symtab) (pst);
}
- /* Search through list for correct name. */
- for (result = symtab_list; result; result = result->next)
- if (!strcmp (result->filename, pst->filename))
- {
- pst->symtab = result; /* Remember where it was. */
- return result;
- }
-
- return 0;
+ return pst->symtab;
}
/* Process a symbol file, as either the main file or as a dynamically
if (from_tty)
{
- printf_filtered ("Reading symbol data from %s...", name);
+ printf_filtered ("Reading symbols from %s...", name);
wrap_here ("");
fflush (stdout);
}
target_load (arg, from_tty);
}
-/* This function runs the add_syms command of our current target. */
-
-void
-add_symbol_file_command (args, from_tty)
- char *args;
- int from_tty;
-{
- /* Getting new symbols may change our opinion about what is
- frameless. */
- reinit_frame_cache ();
-
- target_add_syms (args, from_tty);
-}
-
-/* This function allows the addition of incrementally linked object files. */
+/* This function allows the addition of incrementally linked object files.
+ It does not modify any state in the target, only in the debugger. */
/* ARGSUSED */
void
-add_syms_addr_command (arg_string, from_tty)
- char* arg_string;
+add_symbol_file_command (arg_string, from_tty)
+ char *arg_string;
int from_tty;
{
char *name;
CORE_ADDR text_addr;
+ /* Getting new symbols may change our opinion about what is
+ frameless. */
+ reinit_frame_cache ();
+
if (arg_string == 0)
error ("add-symbol-file takes a file name and an address");
/* Functions to handle complaints during symbol reading. */
/* How many complaints about a particular thing should be printed before
- we stop whining about it? */
+ we stop whining about it? Default is no whining at all, since so many
+ systems have ill-constructed symbol files. */
-static unsigned stop_whining = 1;
+static unsigned stop_whining = 0;
/* Print a complaint about the input symbols, and link the complaint block
into a chain for later handling. Result is 1 if the complaint was
struct blockvector *bv;
int blewit = 0;
+ /* We only wack things if the symbol-reload switch is set. */
+ if (!symbol_reloading)
+ return 0;
+
/* Some symbol formats have trouble providing file names... */
if (name == 0 || *name == '\0')
return 0;
&setlist),
&showlist);
+ add_show_from_set
+ (add_set_cmd ("symbol-reloading", class_support, var_boolean,
+ (char *)&symbol_reloading,
+ "Set dynamic symbol table reloading multiple times in one run.",
+ &setlist),
+ &showlist);
+
obstack_init (symbol_obstack);
obstack_init (psymbol_obstack);
}