Page MenuHomeFreeBSD

libproc: add LoongArch support
AcceptedPublic

Authored by zhaoxiaoqiang007_gmail.com on Tue, Sep 22, 2:24 PM.
Tags
None
Referenced Files
F175966775: D59896.id.diff
Wed, Oct 14, 8:59 PM
Unknown Object (File)
Tue, Oct 13, 6:41 AM
Unknown Object (File)
Mon, Oct 12, 10:08 PM
Unknown Object (File)
Mon, Oct 12, 2:10 AM
Unknown Object (File)
Mon, Oct 12, 2:07 AM
Unknown Object (File)
Sat, Oct 10, 6:24 AM
Unknown Object (File)
Fri, Oct 9, 9:14 PM
Unknown Object (File)
Fri, Oct 9, 4:29 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 77678
Build 74561: 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