lldb keeping .a file open

I have a fat binary .a file that gets loaded via the lldb debugger api. AFter the debug session is done, lldb keeps the file open. Is there any way to release this? (Using a few months old lldb)

Did you try "target delete <Target that loaded .a file>"?

That should clear all the modules held onto by that target. "target list" will show you all the currently open targets.

Jim

I did, doesn't seem to do much for bsd .a files. This does work though:

#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"

class MyBSDStuff : private ObjectContainerBSDArchive {
public:
   static void ClearCache() {
     Mutex::Locker locker(Archive::GetArchiveCacheMutex());
     Archive::Map &archive_map = Archive::GetArchiveCache();
     archive_map.clear();
   }
};

MyBSDStuff::ClearCache();

which I know is a terrible hack, but I didn't see it anywhere else exposed.

That's a bug. The archives need to track what modules they came from and release themselves when there are no more modules referencing them.

Jim

Yeah, we could switch the archive cache over to using weak pointers and that should solve the issue.

Greg