Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/commit] Check library name rather than member name when rereading symbols.
@ 2010-04-21 15:18 Joel Brobecker
  2010-04-21 15:40 ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2010-04-21 15:18 UTC (permalink / raw)
  To: gdb-patches

Hello,

On Darwin, we have lots of complaints being emitted when restarting
a program:

    (gdb) start
    `a-except.o' has disappeared; keeping its symbols.
    `unwind-dw2.o' has disappeared; keeping its symbols.
    `s-except.o' has disappeared; keeping its symbols.
    `s-traceb.o' has disappeared; keeping its symbols.

These object files are part of the GNAT runtime, and were never available.
The warning comes from the fact that we're checking whether the .o files
in the GNAT shared runtime have changed whereas we should be checking
whether the GNAT shared library itself has changed.

This patch implements this.  Although it is really only useful on a platform
such as Darwin (debug info stored in .o files), we believe that this is
the right thing to do in general.  This change should be a noop for all
the other platforms in any case.

gdb/ChangeLog (from Tristan Gingold):

        * symfile.c (reread_symbols): Also search for file in libraries.

Tested on x86_64-darwin and x86_64-linux. Any thoughts on this?

---
 gdb/symfile.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/gdb/symfile.c b/gdb/symfile.c
index eda26cc..2124419 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2291,14 +2291,12 @@ reread_symbols (void)
       if (objfile->separate_debug_objfile_backlink)
 	continue;
 
-#ifdef DEPRECATED_IBM6000_TARGET
       /* If this object is from a shared library, then you should
 	 stat on the library name, not member name. */
 
       if (objfile->obfd->my_archive)
 	res = stat (objfile->obfd->my_archive->filename, &new_statbuf);
       else
-#endif
 	res = stat (objfile->name, &new_statbuf);
       if (res != 0)
 	{
-- 
1.6.3.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA/commit] Check library name rather than member name when rereading symbols.
  2010-04-21 15:18 [RFA/commit] Check library name rather than member name when rereading symbols Joel Brobecker
@ 2010-04-21 15:40 ` Pedro Alves
  2010-04-21 15:43   ` Tristan Gingold
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2010-04-21 15:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

On Wednesday 21 April 2010 16:18:03, Joel Brobecker wrote:
> Hello,
> 
> On Darwin, we have lots of complaints being emitted when restarting
> a program:
> 
>     (gdb) start
>     `a-except.o' has disappeared; keeping its symbols.
>     `unwind-dw2.o' has disappeared; keeping its symbols.
>     `s-except.o' has disappeared; keeping its symbols.
>     `s-traceb.o' has disappeared; keeping its symbols.
> 
> These object files are part of the GNAT runtime, and were never available.
> The warning comes from the fact that we're checking whether the .o files
> in the GNAT shared runtime have changed whereas we should be checking
> whether the GNAT shared library itself has changed.
> 
> This patch implements this.  Although it is really only useful on a platform
> such as Darwin (debug info stored in .o files), we believe that this is
> the right thing to do in general.  This change should be a noop for all
> the other platforms in any case.

Makes sense to me.  And it's wonderful to get rid of another
#ifdef DEPRECATED_IBM6000_TARGET instance.  Though, isn't the
comment's mention of "shared" a bit misleading?  Isn't this about static
libraries / archives?  Does this really also apply to shared
libraries?

> -#ifdef DEPRECATED_IBM6000_TARGET
>        /* If this object is from a shared library, then you should
>  	 stat on the library name, not member name. */
>  
>        if (objfile->obfd->my_archive)
>  	res = stat (objfile->obfd->my_archive->filename, &new_statbuf);
>        else
> -#endif
>  	res = stat (objfile->name, &new_statbuf);
>        if (res != 0)
>  	{
> 


-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA/commit] Check library name rather than member name when rereading symbols.
  2010-04-21 15:40 ` Pedro Alves
@ 2010-04-21 15:43   ` Tristan Gingold
  2010-04-21 15:58     ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Tristan Gingold @ 2010-04-21 15:43 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Joel Brobecker


On Apr 21, 2010, at 5:40 PM, Pedro Alves wrote:

> On Wednesday 21 April 2010 16:18:03, Joel Brobecker wrote:
>> Hello,
>> 
>> On Darwin, we have lots of complaints being emitted when restarting
>> a program:
>> 
>>    (gdb) start
>>    `a-except.o' has disappeared; keeping its symbols.
>>    `unwind-dw2.o' has disappeared; keeping its symbols.
>>    `s-except.o' has disappeared; keeping its symbols.
>>    `s-traceb.o' has disappeared; keeping its symbols.
>> 
>> These object files are part of the GNAT runtime, and were never available.
>> The warning comes from the fact that we're checking whether the .o files
>> in the GNAT shared runtime have changed whereas we should be checking
>> whether the GNAT shared library itself has changed.
>> 
>> This patch implements this.  Although it is really only useful on a platform
>> such as Darwin (debug info stored in .o files), we believe that this is
>> the right thing to do in general.  This change should be a noop for all
>> the other platforms in any case.
> 
> Makes sense to me.  And it's wonderful to get rid of another
> #ifdef DEPRECATED_IBM6000_TARGET instance.  Though, isn't the
> comment's mention of "shared" a bit misleading?  Isn't this about static
> libraries / archives?  Does this really also apply to shared
> libraries?

