You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-Perform the action that triggers the bug (e.g., clicking a button using `click`).
41
-
-Check if the debugger is paused using `debugger_get_paused_state`.
42
-
-**Note**: If `debugger_get_paused_state` returns "Debugger is not paused", wait a moment and try again, or ask the user to trigger the action if you cannot.
48
+
- Perform the action that triggers the bug (e.g., clicking a button using `click`).
49
+
- Check if the debugger is paused using `debugger_get_paused_state`.
50
+
-**Note**: If `debugger_get_paused_state` returns "Debugger is not paused", wait a moment and try again, or ask the user to trigger the action if you cannot.
43
51
44
52
4.**Inspect State (Runtime Mode)**:
45
-
- Once paused, examine the `callStack` returned by `debugger_get_paused_state`.
46
-
- Use `debugger_get_scope_variables` to see values of local variables.
47
-
- Use `debugger_evaluate_on_call_frame` to check specific expressions or deep objects.
53
+
- Once paused, examine the `callStack` returned by `debugger_get_paused_state`.
54
+
- Use `debugger_get_scope_variables` to see values of local variables.
55
+
- Use `debugger_evaluate_on_call_frame` to check specific expressions or deep objects.
56
+
48
57
```javascript
49
58
// Check local variables (scopeIndex 0 is usually Local)
-Use `debugger_step_into` to enter function calls.
55
-
- Use `debugger_step_over` to advance line-by-line.
56
-
- Use `debugger_step_out` to return to the caller.
57
-
- **Always** check `debugger_get_paused_state` and variable values after stepping to see how state changed.
63
+
- Use `debugger_step_into` to enter function calls.
64
+
- Use `debugger_step_over` to advance line-by-line.
65
+
- Use `debugger_step_out` to return to the caller.
66
+
- **Always** check `debugger_get_paused_state` and variable values after stepping to see how state changed.
58
67
59
68
6. **Verify Root Cause**:
60
-
- Explain exactly how the runtime state contradicts the expected logic.
61
-
- Point to the specific line of code that is the root cause.
69
+
- Explain exactly how the runtime state contradicts the expected logic.
70
+
- Point to the specific line of code that is the root cause.
62
71
63
72
7. **Apply Fix & Verify**:
64
-
- Once the issue is found, you can try to fix it (e.g., byeditingthefile).
65
-
- Remove breakpoints using `debugger_remove_breakpoint` or `debugger_remove_all_breakpoints`.
66
-
- Resume execution with `debugger_resume`.
67
-
- Verify the fix by reproducing the steps.
73
+
- Once the issue is found, you can try to fix it (e.g., byeditingthefile).
74
+
- Remove breakpoints using `debugger_remove_breakpoint` or `debugger_remove_all_breakpoints`.
75
+
- Resume execution with `debugger_resume`.
76
+
- Verify the fix by reproducing the steps.
77
+
78
+
## Logpoints (Non-breaking Breakpoints)
79
+
80
+
Use logpoints to trace execution without pausing. This is useful for debugging loops or high-frequency events.
81
+
82
+
1. **Set Logpoint**:
83
+
```javascript
84
+
// Logs "Value of x is 42" to the console
85
+
debugger_set_logpoint({
86
+
url:'...',
87
+
lineNumber:10,
88
+
message:'Value of x is {x}',
89
+
});
90
+
```
91
+
2.**View Output**:
92
+
- Use `list_console_messages` to see the logs.
93
+
- Logpoints doNOT pause execution.
68
94
69
95
## Tips
70
96
71
-
- **STATIC MODE** (Reading code) vs **RUNTIME MODE** (Paused): Switch between them. If you need to see a variable, switch to Runtime Mode by setting a breakpoint.
72
-
- **Already Paused?**: If you are already paused, start inspecting immediately.
73
-
- **Step Into**: Essential for investigating function calls on the current line.
74
-
- **Check Location**: Always confirm where you are with `debugger_get_paused_state` after stepping.
97
+
-**STATICMODE** (Reading code) vs **RUNTIMEMODE** (Paused): Switch between them. If you need to see a variable, switch to Runtime Mode by setting a breakpoint.
98
+
- **Already Paused?**: If you are already paused, start inspecting immediately.
99
+
- **Step Into**: Essential for investigating function calls on the current line.
100
+
- **Check Location**: Always confirm where you are with `debugger_get_paused_state` after stepping.
0 commit comments