https://github.com/JDevlieghere commented:
As a general comment, the code is becoming quite complicated and I think it would help if we can break things up more. Looking at the protocol arguments we have and offset in bytes, an offset in instructions, and then an instruction count. If possible please try to mimic that logic in the structure of this function: 1. Take the address 2. Apply the byte offset 3. Compute the instruction offset and apply it (the logic to do that is complex and therefore this should be factored out into a helper function) 4. Get the number of instructions at the computed offset and create a list of SBInstructions to disassemble. You can use a default constructed SBInstruction for padding. 5. Disassemble the list of SBInstructions Looking at the code, I think that's doable, albeit maybe slightly less efficiently? https://github.com/llvm/llvm-project/pull/140486 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits