<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi,<br>
<br>
I am new to the lldb development and trying to add support for ppc64le.<br>
</p>
<p>Now, I am having some problems to handle the breakpoints.<br>
In the file /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:1868, I am not able to get the PC address.<br>
<br>
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.</p>
<p>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.<br>
Does anyone have an idea about why this is happening?<br>
I am sending the code of the DoReadRegisterValue function below.</p>
<p>Alexandre.<br>
<br>
------------------------------------------------------------<br>
Status NativeRegisterContextLinux_ppc64le::DoReadRegisterValue(<br>
    uint32_t offset, const char *reg_name, uint32_t size,<br>
    RegisterValue &value) {<br>
    Status error;<br>
<br>
    elf_gregset_t regs;<br>
    int regset = NT_PRSTATUS;<br>
    struct iovec ioVec;<br>
    struct pt_regs regs_p;<br>
    ioVec.iov_base = &regs;<br>
    ioVec.iov_len = sizeof regs;<br>
<br>
    bool isPc = strcmp(reg_name, "pc") == 0;<br>
    if (isPc) {<br>
    error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGSET,<br>
            m_thread.GetID(), &regset, &regs_p, sizeof regs_p);<br>
    } else {<br>
    error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGSET,<br>
            m_thread.GetID(), &regset, &ioVec, sizeof regs);<br>
    }<br>
<br>
    if (error.Success()) {<br>
      ArchSpec arch;<br>
      if (m_thread.GetProcess()->GetArchitecture(arch))<br>
    if (isPc) {<br>
        value.SetBytes(&regs_p.nip, 8, arch.GetByteOrder());<br>
    } else {<br>
        value.SetBytes((void *) (((unsigned char *) (regs)) + offset), 8,<br>
                arch.GetByteOrder());<br>
    }<br>
      else<br>
        error.SetErrorString("failed to get architecture");<br>
    }<br>
  return error;<br>
}</p>
-- <br>
<div class="moz-signature">Alexandre Yukio Yamashita<br>
Eldorado Research Institute <br>
<a href="http://www.eldorado.org.br/" title="Eldorado">www.eldorado.org.br</a></div>
</body>
</html>