This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

RE: [PATCH 1/3] Added command remove-symbol-file.


Hi Pedro,

I tested adding a file manually in gdb before the debuggee, as you suggested, and indeed
the user-added file appeared in so_list_head. There was a  glitch in my function because
"objfile->flags & OBJF_SHARED" was not set by GDB. So the dangling reference was not removed
from the list. I fixed that and now the new code for remove_user_added_file is:

/* SO_LIST_HEAD may contain user-loaded object files that can be removed
   out-of-band by the user.  So upon notification of free_objfile remove
   any reference to any user-loaded file that is about to be freed.  */

static void
remove_user_added_objfile (struct objfile *objfile)
{
  struct so_list *so;

  if (!objfile)
    return;

  if (objfile->flags & OBJF_USERLOADED)
    {
      for (so = so_list_head; so != NULL; so = so->next)
	if (so->objfile == objfile)
	  so->objfile = NULL;
    }
}

If this is function is ok for you then I'll send a new version of the patch.

Thanks again for your feedback,

Nicolas

Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


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