Re: RFA: [symfile.c} Fix to symbol_file_add() [REPOST]

Fernando Nasser
2001-05-10T08:34:00Z

Checked in.

Thanks again Elena.

Fernando

> ChangeLog:
>
> * 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.
>
>
> ------------------------------------------------------------------------
> Index: symfile.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/symfile.c,v
> retrieving revision 1.31
> diff -c -p -r1.31 symfile.c
> *** symfile.c 2001/04/05 02:02:13 1.31
> --- symfile.c 2001/05/07 15:44:48
> *************** static void set_initial_language (void);
> *** 109,114 ****
> --- 109,116 ----
>
> 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);
> *************** symbol_file_add (char *name, int from_tt
> *** 896,908 ****
> return (objfile);
> }
>
> ! /* Just call the above with default values.
> ! Used when the file is supplied in the gdb command line. */
>
> void
> symbol_file_add_main (char *args, int from_tty)
> {
> ! symbol_file_add (args, from_tty, NULL, 1, 0);
> }
>
> void
> --- 898,931 ----
> return (objfile);
> }
>
> ! /* 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_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
> *************** symbol_file_command (char *args, int fro
> *** 979,993 ****
> 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 ();
> }
> argv++;
> }
> --- 1002,1009 ----
> else
> {
> name = *argv;
>
> ! symbol_file_add_main_1 (name, from_tty, flags);
> }
> argv++;
> }