[Lldb-commits] [lldb] r190647 - Cleanup POSIX RegisterContext class hierarchies.
Michael Sartain
mikesart at valvesoftware.com
Tue Sep 17 16:13:12 PDT 2013
On Fri, Sep 13, 2013 at 11:56 AM, Thirumurthi, Ashok <
ashok.thirumurthi at intel.com> wrote:
> Great work on the refactoring, Mike, it's really a solid and thoughtful
> effort and should move us in the direction of loading an ELF core on OS/X.
> Everything looks good and tests well, but I see that you also reinvented
> the container for RegisterInfo:
>
> // Use a singleton function to avoid global constructors in shared
> libraries.
> RegisterContextFreeBSD_x86_64::RegisterContextFreeBSD_x86_64()
> {
> static std::vector<RegisterInfo> g_register_infos;
> return g_register_infos;
> }
>
> -->
>
> std::vector<lldb_private::RegisterInfo> m_register_infos
>
> The resulting code is very readable and maintainable, which is a great
> asset. I took the same path myself until I realized that the static
> register set is more efficient. Essentially, we frequently create a
> RegisterContext (i.e. each frame of each thread is a candidate), however
> once the architecture is known, the register information can be pinned down
> once for all frames. Hence all the hoops to allow a class hierarchy to use
> a static container.
>
> Is this something that you could restore in a separate commit? Thanks,
How does this look Ashok?
http://llvm-reviews.chandlerc.com/D1703
Thanks.
-Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20130917/dd7893f2/attachment.html>
More information about the lldb-commits
mailing list