[Lldb-commits] [PATCH] D54460: Don't keep a global ABI plugin per architecture
Jim Ingham via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Nov 12 17:57:29 PST 2018
jingham created this revision.
jingham added reviewers: clayborg, jasonmolenda.
Herald added subscribers: lldb-commits, abidh, atanasyan, kbarton, javed.absar, nemanjai.
For reasons that are unclear to me, when the ABIXXX::CreateInstance function is called to make a new ABI for a given process and ArchSpec, we would only make the plugin once, with the initial process and architecture. Then if we got called with a different process, we would check to see if we already made one and if we did, hand back the one we had made - even though that was for a different process.
If there were ever anything per-process that effected the ABI plugin's behavior (for instance if it relied on a Process property) you could very well use the wrong processes setting. Even worse, since the ABI's hold onto a process through a weak pointer, if the initial process had gone away, you would not be able to get to any process at all, and silently fall back on some default behavior.
This caching goes back to prehistoric days in lldb, but I can't think of any reason why we would do this. It seems clearly wrong, and ABI plugins are really cheap to make - they pretty much just copy the process SP to a weak pointer and that's about all. So this also seems like an unnecessary optimization.
Greg or Jason, do you remember why we did this?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 8404 bytes
Desc: not available
More information about the lldb-commits