[lldb-dev] Patch to add two new classes - RegisterContextLinux_x86_64 and RegisterContextFreeBSD_x86_64

Samuel Jacob samueldotj at gmail.com
Tue May 7 12:54:33 PDT 2013


On Tue, May 7, 2013 at 12:36 PM, Thirumurthi, Ashok
<ashok.thirumurthi at intel.com> wrote:
> I see.  Note that there are a few downsides to the current implementation.  First, there is a need for about 6Kb of data for m_register_infos that is currently allocated per thread.  Secondly, it's not possible to have static methods that use m_register_infos, and we have a regression in logging because of static methods that use the stale m_register_infos like GetRegisterIndexFromOffset().  Third, the base class is brittle because it has stale m_register_infos.
>
Agree with the downsides. Slight correction m_register_infos is
allocated only once per platform.

> One possibility is for POSIXThread to maintain a new static class instance that wraps m_register_infos for each platform (let's call this RegisterLayout).  This would allow the plugins to be recoded without static methods while keeping the leaf classes lightweight.  Currently, we couple the register set with the layout in RegisterContext, whereas we need one register set per thread and one register layout per platform.

Good idea it will make RegisterContext classes neat.

Thanks
Samuel




More information about the lldb-dev mailing list