PowerPC64 disassembler

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
LLDB: 0x40051d <+45>: callq 0x4004e0 ; ret1

However, LLDB doesn’t do that in PPC64:
GDB: 0x0000000010000658 <+72>: bl 0x10000670
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.

Thank you,
Ana Julia

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.

Greg