[lldb-dev] Adding lldb support for ppc64le
Alexandre Yukio Yamashita via lldb-dev
lldb-dev at lists.llvm.org
Wed Aug 16 12:39:44 PDT 2017
Hi,
I am new to the lldb development and trying to add support for ppc64le.
Now, I am having some problems to handle the breakpoints.
In the file /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:1868, I am not able to get the PC address.
I created a new file (NativeRegisterContextLinux_ppc64le.cpp), modifying the file /lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp to implement a function to read the register values.
In the function DoReadRegisterValue (NativeRegisterContextLinux_ppc64le.cpp:856), I am trying to map the PC value using the NIP register. But the NIP is coming with a zero value.
Does anyone have an idea about why this is happening?
I am sending the code of the DoReadRegisterValue function below.
Alexandre.
------------------------------------------------------------
Status NativeRegisterContextLinux_ppc64le::DoReadRegisterValue(
uint32_t offset, const char *reg_name, uint32_t size,
RegisterValue &value) {
Status error;
elf_gregset_t regs;
int regset = NT_PRSTATUS;
struct iovec ioVec;
struct pt_regs regs_p;
ioVec.iov_base = ®s;
ioVec.iov_len = sizeof regs;
bool isPc = strcmp(reg_name, "pc") == 0;
if (isPc) {
error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGSET,
m_thread.GetID(), ®set, ®s_p, sizeof regs_p);
} else {
error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGSET,
m_thread.GetID(), ®set, &ioVec, sizeof regs);
}
if (error.Success()) {
ArchSpec arch;
if (m_thread.GetProcess()->GetArchitecture(arch))
if (isPc) {
value.SetBytes(®s_p.nip, 8, arch.GetByteOrder());
} else {
value.SetBytes((void *) (((unsigned char *) (regs)) + offset), 8,
arch.GetByteOrder());
}
else
error.SetErrorString("failed to get architecture");
}
return error;
}
--
Alexandre Yukio Yamashita
Eldorado Research Institute
www.eldorado.org.br<http://www.eldorado.org.br/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20170816/5b00aebc/attachment.html>
More information about the lldb-dev
mailing list