#include "inferior.h" /* for write_pc */
#include "gdb-stabs.h"
#include "obstack.h"
-#include "completer.h"
#include <sys/types.h>
#include <fcntl.h>
static void load_command (char *, int);
+static void symbol_file_add_main_1 (char *args, int from_tty, int flags);
+
static void add_symbol_file_command (char *, int);
static void add_shared_symbol_files_command (char *, int);
static void cashier_psymtab (struct partial_symtab *);
-static int compare_psymbols (const void *, const void *);
-
-static int compare_symbols (const void *, const void *);
-
bfd *symfile_bfd_open (char *);
static void find_sym_fns (struct objfile *);
comparison function takes two "void *" pointers. */
static int
-compare_symbols (const PTR s1p, const PTR s2p)
+compare_symbols (const void *s1p, const void *s2p)
{
register struct symbol **s1, **s2;
*/
static int
-compare_psymbols (const PTR s1p, const PTR s2p)
+compare_psymbols (const void *s1p, const void *s2p)
{
register struct partial_symbol **s1, **s2;
register char *st1, *st2;
return (objfile);
}
-/* Just call the above with default values.
- Used when the file is supplied in the gdb command line. */
+/* Call symbol_file_add() with default values and update whatever is
+ affected by the loading of a new main().
+ Used when the file is supplied in the gdb command line
+ and by some targets with special loading requirements.
+ The auxiliary function, symbol_file_add_main_1(), has the flags
+ argument for the switches that can only be specified in the symbol_file
+ command itself. */
void
symbol_file_add_main (char *args, int from_tty)
{
- symbol_file_add (args, from_tty, NULL, 1, 0);
+ symbol_file_add_main_1 (args, from_tty, 0);
+}
+
+static void
+symbol_file_add_main_1 (char *args, int from_tty, int flags)
+{
+ symbol_file_add (args, from_tty, NULL, 1, flags);
+
+#ifdef HPUXHPPA
+ RESET_HP_UX_GLOBALS ();
+#endif
+
+ /* Getting new symbols may change our opinion about
+ what is frameless. */
+ reinit_frame_cache ();
+
+ set_initial_language ();
}
void
else
{
name = *argv;
- symbol_file_add (name, from_tty, NULL, 1, flags);
-#ifdef HPUXHPPA
- RESET_HP_UX_GLOBALS ();
-#endif
- /* Getting new symbols may change our opinion about
- what is frameless. */
- reinit_frame_cache ();
- set_initial_language ();
+ symbol_file_add_main_1 (name, from_tty, flags);
}
argv++;
}
{
error ("no symbol file name was specified");
}
- TUIDO (((TuiOpaqueFuncPtr) tuiDisplayMainFunction));
do_cleanups (cleanups);
}
}
/* Look down path for it, allocate 2nd new malloc'd copy. */
desc = openp (getenv ("PATH"), 1, name, O_RDONLY | O_BINARY, 0, &absolute_name);
-#if defined(__GO32__) || defined(_WIN32)
+#if defined(__GO32__) || defined(_WIN32) || defined (__CYGWIN__)
if (desc < 0)
{
char *exename = alloca (strlen (name) + 5);
if (fl_table_next >= fl_table_size)
{
fl_table_size += 10;
- filename_language_table = realloc (filename_language_table,
- fl_table_size);
+ filename_language_table = xrealloc (filename_language_table,
+ fl_table_size);
}
filename_language_table[fl_table_next].ext = xstrdup (ext);