[lldb] [llvm] [lldb] Support disassembling RISC-V proprietary instructions (PR #145793)

Jason Molenda via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 22:43:31 PDT 2025


jasonmolenda wrote:

I mentioned it last week but I know there was a lot of different comments on this PR, so I wanted to be more clear about what I was talking about.  The Opcode class is given a Type argument which it uses to decide how to format the bytes when it Dumps them.  But this PR adds a new DumpRISCV() method instead of adding a new Type, and I'm not thrilled about that.  (also it doesn't handle an endian mismatch between target and lldb host)

I sketched out what an implementation of this part of this PR as a separate PR,
https://github.com/llvm/llvm-project/pull/148105

I thought about putting up a github gist of a diff instead, but this might be easier to browse for people so I put up this PR.  We can just close it if no one else is on board with this.

I added a unit test to check that the opcode bytes are formatted as expected, it is failing the 64-bit instruction right now, MCInst seems to be saying that this is a 2-byte instruction.  I may have done/probably did something wrong there.

https://github.com/llvm/llvm-project/pull/145793


More information about the llvm-commits mailing list