tedwoodward wrote:
> Is there a reason we couldn't handle this the same way for all targets? The llvm disassembler returns the size, and sets the Opcode (class instantiation) to a certain type - 8 bit, 16 bit, 16 bit thumb, 32 bit, 64 bit, bytes. For RISC-V, it's set to bytes, which means it prints out 1 byte at a time. I didn't want to add a type, because "bytes" works well for RISC-V, except when it comes to print them out. > I think you need to expand the comments in this formatting code to say both: > > * This is mimicking the objdump format and - > * It is doing so because this is easier to read / substitute / whatever > > Then I don't have to go look at what objdump does to figure out the goals of > this code. Sure, I'll do that. > How standard are these ways of printing the byte encodings? Is it recommended > / used by the spec, gnu objdump and llvm objdump? That's the ideal. For RISC-V, llvm-objdump mimics gnu objdump, so this change makes the RISC-V byte encodings match both. > If it's non-standard my worry would be you doing this to fit one filtering > application and another coming along and wanting it in a different format. That's one thing I'm trying to avoid - we don't want a filter app for objdump and another for the debugger. That's why I changed how the bytes are displayed, and changed "can't disassemble" from blank to `"<unknown>"`, which matches llvm-objdump. > Also this needs tests. > > * See if we have tests for `-b`, if not, write some for something that is not > RISC-V. Easy way to check is to mess up the formatting and see what fails. > * Add some `-b` for RISC-V specifically, with all the different formats > * Add tests for the filtering script that use another script that pretends to > be a filtering program. As this script is less of a demo, more of a real > feature for your customers at least. Will do. https://github.com/llvm/llvm-project/pull/145793 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits