Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Fernando Nasser <fnasser@redhat.com>
To: Elena Zannoni <ezannoni@cygnus.com>
Cc: gdb-patches@sources.redhat.com, hilfingr@otisco.mckusick.com
Subject: RFA: [symfile.c} Fix to symbol_file_add() [REPOST]
Date: Wed, 02 May 2001 08:55:00 -0000	[thread overview]
Message-ID: <3AF02D6E.333B2AAB@redhat.com> (raw)
In-Reply-To: <15087.31793.429533.289522@kwikemart.cygnus.com>

After the fruitful discussions with Elena, I believe I have a better
patch, so please consider this one instead.

As Elena explained, we must let the callers of symbol_file_add() do the
cache reset as we may be loading several shared libraries.  Doing the
cache reset for each one is too much overhead as we will have to grab
the data for filling the current frame every single time.  Well,
symbol_file_add_main () is a caller, so I guess it can go there.  And
none of its callers has a a call to reinit_frame_cache() as they used to
call symbol_file_command().

I guess the previous behavior is being safely restored now.

However, several of the callers of symbol_file_add() do not call
reinit_frame_cache() as they should.  But as far as I can tell, this has
always been like that.  The only thing that is lost is the possibility
to get a better frame description of the current stack by using the
newly read symbols.  I don't know enough about all this targets to know
if this is important (I don't know why they are reading symbol files). 
The shared library case is already taken care of as Elena has pointed
out.



ChangeLog:

        * symfile.c (symbol_file_command): Move cleanup operations
        from here...
        (symbol_file_add_main): ...to here, so they are run every time
        a new main symbol file is read.


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9
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/02 15:35:32
*************** 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
--- 896,920 ----
    return (objfile);
  }
  
! /* Call the above with default values and update whatever is
!    affected by a new main().
!    Used when the file is supplied in the gdb command line
!    and by some targets. */
     
  void
  symbol_file_add_main (char *args, int from_tty)
  {
    symbol_file_add (args, from_tty, NULL, 1, 0);
+ 
+ #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
*** 980,993 ****
  		{
                    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++;
  	}
--- 992,997 ----
From ezannoni@cygnus.com Wed May 02 09:06:00 2001
From: Elena Zannoni <ezannoni@cygnus.com>
To: Fernando Nasser <fnasser@redhat.com>
Cc: Elena Zannoni <ezannoni@cygnus.com>, gdb-patches@sources.redhat.com, hilfingr@otisco.mckusick.com
Subject: Re: RFA: [symfile.c} Fix to symbol_file_add() [REPOST]
Date: Wed, 02 May 2001 09:06:00 -0000
Message-id: <15088.12423.711167.908434@kwikemart.cygnus.com>
References: <3AED8391.C6B9A456@redhat.com> <15085.43538.55216.581538@kwikemart.cygnus.com> <3AEDF6A3.440D0C62@redhat.com> <15086.11696.278572.217415@kwikemart.cygnus.com> <3AEEB0E2.3232D2DE@redhat.com> <15087.31793.429533.289522@kwikemart.cygnus.com> <3AF02D6E.333B2AAB@redhat.com>
X-SW-Source: 2001-05/msg00010.html
Content-length: 3520

Thanks Fernando!
But shouldn't we be leaving the stuff in symbol_file_command?
I.e. only adding it to the new function?
 

Elena


Fernando Nasser writes:
 > After the fruitful discussions with Elena, I believe I have a better
 > patch, so please consider this one instead.
 > 
 > As Elena explained, we must let the callers of symbol_file_add() do the
 > cache reset as we may be loading several shared libraries.  Doing the
 > cache reset for each one is too much overhead as we will have to grab
 > the data for filling the current frame every single time.  Well,
 > symbol_file_add_main () is a caller, so I guess it can go there.  And
 > none of its callers has a a call to reinit_frame_cache() as they used to
 > call symbol_file_command().
 > 
 > I guess the previous behavior is being safely restored now.
 > 
 > However, several of the callers of symbol_file_add() do not call
 > reinit_frame_cache() as they should.  But as far as I can tell, this has
 > always been like that.  The only thing that is lost is the possibility
 > to get a better frame description of the current stack by using the
 > newly read symbols.  I don't know enough about all this targets to know
 > if this is important (I don't know why they are reading symbol files). 
 > The shared library case is already taken care of as Elena has pointed
 > out.
 > 
 > 
 > 
 > ChangeLog:
 > 
 >         * symfile.c (symbol_file_command): Move cleanup operations
 >         from here...
 >         (symbol_file_add_main): ...to here, so they are run every time
 >         a new main symbol file is read.
 > 
 > 
 > -- 
 > Fernando Nasser
 > Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
 > 2323 Yonge Street, Suite #300
 > Toronto, Ontario   M4P 2C9Index: 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/02 15:35:32
 > *************** 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
 > --- 896,920 ----
 >     return (objfile);
 >   }
 >   
 > ! /* Call the above with default values and update whatever is
 > !    affected by a new main().
 > !    Used when the file is supplied in the gdb command line
 > !    and by some targets. */
 >      
 >   void
 >   symbol_file_add_main (char *args, int from_tty)
 >   {
 >     symbol_file_add (args, from_tty, NULL, 1, 0);
 > + 
 > + #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
 > *** 980,993 ****
 >   		{
 >                     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++;
 >   	}
 > --- 992,997 ----


  parent reply	other threads:[~2001-05-02  8:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-30  8:25 RFA: [symfile.c} Fix to symbol_file_add() Fernando Nasser
2001-04-30 11:28 ` Elena Zannoni
2001-04-30 16:36   ` Fernando Nasser
2001-04-30 20:29     ` Elena Zannoni
2001-05-01  5:51       ` Fernando Nasser
     [not found]         ` <15087.31793.429533.289522@kwikemart.cygnus.com>
2001-05-02  8:55           ` Fernando Nasser [this message]
     [not found]             ` <15088.12423.711167.908434@kwikemart.cygnus.com>
2001-05-02  9:43               ` RFA: [symfile.c} Fix to symbol_file_add() [REPOST] Fernando Nasser
2001-05-02 10:26                 ` Elena Zannoni
2001-05-02 11:06                   ` Fernando Nasser
2001-05-07  9:08 Fernando Nasser
2001-05-10  8:34 ` Fernando Nasser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3AF02D6E.333B2AAB@redhat.com \
    --to=fnasser@redhat.com \
    --cc=ezannoni@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=hilfingr@otisco.mckusick.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox