[lldb-dev] lldb keeping .a file open

Greg Clayton gclayton at apple.com
Fri Nov 22 09:53:09 PST 2013


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

Greg

On Nov 22, 2013, at 9:20 AM, jingham at apple.com wrote:

> 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
> 
> On Nov 22, 2013, at 9:06 AM, Carlo Kok <ck at remobjects.com> wrote:
> 
>> On Fri, 22 Nov 2013 17:28:25 +0100, <jingham at apple.com> wrote:
>> 
>>> 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.
>> 
>> 
>> 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.
>> 
>> -- 
>> Carlo Kok
>> RemObjects Software
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev




More information about the lldb-dev mailing list