Open vogelsgesang opened 1 month ago
@llvm/issue-subscribers-lldb
Author: Adrian Vogelsgesang (vogelsgesang)
Hi @vogelsgesang
Could you pls provide more details to understand the issue?
We noticed a crash in lldb-dap
when scrolling in the disassembly view window. This was caused by incorrect handling of "instructionOffset" and "Offset" for the Hexagon arch (As it does instruction packetization).
We have addressed this issue by handling all possible causes related to "instructionOffset" and "instructionCount".
"instructionOffset" applied before disassembling, as it will tell us from where to begin the disassemble. If the "instructionOffset" is positive - start disassembling after memoryReference. If the "instructionOffset" is negative - start disassembling before memoryReference.
If you know the significance of the "Offset" value in the disassemble request command, could you explain how it differs from "instructionOffset"?
Thanks,
If you know the significance of the "Offset" value in the disassemble request command, could you explain how it differs from "instructionOffset"?
The offset
is measured in bytes, while the instruction offset
is measured in instructions. This is particularly important for variable-length encoded instruction sets (such as Intel assembly), where there is no direct way to map from "instruction count" to "byte count"
VS-Code uses instructionOffset
for lazy-loading / scrolling in the UI. I don't know what offset
is actually useful for and if there are any users of it.
I just uploaded #105446 which shows my current progress at fixing this issue. The Pull Request is not completely finished, yet, though. In particular, the test cases are still broken.
In the
disassemble
call, theinstructionOffset
is treated as if it would be measuring the offset in bytes instead of as instructions (source code). This leads to an corrupted disassembly view in VS Code when scrolling