Page MenuHomeFreeBSD

libproc: add LoongArch support
AcceptedPublic

Authored by zhaoxiaoqiang007_gmail.com on Tue, Sep 22, 2:24 PM.
Tags
None
Referenced Files
F175356856: D59896.id187414.diff
Sat, Oct 10, 6:24 AM
F175311800: D59896.id187414.diff
Fri, Oct 9, 9:14 PM
Unknown Object (File)
Fri, Oct 9, 4:29 PM
Unknown Object (File)
Thu, Oct 8, 7:31 AM
Unknown Object (File)
Thu, Oct 8, 12:21 AM
Unknown Object (File)
Wed, Oct 7, 12:02 PM
Unknown Object (File)
Wed, Oct 7, 3:52 AM
Unknown Object (File)
Tue, Oct 6, 8:41 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