[Lldb-commits] [PATCH] D137519: [LLDB][LoongArch] Add LoongArch software breakpoint trap code
WÁNG Xuěruì via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Sun Nov 6 18:16:42 PST 2022
xen0n added a comment.
I think eventually the upstream Linux would gain support for hardware single-stepping, before the architecture is widely adopted (to be frank, if at all), so it's probably not necessary to mention this point in the commit message. Focus on the code changes being made right here.
Also the commit message is a bit unnatural (the English "take" feels very different than Chinese "取" in this context). Let me tweak it a little bit and please check if it's still conveying the message you intended.
================
Comment at: lldb/source/Host/common/NativeProcessProtocol.cpp:510
static const uint8_t g_riscv_opcode_c[] = {0x02, 0x90}; // c.ebreak
+ static const uint8_t g_loongarch_opcode[] = {0x05, 0x00, 0x2a, 0x00}; // break
----------------
This is not a plain `break`, but rather `break 0x5` or `break BRK_SSTEPBP` as the constant/magic 5 comes from Linux/LoongArch `asm/break.h`. Better reflect this in the comment.
================
Comment at: lldb/source/Target/Platform.cpp:1945
+ static const uint8_t g_loongarch_opcode[] = {0x05, 0x00, 0x2a,
+ 0x00}; // break
+ trap_opcode = g_loongarch_opcode;
----------------
Same here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137519/new/
https://reviews.llvm.org/D137519
More information about the lldb-commits
mailing list