feat(debug): supports debugging across files; supports watching variables; supports evaluate code on debug;

This commit is contained in:
hyb1996
2018-09-08 17:30:01 +08:00
parent 5329278e8d
commit a2c46d0787
27 changed files with 786 additions and 103 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#aaffa726"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginRight="8dp"
android:src="@drawable/ic_debug"/>
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/text_debug"
android:textColor="@android:color/white"
android:textSize="15sp"/>
<ImageView
android:id="@+id/execute"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_marginRight="8dp"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_script"
android:tint="@android:color/white"/>
<ImageView
android:id="@+id/add"
android:layout_width="28dp"
android:layout_height="28dp"
android:background="?selectableItemBackgroundBorderless"
android:src="@drawable/ic_add_white_48dp"
android:tint="@android:color/white"/>
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/variables"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.stardust.theme.widget.ThemeColorTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:text="@string/text_code"
android:textSize="14sp"/>
<EditText
android:id="@+id/code"
android:layout_width="match_parent"
android:paddingBottom="8dp"
android:paddingLeft="8dp"
android:textSize="15sp"
android:layout_height="wrap_content"
android:textColor="@android:color/primary_text_light"/>
<com.stardust.theme.widget.ThemeColorTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="8dp"
android:paddingLeft="8dp"
android:text="@string/text_result"
android:textSize="14sp"/>
<TextView
android:id="@+id/result"
android:paddingLeft="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#727377"
android:textSize="16sp"/>
</LinearLayout>

View File

@@ -88,6 +88,13 @@
android:layout_height="match_parent"
android:visibility="gone"/>
<org.autojs.autojs.ui.edit.debug.DebugBar
android:id="@+id/debug_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"/>
</LinearLayout>
<org.autojs.autojs.ui.widget.EWebView

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="28dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:background="?selectableItemBackground"
android:paddingLeft="12dp">
<TextView
android:id="@+id/variable"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@android:color/black"
android:textSize="14sp"
tools:text="variable = value"/>
<ImageView
android:id="@+id/icon"
android:layout_width="28dp"
android:layout_height="28dp"
android:background="?selectableItemBackgroundBorderless"
android:padding="2dp"
android:layout_marginRight="6dp"
android:src="@drawable/ic_delete_black_48dp"
android:tint="@android:color/white"/>
</LinearLayout>

View File

@@ -94,6 +94,11 @@
android:id="@+id/action_launch_debugger"
android:title="@string/text_launch_debugger"
app:showAsAction="never"/>
<item
android:id="@+id/action_remove_all_breakpoints"
android:title="@string/text_remove_all_breakpoints"
app:showAsAction="never"/>
</menu>
</item>

View File

@@ -367,4 +367,15 @@
<string name="text_debug_step_over">单步</string>
<string name="text_debug_resume_script">继续</string>
<string name="text_stop">停止</string>
<string name="text_new_watching_variable">增加监视的变量或表达式</string>
<string name="text_variable_or_expr">变量或表达式</string>
<string name="text_variable">变量</string>
<string name="text_remove_all_breakpoints">删除所有断点</string>
<string name="hint_long_click_run_to_debug">长按\"运行\"图标也可以启动调试</string>
<string name="format_debug_bar_title">调试 [%s]</string>
<string name="text_copy_value">复制值</string>
<string name="text_execute_code">执行代码</string>
<string name="text_code">代码</string>
<string name="text_result">结果</string>
<string name="text_close">关闭</string>
</resources>