Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Solibs and objfile BFD ownership
@ 2009-07-28 15:40 Daniel Jacobowitz
  2009-07-29 23:56 ` Paul Pluzhnikov
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2009-07-28 15:40 UTC (permalink / raw)
  To: Paul Pluzhnikov, gdb

I'm seeing ARM test failures caused by this patch:

2009-03-05  Paul Pluzhnikov  <ppluzhnikov@google.com>

        * printcmd.c (do_one_display): Reparse exp_string.
        (display_uses_solib_p): New function.
        (clear_dangling_display_expressions): New function.
        (_initialize_printcmd): Add observer.
        * solib.c (no_shared_libraries): Swap order of calls to
        clear_solib and objfile_purge_solibs.

Specifically this bit:

  /* The order of the two routines below is important: clear_solib notifies
     the solib_unloaded observers, and some of these observers might need
     access to their associated objfiles.  Therefore, we can not purge the
     solibs' objfiles before clear_solib has been called.  */

  clear_solib ();
  objfile_purge_solibs ();

The problem with doing things in this order is that both the solib and
the objfile have a reference to the same BFD.  The solib is
responsible for releasing it (OBJF_KEEPBFD).  arm_objfile_data_cleanup
accesses objfile->obfd during free_objfile, to find the number
of sections; at that point it's already been free'd.

Any thoughts?  I could change the ARM code to work around this, but
that means banning access to objfile->obfd during a not well specified
range of functions.  Handing off the ownership of the BFD seems like
it would be messy.

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2009-08-21 17:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-28 15:40 Solibs and objfile BFD ownership Daniel Jacobowitz
2009-07-29 23:56 ` Paul Pluzhnikov
2009-07-30 16:16   ` Tom Tromey
2009-08-04  0:50     ` Paul Pluzhnikov
2009-08-04 14:53       ` Daniel Jacobowitz
2009-08-04 17:37         ` Paul Pluzhnikov
2009-08-04 18:40           ` Daniel Jacobowitz
2009-08-04 18:47             ` Paul Pluzhnikov
2009-08-18  5:56               ` Paul Pluzhnikov
2009-08-19 22:29                 ` Tom Tromey
2009-08-20  1:50                   ` Paul Pluzhnikov
2009-08-21 17:32                     ` Tom Tromey
2009-08-21 18:04                       ` Paul Pluzhnikov

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