Commit 90bf7f82 authored by qq_38816927's avatar qq_38816927

线帧

parent aa0c52b6
......@@ -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(),
......
......@@ -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){
......
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
......@@ -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 {
......
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');
//代码修复测试点
}
import hilog from "@ohos.hilog"
export function testArkTsToArkTs(): void {
hilog.info(0x0001, "test", "ArkTsToArkJs");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment