Page MenuHomeFreeBSD

libproc: add LoongArch support
AcceptedPublic

Authored by zhaoxiaoqiang007_gmail.com on Tue, Sep 22, 2:24 PM.
Tags
None
Referenced Files
F174679268: D59896.id188511.diff
Mon, Oct 5, 3:43 AM
Unknown Object (File)
Sun, Oct 4, 6:36 PM
Unknown Object (File)
Sun, Oct 4, 3:33 PM
Unknown Object (File)
Sat, Oct 3, 3:09 PM
Unknown Object (File)
Sat, Oct 3, 5:53 AM
Unknown Object (File)
Fri, Oct 2, 11:18 AM
Unknown Object (File)
Fri, Oct 2, 6:54 AM
Unknown Object (File)
Thu, Oct 1, 10:49 PM

Details

Summary

Add the LoongArch breakpoint instruction.

Signed-off-by: Xiaoqiang Zhao <zhaoxiaoqiang007@gmail.com>
Signed-off-by: yu shan wei <mpysw@vip.163.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 77372
Build 74255: arc lint + arc unit

Event Timeline

break 0 is BRK_DEFAULT, not a user-breakpoint code, use break 0x4 (BRK_USERBP)

lib/libproc/proc_bkpt.c
66

break 0 is BRK_DEFAULT, not a user-breakpoint code, use break 0x4 (BRK_USERBP)

break 0 is the semantically unspecified default code rather than the user breakpoint code — the code_break is a semantic argument reserved for the handler (LoongArch Reference Manual Vol.1 §2.2.10.2), and the ecosystem has already assigned 0=DEFAULT, 4=BRK_USERBP "User bp (used by debuggers)", and 5=BRK_SSTEPBP. Therefore the user breakpoint should use the dedicated 0x4(the encoding has been verified by llvm-mc: break → [0x04,0x00,0x2a,0x00] = 0x002a0004).

Suggested change to:

#define	BREAKPOINT_INSTR	0x002a0004	/* break 0x4 (BRK_USERBP) */

add missing reg value set/get
use break 0x4 for user break point

This revision is now accepted and ready to land.Sun, Oct 4, 4:49 AM