aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando Nasser <fnasser@redhat.com>2001-05-10 15:33:21 +0000
committerFernando Nasser <fnasser@redhat.com>2001-05-10 15:33:21 +0000
commitd7db6da9f6e63a912cedfe61d720eb3797d42619 (patch)
tree76644237f33c5bc58c22ad4db914b3b297bdeaaf
parent606ab118baddd89493a504f6622c944562cc6bc5 (diff)
downloadgdb-d7db6da9f6e63a912cedfe61d720eb3797d42619.zip
gdb-d7db6da9f6e63a912cedfe61d720eb3797d42619.tar.gz
gdb-d7db6da9f6e63a912cedfe61d720eb3797d42619.tar.bz2
2001-05-10 Fernando Nasser <fnasser@redhat.com>
* symfile.c (symbol_file_add_main_1): New static function. Passes the flags arguments to symbol_file_add() and takes care of any necessary reinitializations. (symbol_file_command): Call symbol_file_add_main_1() instead of symbol_file_add(). (symbol_file_add_main): Ditto.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/symfile.c38
2 files changed, 36 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8b358a9..f7ae18b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2001-05-10 Fernando Nasser <fnasser@redhat.com>
+
+ * symfile.c (symbol_file_add_main_1): New static function.
+ Passes the flags arguments to symbol_file_add() and takes care
+ of any necessary reinitializations.
+ (symbol_file_command): Call symbol_file_add_main_1() instead of
+ symbol_file_add().
+ (symbol_file_add_main): Ditto.
+
2001-05-09 Kevin Buettner <kevinb@redhat.com>
* lin-lwp.c (lin_lwp_pid_to_str): Revert inadvertent format
diff --git a/gdb/symfile.c b/gdb/symfile.c
index b644af8..822c114 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -109,6 +109,8 @@ static void set_initial_language (void);
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);
@@ -896,13 +898,34 @@ symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs,
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
@@ -979,15 +1002,8 @@ symbol_file_command (char *args, int from_tty)
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++;
}