[lldb-dev] PowerPC64 disassembler

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Mon Nov 6 10:24:37 PST 2017

> On Nov 6, 2017, at 9:50 AM, Ana Julia Pereira Caetano via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> Hi,
> I was taking a look at the disassembler on PowerPC64.
> Usually, when we have a branch instruction, it shows the address of the target. 
> For example (function “ret1” in X86_64):
> GDB: 0x000000000040051d <+45>: callq 0x4004e0 <ret1> 
> LLDB: 0x40051d <+45>: callq 0x4004e0 ; ret1 
> However, LLDB doesn’t do that in PPC64:
> GDB: 0x0000000010000658 <+72>: bl 0x10000670 <ret1> 
> LLDB: 0x10000658 <+72>: bl .+67108760 
> (Note that the comment "; ret1" is missing).
> I noticed that LLDB on PPC64 is the only one that prints “.+” and the offset (which is unsigned in this case, that’s why it shows that strange number). 
> Why is it like this? Is there any special reason? 
> I was thinking about changing it and make it look more like the other ones, but first I want to know if that’s ok or if it should stay the way it is for some reason.

This would be a question for the LLVM folks since we get the disassemblers from LLVM and just use them in LLDB. LLDB uses the LLVM disassembler and it will ask us to identify addresses during disassembly via a callback. So it seems you will need to change the LLVM disassembler to do something similar to the x86_64 callq instruction. Not exactly sure how it is done, but probably should't be too hard.


> Thank you,
> Ana Julia 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org <mailto:lldb-dev at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20171106/ee2a68fa/attachment.html>

More information about the lldb-dev mailing list