For darwin, this applies only to static libraries.  For AIX, I don't know :-)

Tristan.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA/commit] Check library name rather than member name when rereading symbols.
  2010-04-21 15:43   ` Tristan Gingold
@ 2010-04-21 15:58     ` Pedro Alves
  2010-04-21 16:12       ` Joel Brobecker
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2010-04-21 15:58 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tristan Gingold, Joel Brobecker

On Wednesday 21 April 2010 16:43:43, Tristan Gingold wrote:
> > Makes sense to me.  And it's wonderful to get rid of another
> > #ifdef DEPRECATED_IBM6000_TARGET instance.  Though, isn't the
> > comment's mention of "shared" a bit misleading?  Isn't this about static
> > libraries / archives?  Does this really also apply to shared
> > libraries?
> 
> For darwin, this applies only to static libraries.  For AIX, I don't know :-)

Found it, I think:

<http://publib.boulder.ibm.com/infocenter/comphelp/v7v91/index.jsp?topic=/com.ibm.vacpp7a.doc/getstart/overview/port_aix_obj_lib.htm>

 "A shared library on AIX refers to an archive library file created by the ar
 command, in which one or more of the archive members is a shared object."

So, could you tweak the comment a bit while there?  I'd suggest:

/* If this object is from an archive (what you usually create with
   `ar', often called a `static library' on most systems, though
   a `shared library' on AIX is also an archive), then you should
   stat on the archive name, not member name.  */

Thanks.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA/commit] Check library name rather than member name when  rereading symbols.
  2010-04-21 15:58     ` Pedro Alves
@ 2010-04-21 16:12       ` Joel Brobecker
  2010-04-27 21:06         ` Joel Brobecker
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2010-04-21 16:12 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Tristan Gingold

[-- Attachment #1: Type: text/plain, Size: 413 bytes --]

> So, could you tweak the comment a bit while there?  I'd suggest:
> 
> /* If this object is from an archive (what you usually create with
>    `ar', often called a `static library' on most systems, though
>    a `shared library' on AIX is also an archive), then you should
>    stat on the archive name, not member name.  */

Absolutely - thanks for digging out the info. Here is an updated version...

-- 
Joel

[-- Attachment #2: symfile.diff --]
[-- Type: text/x-diff, Size: 2176 bytes --]

commit f747aae3d5099a7e4c294b2b62e10346e561a5a6
Author: Joel Brobecker <brobecker@adacore.com>
Date:   Tue Apr 20 14:13:34 2010 -0400

    Check library name rather than member name when rereading symbols.
    
    On Darwin, we have lots of complaints being emitted when restarting
    a program:
    
        (gdb) start
        `a-except.o' has disappeared; keeping its symbols.
        `unwind-dw2.o' has disappeared; keeping its symbols.
        `s-except.o' has disappeared; keeping its symbols.
        `s-traceb.o' has disappeared; keeping its symbols.
    
    These object files are part of the GNAT runtime, and were never available.
    The warning comes from the fact that we're checking whether the .o files
    in the GNAT shared runtime have changed whereas we should be checking
    whether the GNAT shared library itself has changed.
    
    This patch implements this.  Although it is really only useful on a platform
    such as Darwin (debug info stored in .o files), we believe that this is
    the right thing to do in general.  This change should be a noop for all
    the other platforms in any case.
    
    gdb/ChangeLog (from Tristan Gingold & Pedro Alves):
    
            * symfile.c (reread_symbols): Also search for file in libraries.
            Update comment.
    
    Tested on x86_64-darwin and x86_64-linux.

diff --git a/gdb/symfile.c b/gdb/symfile.c
index eda26cc..d11069c 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2291,14 +2291,13 @@ reread_symbols (void)
       if (objfile->separate_debug_objfile_backlink)
 	continue;
 
-#ifdef DEPRECATED_IBM6000_TARGET
-      /* If this object is from a shared library, then you should
-	 stat on the library name, not member name. */
-
+      /* If this object is from an archive (what you usually create with
+	 `ar', often called a `static library' on most systems, though
+	 a `shared library' on AIX is also an archive), then you should
+	 stat on the archive name, not member name.  */
       if (objfile->obfd->my_archive)
 	res = stat (objfile->obfd->my_archive->filename, &new_statbuf);
       else
-#endif
 	res = stat (objfile->name, &new_statbuf);
       if (res != 0)
 	{

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA/commit] Check library name rather than member name when   rereading symbols.
  2010-04-21 16:12       ` Joel Brobecker
@ 2010-04-27 21:06         ` Joel Brobecker
  0 siblings, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2010-04-27 21:06 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Tristan Gingold

> gdb/ChangeLog (from Tristan Gingold & Pedro Alves):
> 
>         * symfile.c (reread_symbols): Also search for file in libraries.
>         Update comment.

FYI: Now checked in.

-- 
Joel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-04-27 21:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-21 15:18 [RFA/commit] Check library name rather than member name when rereading symbols Joel Brobecker
2010-04-21 15:40 ` Pedro Alves
2010-04-21 15:43   ` Tristan Gingold
2010-04-21 15:58     ` Pedro Alves
2010-04-21 16:12       ` Joel Brobecker
2010-04-27 21:06         ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox