[llvm-dev] PPC64 Disassembler

Leonardo Bianconi via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 29 10:48:01 PST 2017

Hi all,

I'm working on lldb to make it available to ppc64le, but the "step over"
is not working for some cases.

When debugging, I can see that the disassembler analyze some instructions
forward, looking for a branch instruction
- "const bool can_branch = mc_disasm_ptr->CanBranch(inst);"), while
trying to set the next breakpoint.

On this case, the instruction is the "bne     cr7,0x2000092c", which is a branch,
but at llvm/lib/MC/MCInstrDesc.cpp:35 -
"if (isBranch() || isCall() || isReturn() || isIndirectBranch())" it returns false,
making lldb do not set the correct breakpoint, so the execution does not stop
at next line, which should be the "step over" behavior.

The variable "Flags" for the disassembled instruction does not have the branch

I have tried to change the file "/lib/Target/PowerPC/PPCInstrInfo.td", adding
"isBranch = 1" for the instruction "bc 4, $bi, $dst", but had not effect.

Comparing with x86_64, building the same cpp file, the instruction
"jne    0x4005eb" has the branch flag, which identifies it as a branch instruction.

Where is the definition that an instruction is a branch? Is it a bug?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171129/2b787f79/attachment.html>

More information about the llvm-dev mailing list