Page MenuHomeFreeBSD

libproc: add LoongArch support
Needs ReviewPublic

Authored by zhaoxiaoqiang007_gmail.com on Tue, Sep 22, 2:24 PM.
Tags
None
Referenced Files
F173624659: D59896.diff
Sun, Sep 27, 6:34 AM
F173624094: D59896/new/.diff
Sun, Sep 27, 6:27 AM
F173620495: D59896.diff
Sun, Sep 27, 5:48 AM
F173577295: D59896.diff
Sat, Sep 26, 11:08 PM
Unknown Object (File)
Fri, Sep 25, 4:58 PM
Unknown Object (File)
Fri, Sep 25, 11:04 AM
Unknown Object (File)
Fri, Sep 25, 10:19 AM
Unknown Object (File)
Thu, Sep 24, 4:42 AM

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 77176
Build 74059: 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
63

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