Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TestToolChainDemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
dsq
TestToolChainDemo
Commits
90bf7f82
Commit
90bf7f82
authored
Apr 02, 2026
by
qq_38816927
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
线帧
parent
aa0c52b6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
192 additions
and
64 deletions
+192
-64
App.kt
composeApp/src/commonMain/kotlin/com.dong.demo013/App.kt
+29
-0
DebugDataDemo.kt
...commonMain/kotlin/com.dong.demo013/debug/DebugDataDemo.kt
+17
-2
debug.kt
...App/src/commonMain/kotlin/com.dong.demo013/debug/debug.kt
+0
-0
debugThread.kt
...c/commonMain/kotlin/com.dong.demo013/debug/debugThread.kt
+26
-0
libkn_api.h
harmonyApp/entry/src/main/cpp/include/libkn_api.h
+71
-56
Index.ets
harmonyApp/entry/src/main/ets/pages/Index.ets
+42
-6
TestJumpClass.ets
harmonyApp/entry/src/main/ets/pages/TestJumpClass.ets
+7
-0
No files found.
composeApp/src/commonMain/kotlin/com.dong.demo013/App.kt
View file @
90bf7f82
...
...
@@ -14,6 +14,8 @@ import com.dong.demo013.debug.DebugStepOutDemo
import
com.dong.demo013.debug.DebugStepOverDemo
import
com.dong.demo013.debug.DebugTestDemo
import
com.dong.demo013.debug.allBreakpoints
import
com.dong.demo013.debug.tenComplexObject
import
com.dong.demo013.debug.testFrame1
import
com.dong.demo013.navigation.ComponentDemo
import
com.dong.demo013.navigation.ComposeGroup
import
com.dong.demo013.navigation.Page
...
...
@@ -83,6 +85,33 @@ internal fun HomeScreen(
Text
(
"attach断点测试触发"
)
}
Button
(
onClick
=
{
testFrame1
()
},
modifier
=
Modifier
.
fillMaxWidth
()
)
{
Text
(
"测试不同线帧变量"
)
}
}
// 复杂对象
Column
(
modifier
=
Modifier
.
fillMaxWidth
(),
verticalArrangement
=
Arrangement
.
spacedBy
(
8
.
dp
)
)
{
Text
(
"10层复杂对象"
)
Button
(
onClick
=
{
tenComplexObject
()
},
modifier
=
Modifier
.
fillMaxWidth
()
)
{
Text
(
"10层复杂对象断点测试触发"
)
}
}
Column
(
modifier
=
Modifier
.
fillMaxWidth
(),
...
...
composeApp/src/commonMain/kotlin/com.dong.demo013/debug/DebugDataDemo.kt
View file @
90bf7f82
...
...
@@ -41,13 +41,22 @@ internal fun DebugTestDemo() {
Button
(
onClick
=
{
print
(
"打印console调试信息"
)
tenComplexObject
();
},
)
{
Text
(
"
console信息打印)
"
,
color
=
Color
.
White
)
Text
(
"
10层复杂对象
"
,
color
=
Color
.
White
)
}
// Button(
// onClick = {
// print("打印console调试信息")
// },
//
// ) {
// Text("console信息打印)", color = Color.White)
// }
}
...
...
@@ -68,6 +77,7 @@ fun allBreakpoints(){
testCommonBreakpoint
()
complexObject
()
testConditionalBreakpoint
()
}
...
...
@@ -97,6 +107,11 @@ fun testCommonBreakpoint() {
print
(
"c=3"
);
//普通断点设置处2
}
fun
tenComplexObject
(){
val
testObject
=
DebugTenLevelData
.
sample
;
print
(
"10层复杂对象查看"
)
//断点10层复杂变量查看
}
//测试条件断点
fun
testIfBreakpoint
()
{
for
(
currentIndex
in
1
..
10
){
...
...
composeApp/src/commonMain/kotlin/com.dong.demo013/debug/debug.kt
deleted
100644 → 0
View file @
aa0c52b6
composeApp/src/commonMain/kotlin/com.dong.demo013/debug/debugThread.kt
0 → 100644
View file @
90bf7f82
package
com.dong.demo013.debug
fun
testFrame1
()
{
val
var1
=
"Frame1-Value"
val
var2
=
100
testFrame2
()
}
fun
testFrame2
()
{
val
var3
=
"Frame2-Value"
val
var4
=
200
testFrame3
()
}
fun
testFrame3
()
{
val
var5
=
"Frame3-Value"
val
var6
=
300
testFrame4
()
}
fun
testFrame4
()
{
val
var7
=
"Frame4-Value"
val
var8
=
400
// 断点设置在这里 - 可以看到 4 个栈帧的不同变量
println
(
"Stop here"
)
//线帧断点设置处
}
\ No newline at end of file
harmonyApp/entry/src/main/cpp/include/libkn_api.h
View file @
90bf7f82
...
...
@@ -163,6 +163,10 @@ typedef struct {
libkn_KNativePtr
pinned
;
}
libkn_kref_com_dong_demo013_TimerController
;
extern
void
*
MainArkUIViewController
(
void
*
env
);
extern
libkn_KInt
hiLogPrintMsg
(
libkn_KUInt
type
,
libkn_KUInt
level
,
libkn_KUInt
domain
,
const
char
*
tag
,
const
char
*
message
);
extern
void
testArkTsToKotin
();
extern
libkn_KInt
kn_get_render_backend_id
();
extern
void
androidx_compose_ui_arkui_ArkUIViewController_aboutToAppear
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_aboutToDisappear
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_cancelSyncRefresh
(
void
*
controllerRef
,
libkn_KInt
refreshId
);
...
...
@@ -203,10 +207,6 @@ extern void renderNodeNotifyRedraw(void* env, void* jsNode);
extern
void
setNodeConstructor
(
void
*
env
,
void
*
func
);
extern
void
setPixelRatio
(
libkn_KDouble
ratio
);
extern
void
androidx_compose_ui_arkui_init
(
void
*
env
,
void
*
exports
);
extern
void
*
MainArkUIViewController
(
void
*
env
);
extern
libkn_KInt
hiLogPrintMsg
(
libkn_KUInt
type
,
libkn_KUInt
level
,
libkn_KUInt
domain
,
const
char
*
tag
,
const
char
*
message
);
extern
void
testArkTsToKotin
();
extern
libkn_KInt
kn_get_render_backend_id
();
typedef
struct
{
/* Service functions. */
...
...
@@ -242,58 +242,6 @@ typedef struct {
/* User functions. */
struct
{
struct
{
struct
{
struct
{
struct
{
struct
{
struct
{
void
*
(
*
get_NodeDrawCallback
)();
void
(
*
_Export_ArkUIViewController_aboutToAppear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_aboutToDisappear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_cancelSyncRefresh
)(
void
*
controllerRef
,
libkn_KInt
refreshId
);
void
(
*
_Export_ArkUIViewController_dispatchHoverEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_dispatchMouseEvent
)(
void
*
controllerRef
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_dispatchTouchEvent
)(
void
*
controllerRef
,
void
*
nativeTouchEvent
,
libkn_KBoolean
ignoreInteropView
);
const
char
*
(
*
_Export_ArkUIViewController_getId
)(
void
*
controllerRef
);
void
*
(
*
_Export_ArkUIViewController_getXComponentRender
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_keyboardWillHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_keyboardWillShow
)(
void
*
controllerRef
,
libkn_KFloat
keyboardHeight
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_onBackPress
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFinalize
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFocusEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFrame
)(
void
*
controllerRef
,
libkn_KLong
timestamp
,
libkn_KLong
targetTimestamp
);
void
(
*
_Export_ArkUIViewController_onKeyEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageShow
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceChanged
)(
void
*
controllerRef
,
libkn_KInt
width
,
libkn_KInt
height
);
void
(
*
_Export_ArkUIViewController_onSurfaceCreated
)(
void
*
controllerRef
,
void
*
xcomponentPtr
,
libkn_KInt
width
,
libkn_KInt
height
);
void
(
*
_Export_ArkUIViewController_onSurfaceDestroyed
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceShow
)(
void
*
controllerRef
);
libkn_KInt
(
*
_Export_ArkUIViewController_requestSyncRefresh
)(
void
*
controllerRef
);
const
char
*
(
*
_Export_ArkUIViewController_sendMessage
)(
void
*
controllerRef
,
const
char
*
type
,
const
char
*
message
);
void
(
*
_Export_ArkUIViewController_setContext
)(
void
*
controllerRef
,
void
*
context
);
void
(
*
_Export_ArkUIViewController_setEnv
)(
void
*
controllerRef
,
void
*
env
);
void
(
*
_Export_ArkUIViewController_setId
)(
void
*
controllerRef
,
const
char
*
id
);
void
(
*
_Export_ArkUIViewController_setLocaleAndStringProvider
)(
void
*
controllerRef
,
void
*
provider
);
void
(
*
_Export_ArkUIViewController_setMessenger
)(
void
*
controllerRef
,
void
*
messenger
);
void
(
*
_Export_ArkUIViewController_setRenderBackendId
)(
void
*
controllerRef
,
libkn_KInt
backendId
);
void
(
*
_Export_ArkUIViewController_setRootView
)(
void
*
controllerRef
,
void
*
backRootView
,
void
*
foreRootView
,
void
*
touchableRootView
);
void
(
*
_Export_ArkUIViewController_setUIContext
)(
void
*
controllerRef
,
void
*
uiContext
);
void
(
*
_Export_ArkUIViewController_setXComponentRender
)(
void
*
controllerRef
,
void
*
render
);
void
(
*
buildInstance_
)(
void
*
env
,
void
*
func
);
void
*
(
*
createRootRenderNode_
)();
libkn_KLong
(
*
getCurrentTimeNanos
)();
void
(
*
renderNodeDraw_
)(
void
*
env
,
void
*
jsCanvas
,
void
*
jsNode
);
void
(
*
renderNodeNotifyRedraw_
)(
void
*
env
,
void
*
jsNode
);
void
(
*
setNodeConstructor_
)(
void
*
env
,
void
*
func
);
void
(
*
setPixelRatio_
)(
libkn_KDouble
ratio
);
void
(
*
_Export_ArkUIViewInitializer_init
)(
void
*
env
,
void
*
exports
);
}
arkui
;
}
ui
;
}
export_
;
}
compose
;
}
androidx
;
struct
{
struct
{
struct
{
...
...
@@ -648,6 +596,7 @@ typedef struct {
libkn_KInt
(
*
com_dong_demo013_debug_TerminalComplex
$
stableprop_getter
)();
void
(
*
complexObject
)();
void
(
*
getJsons
)();
void
(
*
tenComplexObject
)();
void
(
*
testCommonBreakpoint
)();
void
(
*
testConditionalBreakpoint
)();
void
(
*
testIfBreakpoint
)();
...
...
@@ -711,6 +660,20 @@ typedef struct {
libkn_KInt
(
*
com_dong_demo013_debug_DebugTenLevelRoot
$
stableprop_getter_____
)();
libkn_KInt
(
*
com_dong_demo013_debug_LeafLayer
$
stableprop_getter_____
)();
libkn_KInt
(
*
com_dong_demo013_debug_TerminalComplex
$
stableprop_getter_____
)();
libkn_KInt
(
*
com_dong_demo013_debug_BranchLayer
$
stableprop_getter______
)();
libkn_KInt
(
*
com_dong_demo013_debug_ComplexClass
$
stableprop_getter______
)();
libkn_KInt
(
*
com_dong_demo013_debug_ComplexClass1
$
stableprop_getter______
)();
libkn_KInt
(
*
com_dong_demo013_debug_ComplexClass2
$
stableprop_getter______
)();
libkn_KInt
(
*
com_dong_demo013_debug_ComplexNode
$
stableprop_getter______
)();
libkn_KInt
(
*
com_dong_demo013_debug_DebugAllTypesData
$
stableprop_getter______
)();
libkn_KInt
(
*
com_dong_demo013_debug_DebugTenLevelData
$
stableprop_getter______
)();
libkn_KInt
(
*
com_dong_demo013_debug_DebugTenLevelRoot
$
stableprop_getter______
)();
libkn_KInt
(
*
com_dong_demo013_debug_LeafLayer
$
stableprop_getter______
)();
libkn_KInt
(
*
com_dong_demo013_debug_TerminalComplex
$
stableprop_getter______
)();
void
(
*
testFrame1
)();
void
(
*
testFrame2
)();
void
(
*
testFrame3
)();
void
(
*
testFrame4
)();
}
debug
;
struct
{
struct
{
...
...
@@ -802,6 +765,58 @@ typedef struct {
}
compose
;
}
jetbrains
;
}
org
;
struct
{
struct
{
struct
{
struct
{
struct
{
void
*
(
*
get_NodeDrawCallback
)();
void
(
*
_Export_ArkUIViewController_aboutToAppear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_aboutToDisappear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_cancelSyncRefresh
)(
void
*
controllerRef
,
libkn_KInt
refreshId
);
void
(
*
_Export_ArkUIViewController_dispatchHoverEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_dispatchMouseEvent
)(
void
*
controllerRef
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_dispatchTouchEvent
)(
void
*
controllerRef
,
void
*
nativeTouchEvent
,
libkn_KBoolean
ignoreInteropView
);
const
char
*
(
*
_Export_ArkUIViewController_getId
)(
void
*
controllerRef
);
void
*
(
*
_Export_ArkUIViewController_getXComponentRender
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_keyboardWillHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_keyboardWillShow
)(
void
*
controllerRef
,
libkn_KFloat
keyboardHeight
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_onBackPress
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFinalize
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFocusEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFrame
)(
void
*
controllerRef
,
libkn_KLong
timestamp
,
libkn_KLong
targetTimestamp
);
void
(
*
_Export_ArkUIViewController_onKeyEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageShow
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceChanged
)(
void
*
controllerRef
,
libkn_KInt
width
,
libkn_KInt
height
);
void
(
*
_Export_ArkUIViewController_onSurfaceCreated
)(
void
*
controllerRef
,
void
*
xcomponentPtr
,
libkn_KInt
width
,
libkn_KInt
height
);
void
(
*
_Export_ArkUIViewController_onSurfaceDestroyed
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceShow
)(
void
*
controllerRef
);
libkn_KInt
(
*
_Export_ArkUIViewController_requestSyncRefresh
)(
void
*
controllerRef
);
const
char
*
(
*
_Export_ArkUIViewController_sendMessage
)(
void
*
controllerRef
,
const
char
*
type
,
const
char
*
message
);
void
(
*
_Export_ArkUIViewController_setContext
)(
void
*
controllerRef
,
void
*
context
);
void
(
*
_Export_ArkUIViewController_setEnv
)(
void
*
controllerRef
,
void
*
env
);
void
(
*
_Export_ArkUIViewController_setId
)(
void
*
controllerRef
,
const
char
*
id
);
void
(
*
_Export_ArkUIViewController_setLocaleAndStringProvider
)(
void
*
controllerRef
,
void
*
provider
);
void
(
*
_Export_ArkUIViewController_setMessenger
)(
void
*
controllerRef
,
void
*
messenger
);
void
(
*
_Export_ArkUIViewController_setRenderBackendId
)(
void
*
controllerRef
,
libkn_KInt
backendId
);
void
(
*
_Export_ArkUIViewController_setRootView
)(
void
*
controllerRef
,
void
*
backRootView
,
void
*
foreRootView
,
void
*
touchableRootView
);
void
(
*
_Export_ArkUIViewController_setUIContext
)(
void
*
controllerRef
,
void
*
uiContext
);
void
(
*
_Export_ArkUIViewController_setXComponentRender
)(
void
*
controllerRef
,
void
*
render
);
void
(
*
buildInstance_
)(
void
*
env
,
void
*
func
);
void
*
(
*
createRootRenderNode_
)();
libkn_KLong
(
*
getCurrentTimeNanos
)();
void
(
*
renderNodeDraw_
)(
void
*
env
,
void
*
jsCanvas
,
void
*
jsNode
);
void
(
*
renderNodeNotifyRedraw_
)(
void
*
env
,
void
*
jsNode
);
void
(
*
setNodeConstructor_
)(
void
*
env
,
void
*
func
);
void
(
*
setPixelRatio_
)(
libkn_KDouble
ratio
);
void
(
*
_Export_ArkUIViewInitializer_init
)(
void
*
env
,
void
*
exports
);
}
arkui
;
}
ui
;
}
export_
;
}
compose
;
}
androidx
;
struct
{
struct
{
struct
{
...
...
harmonyApp/entry/src/main/ets/pages/Index.ets
View file @
90bf7f82
import { ArkUIViewController, Compose } from 'compose';
import { hilog } from '@kit.PerformanceAnalysisKit';
import nativeApi from 'libentry.so';
import { testArkTsToArkTs } from './TestJumpClass';
const DOMAIN = 0x0000;
@Entry
...
...
@@ -20,14 +20,13 @@ struct Index {
return;
}
let unusedInt:number = 0;//未使用的变量
hilog.info(DOMAIN, 'Compose', 'nativeApi is ready');
//ArkTs到Kotlin的单向跳转
nativeApi.testArkTsToKotin();
//原生内部跳转
testArkTsToArkTs();
try {
this.controller = nativeApi.MainArkUIViewController();
...
...
@@ -76,4 +75,41 @@ struct Index {
onBackPress(): boolean {
return this.controller ? this.controller.onBackPress() : false;
}
//测试-自定义鸿蒙原生函数
}
//测试性能-代码插入
function testPerformance(){
//性能测试插件测试点
}
//测试格式化
function testFormat(){
//测试后请复原
//输入"let a: number = 0;" 保留:和number的间距
//选中上列代码(将光标移至代码最左侧,长按向右覆盖整段代码,同复制时的选中复制内容的操作),输入快捷键
//Mac :Cmd + Option + L (默认)
//Windows:Ctrl + Alt + L (默认)
//观察是否复位 代码自动格式化为"let a:number = 0;"
//代码格式化测试点
}
//测试代码修复
function testRepair(){
//输入 "hilop.debug(DOMAIN, 'Compose', 'testRepair');"
//鼠标悬停在 "hilop"上,等待修复窗口出现,观察窗口上是否有修改为"hilog"相关的字样,点击修复选项(包含“change”相关字段)。
//修正为 hilog.debug(DOMAIN, 'Compose', 'testRepair');
//代码修复测试点
}
harmonyApp/entry/src/main/ets/pages/TestJumpClass.ets
0 → 100644
View file @
90bf7f82
import hilog from "@ohos.hilog"
export function testArkTsToArkTs(): void {
hilog.info(0x0001, "test", "ArkTsToArkJs");
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment