This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


Fernando Nasser writes:
 > Elena Zannoni wrote:
 > > 
 > >  > However, the bit:
 > >  > >  > +   /* Getting new symbols may change our opinion about
 > >  > >  > +      what is frameless.  */
 > >  > >  > +   reinit_frame_cache ();
 > >  >
 > >  > should _always_ be done, whenever we load new symbols.
 > >  >
 > > 
 > > I need to understand better what happens with shared libraries.
 > > SOLIB_ADD ends up calling this. I see it used in the attach command
 > > and in this case a reinit_frame_cache is OK, so is for the case in
 > > sol-thread.c but what about the other calls?
 > > 
 > 
 > The comment "Getting new symbols may change our opinion about what is
 > frameless." basically answers your question.  GDB is much more reliable
 > at figuring out where the prologue ends when symbols are available.  If
 > you are stopped inside a function (in a shared library) and you did not
 > had the symbols when you created the frame cache, you did a less job
 > than you could have done if you had symbols.
 > 

(Gee, talk about cloning a comment throughout gdb!)

Yes, I agree with that. I was just thinking about a different case in
which the user may have manually loaded the shlibs ahead of time,
before the inferior calls any of the functions in the shlibs. But I
see that it is already called most, if not all, of the times.

 > That is why the frame cache is always reset, so the frames can be
 > reconstructed with mode information and, thus, more precisely. 
 > 

Anyway, I think we could both be right, so I don't mind if you add the
call to the symbol_file_add function. I assume you would have to
adjust other code in shlib related files as well. Some of the
solib_add funtions are making sure that reinit_frame_cache is called
only once after loading all the shared libs. Now it will be done once
per shlib.  I don't know what the overhead will be.  Maybe shlib
maintainers can speak up once the new patch is posted.

Thanks for doing this, it turned out to be more work than the initial
patch was.

Elena


 > -- 
 > Fernando Nasser
 > Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
 > 2323 Yonge Street, Suite #300
 > Toronto, Ontario   M4P 2C9
 > 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]