Fix missing NEON registers for the 'register read' command with the lldb debugserver which supports the 'qRegisterInfo' packet

that dynamically discovers remote register context information.

o GDBRemoteRegisterContext.h:

Change the prototype of HardcodeARMRegisters() to take a boolean flag, which now becomes

    void
    HardcodeARMRegisters(bool from_scratch);

o GDBRemoteRegisterContext.cpp:

HardcodeARMRegisters() now checks the from_scratch flag and decides whether to add composite registers to the already
existing primordial registers based on a table called g_composites which describes the composite registers.

o ProcessGDBRemote.cpp:

Modify the logic of ProcessGDBRemote::BuildDynamicRegisterInfo() to call m_register_info.HardcodeARMRegisters()
with the newly introduced 'bool from_scrach' flag.

rdar://problem/10652076

llvm-svn: 156773
This commit is contained in:
Johnny Chen
2012-05-14 18:44:23 +00:00
parent 67c09afab1
commit 2fa9de1080
3 changed files with 98 additions and 53 deletions

View File

@@ -378,25 +378,28 @@ ProcessGDBRemote::BuildDynamicRegisterInfo (bool force)
}
}
if (reg_num == 0)
// We didn't get anything if the accumulated reg_num is zero. See if we are
// debugging ARM and fill with a hard coded register set until we can get an
// updated debugserver down on the devices.
// On the other hand, if the accumulated reg_num is positive, see if we can
// add composite registers to the existing primordial ones.
bool from_scratch = (reg_num == 0);
const ArchSpec &target_arch = GetTarget().GetArchitecture();
const ArchSpec &remote_arch = m_gdb_comm.GetHostArchitecture();
if (!target_arch.IsValid())
{
// We didn't get anything. See if we are debugging ARM and fill with
// a hard coded register set until we can get an updated debugserver
// down on the devices.
const ArchSpec &target_arch = GetTarget().GetArchitecture();
const ArchSpec &remote_arch = m_gdb_comm.GetHostArchitecture();
if (!target_arch.IsValid())
{
if (remote_arch.IsValid()
&& remote_arch.GetMachine() == llvm::Triple::arm
&& remote_arch.GetTriple().getVendor() == llvm::Triple::Apple)
m_register_info.HardcodeARMRegisters();
}
else if (target_arch.GetMachine() == llvm::Triple::arm)
{
m_register_info.HardcodeARMRegisters();
}
if (remote_arch.IsValid()
&& remote_arch.GetMachine() == llvm::Triple::arm
&& remote_arch.GetTriple().getVendor() == llvm::Triple::Apple)
m_register_info.HardcodeARMRegisters(from_scratch);
}
else if (target_arch.GetMachine() == llvm::Triple::arm)
{
m_register_info.HardcodeARMRegisters(from_scratch);
}
// At this point, we can finalize our register info.
m_register_info.Finalize ();
}