<div dir="ltr"><div>The `isBranch` flag is already set on the branch instructions. Furthermore, we do use the `isBranch()` query in a few places in the PPC back end, so this does work. Perhaps there's something specific about the lldb usage? Is it somehow possible that the `isBranch()` query is called on the wrong instruction?<br></div>Would you be able to provide a test case that reproduces the issue?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 30, 2017 at 2:30 AM, Sean Fertile via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Leonardo,<br>
<br>
What is the opcode of the MCInstrDesc?<br>
<br>
Sean<br>
<div><div class="h5"><br>
On Wed, Nov 29, 2017 at 1:48 PM, Leonardo Bianconi via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> Hi all,<br>
><br>
><br>
><br>
> I’m working on lldb to make it available to ppc64le, but the “step over”<br>
><br>
> is not working for some cases.<br>
><br>
><br>
><br>
> When debugging, I can see that the disassembler analyze some instructions<br>
><br>
> forward, looking for a branch instruction<br>
><br>
> (llvm/tools/lldb/source/<wbr>Plugins/Disassembler/llvm/<wbr>DisassemblerLLVMC.cpp:87<br>
><br>
> – “const bool can_branch = mc_disasm_ptr->CanBranch(inst)<wbr>;”), while<br>
><br>
> trying to set the next breakpoint.<br>
><br>
><br>
><br>
> On this case, the instruction is the “bne     cr7,0x2000092c”, which is a<br>
> branch,<br>
><br>
> but at llvm/lib/MC/MCInstrDesc.cpp:35 –<br>
><br>
> “if (isBranch() || isCall() || isReturn() || isIndirectBranch())” it returns<br>
> false,<br>
><br>
> making lldb do not set the correct breakpoint, so the execution does not<br>
> stop<br>
><br>
> at next line, which should be the “step over” behavior.<br>
><br>
><br>
><br>
> The variable “Flags” for the disassembled instruction does not have the<br>
> branch<br>
><br>
> flag.<br>
><br>
><br>
><br>
> I have tried to change the file “/lib/Target/PowerPC/<wbr>PPCInstrInfo.td”,<br>
> adding<br>
><br>
> “isBranch = 1” for the instruction "bc 4, $bi, $dst", but had not effect.<br>
><br>
><br>
><br>
> Comparing with x86_64, building the same cpp file, the instruction<br>
><br>
> “jne    0x4005eb” has the branch flag, which identifies it as a branch<br>
> instruction.<br>
><br>
><br>
><br>
> Where is the definition that an instruction is a branch? Is it a bug?<br>
><br>
><br>
><br>
> Thanks!<br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
><br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div>