moai-adk 0.4.4__py3-none-any.whl → 0.4.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of moai-adk might be problematic. Click here for more details.
- moai_adk/__init__.py +1 -1
- moai_adk/core/project/initializer.py +12 -5
- moai_adk/templates/.claude/agents/alfred/skill-factory.md +829 -0
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +78 -77
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +87 -77
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +76 -66
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +86 -59
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/reference.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +87 -73
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +87 -79
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +87 -71
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +78 -62
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +78 -55
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +78 -64
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +604 -56
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +974 -44
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/reference.md +801 -0
- moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +88 -61
- moai_adk/templates/.claude/skills/moai-claude-code/examples.md +16 -500
- moai_adk/templates/.claude/skills/moai-claude-code/reference.md +15 -420
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +234 -43
- moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +1633 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +660 -0
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +97 -69
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +97 -72
- moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-domain-database/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-database/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +98 -73
- moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +97 -73
- moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +97 -67
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +97 -79
- moai_adk/templates/.claude/skills/moai-domain-security/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-security/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -71
- moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +656 -60
- moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +1107 -0
- moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +1533 -0
- moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +87 -78
- moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +87 -70
- moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +87 -86
- moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +77 -62
- moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +88 -56
- moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +90 -71
- moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +78 -58
- moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +78 -51
- moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +253 -32
- moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
- moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +1099 -0
- moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-c/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-c/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-lang-clojure/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-clojure/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +98 -76
- moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +86 -61
- moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +98 -73
- moai_adk/templates/.claude/skills/moai-lang-elixir/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-elixir/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-go/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-go/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-haskell/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-haskell/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +87 -61
- moai_adk/templates/.claude/skills/moai-lang-java/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-java/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +88 -59
- moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +32 -0
- moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +86 -61
- moai_adk/templates/.claude/skills/moai-lang-julia/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-julia/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +98 -73
- moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +86 -61
- moai_adk/templates/.claude/skills/moai-lang-lua/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-lua/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +86 -61
- moai_adk/templates/.claude/skills/moai-lang-php/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-php/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +388 -53
- moai_adk/templates/.claude/skills/moai-lang-python/examples.md +624 -0
- moai_adk/templates/.claude/skills/moai-lang-python/reference.md +316 -0
- moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +97 -73
- moai_adk/templates/.claude/skills/moai-lang-r/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-r/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +98 -73
- moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +97 -73
- moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +90 -59
- moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +34 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/CHECKLIST.md +482 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/EXAMPLES.md +52 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/INTERACTIVE-DISCOVERY.md +524 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/METADATA.md +477 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-UPDATE-ADVISOR.md +577 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/SKILL.md +560 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/STRUCTURE.md +583 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/WEB-RESEARCH.md +526 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/reference.md +69 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/scripts/generate-structure.sh +328 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/scripts/validate-skill.sh +312 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/templates/SKILL_TEMPLATE.md +245 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/templates/examples-template.md +285 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/templates/reference-template.md +278 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/templates/scripts-template.sh +303 -0
- moai_adk/templates/CLAUDE.md +43 -11
- moai_adk-0.4.7.dist-info/METADATA +1162 -0
- moai_adk-0.4.7.dist-info/RECORD +275 -0
- moai_adk-0.4.4.dist-info/METADATA +0 -369
- moai_adk-0.4.4.dist-info/RECORD +0 -152
- {moai_adk-0.4.4.dist-info → moai_adk-0.4.7.dist-info}/WHEEL +0 -0
- {moai_adk-0.4.4.dist-info → moai_adk-0.4.7.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.4.4.dist-info → moai_adk-0.4.7.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,1533 @@
|
|
|
1
|
+
# MoAI Essentials Debug - Language Reference Guide
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
1. [Systems Programming](#systems-programming)
|
|
5
|
+
2. [JVM Ecosystem](#jvm-ecosystem)
|
|
6
|
+
3. [Scripting Languages](#scripting-languages)
|
|
7
|
+
4. [Web & Mobile](#web--mobile)
|
|
8
|
+
5. [Functional & Concurrency](#functional--concurrency)
|
|
9
|
+
6. [Enterprise & Data](#enterprise--data)
|
|
10
|
+
7. [Container & Distributed Systems](#container--distributed-systems)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Systems Programming
|
|
15
|
+
|
|
16
|
+
### C
|
|
17
|
+
|
|
18
|
+
#### Installation
|
|
19
|
+
```bash
|
|
20
|
+
# Linux/macOS (usually pre-installed)
|
|
21
|
+
which gdb
|
|
22
|
+
|
|
23
|
+
# macOS with Homebrew
|
|
24
|
+
brew install gdb
|
|
25
|
+
|
|
26
|
+
# Ubuntu/Debian
|
|
27
|
+
sudo apt-get install gdb
|
|
28
|
+
|
|
29
|
+
# LLDB alternative
|
|
30
|
+
brew install llvm # macOS
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### CLI Usage
|
|
34
|
+
```bash
|
|
35
|
+
# Basic debugging
|
|
36
|
+
gdb ./program
|
|
37
|
+
(gdb) break main
|
|
38
|
+
(gdb) run arg1 arg2
|
|
39
|
+
(gdb) step # Step into
|
|
40
|
+
(gdb) next # Step over
|
|
41
|
+
(gdb) continue # Continue execution
|
|
42
|
+
(gdb) print var # Inspect variable
|
|
43
|
+
(gdb) backtrace # Stack trace
|
|
44
|
+
|
|
45
|
+
# Debug with core dump
|
|
46
|
+
gdb ./program core
|
|
47
|
+
|
|
48
|
+
# Attach to running process
|
|
49
|
+
gdb -p <pid>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### VSCode Configuration
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"version": "0.2.0",
|
|
56
|
+
"configurations": [
|
|
57
|
+
{
|
|
58
|
+
"name": "C: Debug",
|
|
59
|
+
"type": "cppdbg",
|
|
60
|
+
"request": "launch",
|
|
61
|
+
"program": "${workspaceFolder}/build/myapp",
|
|
62
|
+
"args": [],
|
|
63
|
+
"stopAtEntry": false,
|
|
64
|
+
"cwd": "${workspaceFolder}",
|
|
65
|
+
"environment": [],
|
|
66
|
+
"externalConsole": false,
|
|
67
|
+
"MIMode": "gdb",
|
|
68
|
+
"setupCommands": [
|
|
69
|
+
{
|
|
70
|
+
"description": "Enable pretty-printing",
|
|
71
|
+
"text": "-enable-pretty-printing",
|
|
72
|
+
"ignoreFailures": true
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### Common Commands
|
|
81
|
+
```bash
|
|
82
|
+
# Watchpoints
|
|
83
|
+
watch variable_name # Break when variable changes
|
|
84
|
+
|
|
85
|
+
# Conditional breakpoints
|
|
86
|
+
break line_number if condition
|
|
87
|
+
|
|
88
|
+
# Memory inspection
|
|
89
|
+
x/10x address # Display 10 hex values at address
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### C++
|
|
95
|
+
|
|
96
|
+
#### Installation
|
|
97
|
+
Same as C (gdb/lldb), plus sanitizers:
|
|
98
|
+
```bash
|
|
99
|
+
# Compile with AddressSanitizer
|
|
100
|
+
g++ -fsanitize=address -g program.cpp -o program
|
|
101
|
+
|
|
102
|
+
# Valgrind for memory analysis
|
|
103
|
+
sudo apt-get install valgrind
|
|
104
|
+
brew install valgrind # macOS
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### CLI Usage
|
|
108
|
+
```bash
|
|
109
|
+
# GDB with C++ pretty-printers
|
|
110
|
+
gdb ./program
|
|
111
|
+
(gdb) set print pretty on
|
|
112
|
+
(gdb) set print object on
|
|
113
|
+
|
|
114
|
+
# LLDB
|
|
115
|
+
lldb ./program
|
|
116
|
+
(lldb) breakpoint set -n main
|
|
117
|
+
(lldb) process launch -- arg1 arg2
|
|
118
|
+
(lldb) thread backtrace
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### Valgrind Usage
|
|
122
|
+
```bash
|
|
123
|
+
# Memory leak detection
|
|
124
|
+
valgrind --leak-check=full --show-leak-kinds=all ./program
|
|
125
|
+
|
|
126
|
+
# Callgrind profiling
|
|
127
|
+
valgrind --tool=callgrind ./program
|
|
128
|
+
callgrind_annotate callgrind.out.<pid>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### VSCode Configuration
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"version": "0.2.0",
|
|
135
|
+
"configurations": [
|
|
136
|
+
{
|
|
137
|
+
"name": "C++: Debug",
|
|
138
|
+
"type": "cppdbg",
|
|
139
|
+
"request": "launch",
|
|
140
|
+
"program": "${workspaceFolder}/build/myapp",
|
|
141
|
+
"args": [],
|
|
142
|
+
"stopAtEntry": false,
|
|
143
|
+
"cwd": "${workspaceFolder}",
|
|
144
|
+
"environment": [],
|
|
145
|
+
"externalConsole": false,
|
|
146
|
+
"MIMode": "gdb",
|
|
147
|
+
"miDebuggerPath": "/usr/bin/gdb"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### Rust
|
|
156
|
+
|
|
157
|
+
#### Installation
|
|
158
|
+
```bash
|
|
159
|
+
# Installed with rustup (automatic)
|
|
160
|
+
rustup component add rust-src
|
|
161
|
+
rustup component add rust-analyzer
|
|
162
|
+
|
|
163
|
+
# VSCode extension
|
|
164
|
+
code --install-extension vadimcn.vscode-lldb
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### CLI Usage
|
|
168
|
+
```bash
|
|
169
|
+
# Run with backtrace
|
|
170
|
+
RUST_BACKTRACE=1 cargo run
|
|
171
|
+
RUST_BACKTRACE=full cargo run
|
|
172
|
+
|
|
173
|
+
# Debug build
|
|
174
|
+
cargo build
|
|
175
|
+
rust-lldb target/debug/myapp
|
|
176
|
+
|
|
177
|
+
# In LLDB
|
|
178
|
+
(lldb) b main
|
|
179
|
+
(lldb) r
|
|
180
|
+
(lldb) bt # Backtrace
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### VSCode Configuration
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"version": "0.2.0",
|
|
187
|
+
"configurations": [
|
|
188
|
+
{
|
|
189
|
+
"type": "lldb",
|
|
190
|
+
"request": "launch",
|
|
191
|
+
"name": "Debug executable",
|
|
192
|
+
"cargo": {
|
|
193
|
+
"args": [
|
|
194
|
+
"build",
|
|
195
|
+
"--bin=myapp",
|
|
196
|
+
"--package=myapp"
|
|
197
|
+
],
|
|
198
|
+
"filter": {
|
|
199
|
+
"name": "myapp",
|
|
200
|
+
"kind": "bin"
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"args": [],
|
|
204
|
+
"cwd": "${workspaceFolder}"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"type": "lldb",
|
|
208
|
+
"request": "launch",
|
|
209
|
+
"name": "Debug unit tests",
|
|
210
|
+
"cargo": {
|
|
211
|
+
"args": [
|
|
212
|
+
"test",
|
|
213
|
+
"--no-run",
|
|
214
|
+
"--lib",
|
|
215
|
+
"--package=myapp"
|
|
216
|
+
],
|
|
217
|
+
"filter": {
|
|
218
|
+
"name": "myapp",
|
|
219
|
+
"kind": "lib"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"args": [],
|
|
223
|
+
"cwd": "${workspaceFolder}"
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
### Go
|
|
232
|
+
|
|
233
|
+
#### Installation
|
|
234
|
+
```bash
|
|
235
|
+
# Install Delve
|
|
236
|
+
go install github.com/go-delve/delve/cmd/dlv@latest
|
|
237
|
+
|
|
238
|
+
# Verify
|
|
239
|
+
dlv version
|
|
240
|
+
|
|
241
|
+
# VSCode extension
|
|
242
|
+
code --install-extension golang.go
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
#### CLI Usage
|
|
246
|
+
```bash
|
|
247
|
+
# Debug main package
|
|
248
|
+
dlv debug
|
|
249
|
+
|
|
250
|
+
# Debug with arguments
|
|
251
|
+
dlv debug -- --config=dev.json
|
|
252
|
+
|
|
253
|
+
# Debug tests
|
|
254
|
+
dlv test
|
|
255
|
+
|
|
256
|
+
# Attach to running process
|
|
257
|
+
dlv attach <pid>
|
|
258
|
+
|
|
259
|
+
# Remote debugging
|
|
260
|
+
dlv debug --headless --listen=:2345 --api-version=2
|
|
261
|
+
|
|
262
|
+
# In Delve
|
|
263
|
+
(dlv) break main.main
|
|
264
|
+
(dlv) continue
|
|
265
|
+
(dlv) print myVar
|
|
266
|
+
(dlv) goroutines # List all goroutines
|
|
267
|
+
(dlv) goroutine 5 bt # Stack trace for goroutine 5
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
#### VSCode Configuration
|
|
271
|
+
```json
|
|
272
|
+
{
|
|
273
|
+
"version": "0.2.0",
|
|
274
|
+
"configurations": [
|
|
275
|
+
{
|
|
276
|
+
"name": "Launch Package",
|
|
277
|
+
"type": "go",
|
|
278
|
+
"request": "launch",
|
|
279
|
+
"mode": "auto",
|
|
280
|
+
"program": "${workspaceFolder}",
|
|
281
|
+
"env": {},
|
|
282
|
+
"args": []
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"name": "Launch File",
|
|
286
|
+
"type": "go",
|
|
287
|
+
"request": "launch",
|
|
288
|
+
"mode": "debug",
|
|
289
|
+
"program": "${file}"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"name": "Attach to Process",
|
|
293
|
+
"type": "go",
|
|
294
|
+
"request": "attach",
|
|
295
|
+
"mode": "local",
|
|
296
|
+
"processId": "${command:pickProcess}"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"name": "Connect to Remote",
|
|
300
|
+
"type": "go",
|
|
301
|
+
"request": "attach",
|
|
302
|
+
"mode": "remote",
|
|
303
|
+
"remotePath": "/app",
|
|
304
|
+
"port": 2345,
|
|
305
|
+
"host": "localhost"
|
|
306
|
+
}
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## JVM Ecosystem
|
|
314
|
+
|
|
315
|
+
### Java
|
|
316
|
+
|
|
317
|
+
#### Installation
|
|
318
|
+
```bash
|
|
319
|
+
# JDB comes with JDK
|
|
320
|
+
java -version
|
|
321
|
+
jdb -version
|
|
322
|
+
|
|
323
|
+
# IntelliJ IDEA (recommended for GUI debugging)
|
|
324
|
+
# Download from jetbrains.com
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
#### CLI Usage
|
|
328
|
+
```bash
|
|
329
|
+
# Start application with debug port
|
|
330
|
+
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -jar app.jar
|
|
331
|
+
|
|
332
|
+
# Connect with JDB
|
|
333
|
+
jdb -attach localhost:5005
|
|
334
|
+
|
|
335
|
+
# JDB commands
|
|
336
|
+
> stop at ClassName:lineNumber
|
|
337
|
+
> run
|
|
338
|
+
> step
|
|
339
|
+
> next
|
|
340
|
+
> print variable
|
|
341
|
+
> locals
|
|
342
|
+
> where # Stack trace
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
#### Remote Debugging Setup
|
|
346
|
+
```bash
|
|
347
|
+
# Server side
|
|
348
|
+
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5005 -jar app.jar
|
|
349
|
+
|
|
350
|
+
# Or with modern syntax
|
|
351
|
+
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -jar app.jar
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
#### VSCode Configuration
|
|
355
|
+
```json
|
|
356
|
+
{
|
|
357
|
+
"version": "0.2.0",
|
|
358
|
+
"configurations": [
|
|
359
|
+
{
|
|
360
|
+
"type": "java",
|
|
361
|
+
"name": "Debug (Launch)",
|
|
362
|
+
"request": "launch",
|
|
363
|
+
"mainClass": "com.example.Main",
|
|
364
|
+
"projectName": "myapp"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"type": "java",
|
|
368
|
+
"name": "Debug (Attach)",
|
|
369
|
+
"request": "attach",
|
|
370
|
+
"hostName": "localhost",
|
|
371
|
+
"port": 5005
|
|
372
|
+
}
|
|
373
|
+
]
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
#### IntelliJ IDEA Setup
|
|
378
|
+
1. Run → Edit Configurations
|
|
379
|
+
2. Add New Configuration → Remote JVM Debug
|
|
380
|
+
3. Set host and port
|
|
381
|
+
4. Set breakpoints and click Debug
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
### Kotlin
|
|
386
|
+
|
|
387
|
+
#### Installation
|
|
388
|
+
Same as Java (uses JVM debug infrastructure)
|
|
389
|
+
|
|
390
|
+
#### CLI Usage
|
|
391
|
+
```bash
|
|
392
|
+
# Gradle with debug
|
|
393
|
+
./gradlew run --debug-jvm
|
|
394
|
+
|
|
395
|
+
# Maven with debug
|
|
396
|
+
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5005"
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
#### Coroutine Debugging
|
|
400
|
+
```kotlin
|
|
401
|
+
// Enable coroutine debugging
|
|
402
|
+
System.setProperty("kotlinx.coroutines.debug", "on")
|
|
403
|
+
|
|
404
|
+
// In IntelliJ IDEA:
|
|
405
|
+
// Run → Edit Configurations → VM Options:
|
|
406
|
+
-Dkotlinx.coroutines.debug
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
#### VSCode Configuration
|
|
410
|
+
Same as Java, works with Kotlin bytecode
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
### Scala
|
|
415
|
+
|
|
416
|
+
#### Installation
|
|
417
|
+
```bash
|
|
418
|
+
# sbt with debug support
|
|
419
|
+
sbt
|
|
420
|
+
|
|
421
|
+
# Metals language server (VSCode)
|
|
422
|
+
code --install-extension scalameta.metals
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
#### CLI Usage
|
|
426
|
+
```bash
|
|
427
|
+
# sbt with debug port
|
|
428
|
+
sbt -jvm-debug 5005
|
|
429
|
+
|
|
430
|
+
# In sbt shell
|
|
431
|
+
sbt:myapp> ~run # Continuous compilation + run
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
#### VSCode Configuration
|
|
435
|
+
```json
|
|
436
|
+
{
|
|
437
|
+
"version": "0.2.0",
|
|
438
|
+
"configurations": [
|
|
439
|
+
{
|
|
440
|
+
"type": "scala",
|
|
441
|
+
"request": "launch",
|
|
442
|
+
"name": "Launch Scala App",
|
|
443
|
+
"mainClass": "com.example.Main",
|
|
444
|
+
"args": [],
|
|
445
|
+
"jvmOptions": []
|
|
446
|
+
}
|
|
447
|
+
]
|
|
448
|
+
}
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
---
|
|
452
|
+
|
|
453
|
+
### Clojure
|
|
454
|
+
|
|
455
|
+
#### Installation
|
|
456
|
+
```bash
|
|
457
|
+
# Leiningen
|
|
458
|
+
brew install leiningen # macOS
|
|
459
|
+
# Ubuntu: see leiningen.org
|
|
460
|
+
|
|
461
|
+
# CIDER (Emacs)
|
|
462
|
+
# Add to ~/.emacs: (require 'cider)
|
|
463
|
+
|
|
464
|
+
# Cursive (IntelliJ)
|
|
465
|
+
# Install from JetBrains Marketplace
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
#### REPL-Based Debugging
|
|
469
|
+
```clojure
|
|
470
|
+
; Load file in REPL
|
|
471
|
+
(load-file "src/myapp/core.clj")
|
|
472
|
+
|
|
473
|
+
; Add breakpoints
|
|
474
|
+
(require '[clojure.tools.trace :as trace])
|
|
475
|
+
(trace/trace-ns 'myapp.core)
|
|
476
|
+
|
|
477
|
+
; Call function to see trace
|
|
478
|
+
(myapp.core/my-function arg1 arg2)
|
|
479
|
+
|
|
480
|
+
; Inspect vars
|
|
481
|
+
(def result (my-function arg1))
|
|
482
|
+
(println result)
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
#### Leiningen Debug Plugin
|
|
486
|
+
```bash
|
|
487
|
+
# project.clj
|
|
488
|
+
:plugins [[cider/cider-nrepl "0.30.0"]]
|
|
489
|
+
|
|
490
|
+
# Start REPL with debug
|
|
491
|
+
lein repl
|
|
492
|
+
|
|
493
|
+
# Connect to running process
|
|
494
|
+
lein repl :connect 5005
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
## Scripting Languages
|
|
500
|
+
|
|
501
|
+
### Python
|
|
502
|
+
|
|
503
|
+
#### Installation
|
|
504
|
+
```bash
|
|
505
|
+
# pdb (built-in, no installation needed)
|
|
506
|
+
python3 -m pdb
|
|
507
|
+
|
|
508
|
+
# Enhanced debuggers
|
|
509
|
+
pip install pudb ipdb debugpy
|
|
510
|
+
|
|
511
|
+
# VSCode extension
|
|
512
|
+
code --install-extension ms-python.python
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
#### CLI Usage
|
|
516
|
+
```bash
|
|
517
|
+
# pdb
|
|
518
|
+
python -m pdb script.py
|
|
519
|
+
(Pdb) break script.py:42
|
|
520
|
+
(Pdb) continue
|
|
521
|
+
(Pdb) step
|
|
522
|
+
(Pdb) next
|
|
523
|
+
(Pdb) print variable
|
|
524
|
+
(Pdb) list # Show code context
|
|
525
|
+
(Pdb) where # Stack trace
|
|
526
|
+
|
|
527
|
+
# pudb (TUI)
|
|
528
|
+
pudb script.py
|
|
529
|
+
|
|
530
|
+
# ipdb (IPython-enhanced)
|
|
531
|
+
ipdb script.py
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
#### Code-Level Debugging
|
|
535
|
+
```python
|
|
536
|
+
# Insert breakpoint
|
|
537
|
+
import pdb; pdb.set_trace()
|
|
538
|
+
|
|
539
|
+
# Python 3.7+
|
|
540
|
+
breakpoint()
|
|
541
|
+
|
|
542
|
+
# Remote debugging with debugpy
|
|
543
|
+
import debugpy
|
|
544
|
+
debugpy.listen(5678)
|
|
545
|
+
print("Waiting for debugger attach...")
|
|
546
|
+
debugpy.wait_for_client()
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
#### VSCode Configuration
|
|
550
|
+
```json
|
|
551
|
+
{
|
|
552
|
+
"version": "0.2.0",
|
|
553
|
+
"configurations": [
|
|
554
|
+
{
|
|
555
|
+
"name": "Python: Current File",
|
|
556
|
+
"type": "debugpy",
|
|
557
|
+
"request": "launch",
|
|
558
|
+
"program": "${file}",
|
|
559
|
+
"console": "integratedTerminal",
|
|
560
|
+
"justMyCode": false
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"name": "Python: Remote Attach",
|
|
564
|
+
"type": "debugpy",
|
|
565
|
+
"request": "attach",
|
|
566
|
+
"connect": {
|
|
567
|
+
"host": "localhost",
|
|
568
|
+
"port": 5678
|
|
569
|
+
},
|
|
570
|
+
"pathMappings": [
|
|
571
|
+
{
|
|
572
|
+
"localRoot": "${workspaceFolder}",
|
|
573
|
+
"remoteRoot": "/app"
|
|
574
|
+
}
|
|
575
|
+
]
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"name": "Python: Django",
|
|
579
|
+
"type": "debugpy",
|
|
580
|
+
"request": "launch",
|
|
581
|
+
"program": "${workspaceFolder}/manage.py",
|
|
582
|
+
"args": ["runserver", "--noreload"],
|
|
583
|
+
"django": true
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"name": "Python: Flask",
|
|
587
|
+
"type": "debugpy",
|
|
588
|
+
"request": "launch",
|
|
589
|
+
"module": "flask",
|
|
590
|
+
"env": {
|
|
591
|
+
"FLASK_APP": "app.py",
|
|
592
|
+
"FLASK_DEBUG": "1"
|
|
593
|
+
},
|
|
594
|
+
"args": ["run", "--no-debugger"],
|
|
595
|
+
"jinja": true
|
|
596
|
+
}
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
#### Async Debugging
|
|
602
|
+
```python
|
|
603
|
+
import asyncio
|
|
604
|
+
import pdb
|
|
605
|
+
|
|
606
|
+
async def debug_async():
|
|
607
|
+
await asyncio.sleep(1)
|
|
608
|
+
breakpoint() # Works in async context
|
|
609
|
+
await asyncio.sleep(1)
|
|
610
|
+
|
|
611
|
+
asyncio.run(debug_async())
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
---
|
|
615
|
+
|
|
616
|
+
### Ruby
|
|
617
|
+
|
|
618
|
+
#### Installation
|
|
619
|
+
```bash
|
|
620
|
+
# Ruby 3.2+ (built-in debug gem)
|
|
621
|
+
ruby -v
|
|
622
|
+
|
|
623
|
+
# For older versions
|
|
624
|
+
gem install debug
|
|
625
|
+
|
|
626
|
+
# Alternative debuggers
|
|
627
|
+
gem install byebug
|
|
628
|
+
gem install pry-byebug
|
|
629
|
+
|
|
630
|
+
# VSCode extension
|
|
631
|
+
code --install-extension Shopify.ruby-lsp
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
#### CLI Usage
|
|
635
|
+
```bash
|
|
636
|
+
# debug gem
|
|
637
|
+
ruby -r debug script.rb
|
|
638
|
+
|
|
639
|
+
# In code
|
|
640
|
+
require 'debug'
|
|
641
|
+
binding.break
|
|
642
|
+
|
|
643
|
+
# byebug
|
|
644
|
+
byebug script.rb
|
|
645
|
+
|
|
646
|
+
# Commands
|
|
647
|
+
(rdbg) break script.rb:42
|
|
648
|
+
(rdbg) continue
|
|
649
|
+
(rdbg) step
|
|
650
|
+
(rdbg) next
|
|
651
|
+
(rdbg) display variable
|
|
652
|
+
(rdbg) backtrace
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
#### Rails Debugging
|
|
656
|
+
```ruby
|
|
657
|
+
# In controller/view
|
|
658
|
+
binding.break # Ruby 3.2+
|
|
659
|
+
byebug # Older versions
|
|
660
|
+
|
|
661
|
+
# Start Rails with debugger
|
|
662
|
+
rails server
|
|
663
|
+
# Trigger breakpoint, debugger opens in terminal
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
#### VSCode Configuration
|
|
667
|
+
```json
|
|
668
|
+
{
|
|
669
|
+
"version": "0.2.0",
|
|
670
|
+
"configurations": [
|
|
671
|
+
{
|
|
672
|
+
"name": "Debug Ruby",
|
|
673
|
+
"type": "rdbg",
|
|
674
|
+
"request": "launch",
|
|
675
|
+
"script": "${file}",
|
|
676
|
+
"args": [],
|
|
677
|
+
"useBundler": true
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"name": "Debug Rails",
|
|
681
|
+
"type": "rdbg",
|
|
682
|
+
"request": "launch",
|
|
683
|
+
"command": "rails",
|
|
684
|
+
"script": "server",
|
|
685
|
+
"args": [],
|
|
686
|
+
"useBundler": true
|
|
687
|
+
}
|
|
688
|
+
]
|
|
689
|
+
}
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
---
|
|
693
|
+
|
|
694
|
+
### PHP
|
|
695
|
+
|
|
696
|
+
#### Installation
|
|
697
|
+
```bash
|
|
698
|
+
# Xdebug (most common)
|
|
699
|
+
# Ubuntu/Debian
|
|
700
|
+
sudo apt-get install php-xdebug
|
|
701
|
+
|
|
702
|
+
# macOS with Homebrew
|
|
703
|
+
brew install php
|
|
704
|
+
pecl install xdebug
|
|
705
|
+
|
|
706
|
+
# Configure php.ini
|
|
707
|
+
zend_extension=xdebug.so
|
|
708
|
+
xdebug.mode=debug
|
|
709
|
+
xdebug.start_with_request=yes
|
|
710
|
+
xdebug.client_port=9003
|
|
711
|
+
|
|
712
|
+
# VSCode extension
|
|
713
|
+
code --install-extension xdebug.php-debug
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
#### CLI Usage
|
|
717
|
+
```bash
|
|
718
|
+
# phpdbg (built-in CLI debugger)
|
|
719
|
+
phpdbg -qrr script.php
|
|
720
|
+
|
|
721
|
+
# phpdbg commands
|
|
722
|
+
phpdbg> break file.php:42
|
|
723
|
+
phpdbg> run
|
|
724
|
+
phpdbg> step
|
|
725
|
+
phpdbg> print $variable
|
|
726
|
+
|
|
727
|
+
# Xdebug from command line
|
|
728
|
+
php -dxdebug.mode=debug -dxdebug.start_with_request=yes script.php
|
|
729
|
+
```
|
|
730
|
+
|
|
731
|
+
#### VSCode Configuration
|
|
732
|
+
```json
|
|
733
|
+
{
|
|
734
|
+
"version": "0.2.0",
|
|
735
|
+
"configurations": [
|
|
736
|
+
{
|
|
737
|
+
"name": "Listen for Xdebug",
|
|
738
|
+
"type": "php",
|
|
739
|
+
"request": "launch",
|
|
740
|
+
"port": 9003,
|
|
741
|
+
"pathMappings": {
|
|
742
|
+
"/var/www/html": "${workspaceFolder}"
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
"name": "Launch current script",
|
|
747
|
+
"type": "php",
|
|
748
|
+
"request": "launch",
|
|
749
|
+
"program": "${file}",
|
|
750
|
+
"cwd": "${workspaceFolder}",
|
|
751
|
+
"port": 9003
|
|
752
|
+
}
|
|
753
|
+
]
|
|
754
|
+
}
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
#### Laravel Debugging
|
|
758
|
+
```php
|
|
759
|
+
// Use Laravel Debugbar
|
|
760
|
+
composer require barryvdh/laravel-debugbar --dev
|
|
761
|
+
|
|
762
|
+
// Or Telescope for advanced debugging
|
|
763
|
+
composer require laravel/telescope --dev
|
|
764
|
+
php artisan telescope:install
|
|
765
|
+
```
|
|
766
|
+
|
|
767
|
+
---
|
|
768
|
+
|
|
769
|
+
### Lua
|
|
770
|
+
|
|
771
|
+
#### Installation
|
|
772
|
+
```bash
|
|
773
|
+
# ZeroBrane Studio (GUI)
|
|
774
|
+
# Download from studio.zerobrane.com
|
|
775
|
+
|
|
776
|
+
# MobDebug
|
|
777
|
+
luarocks install mobdebug
|
|
778
|
+
|
|
779
|
+
# VSCode extension
|
|
780
|
+
code --install-extension actboy168.lua-debug
|
|
781
|
+
```
|
|
782
|
+
|
|
783
|
+
#### CLI Usage
|
|
784
|
+
```lua
|
|
785
|
+
-- MobDebug
|
|
786
|
+
local mobdebug = require('mobdebug')
|
|
787
|
+
mobdebug.start() -- Start debugging session
|
|
788
|
+
|
|
789
|
+
-- In code
|
|
790
|
+
mobdebug.pause() -- Breakpoint
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
#### VSCode Configuration
|
|
794
|
+
```json
|
|
795
|
+
{
|
|
796
|
+
"version": "0.2.0",
|
|
797
|
+
"configurations": [
|
|
798
|
+
{
|
|
799
|
+
"name": "Debug Lua",
|
|
800
|
+
"type": "lua",
|
|
801
|
+
"request": "launch",
|
|
802
|
+
"program": "${file}"
|
|
803
|
+
}
|
|
804
|
+
]
|
|
805
|
+
}
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
---
|
|
809
|
+
|
|
810
|
+
### Shell (Bash)
|
|
811
|
+
|
|
812
|
+
#### Built-in Debugging
|
|
813
|
+
```bash
|
|
814
|
+
# Trace mode
|
|
815
|
+
bash -x script.sh
|
|
816
|
+
|
|
817
|
+
# Or in script
|
|
818
|
+
#!/bin/bash
|
|
819
|
+
set -x # Enable tracing
|
|
820
|
+
# ... code ...
|
|
821
|
+
set +x # Disable tracing
|
|
822
|
+
|
|
823
|
+
# Custom trace format
|
|
824
|
+
PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
|
|
825
|
+
set -x
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
#### Debugging Options
|
|
829
|
+
```bash
|
|
830
|
+
# Exit on error
|
|
831
|
+
set -e
|
|
832
|
+
|
|
833
|
+
# Exit on undefined variable
|
|
834
|
+
set -u
|
|
835
|
+
|
|
836
|
+
# Exit on pipe failure
|
|
837
|
+
set -o pipefail
|
|
838
|
+
|
|
839
|
+
# Combine (common)
|
|
840
|
+
set -euo pipefail
|
|
841
|
+
```
|
|
842
|
+
|
|
843
|
+
#### VSCode Configuration
|
|
844
|
+
```json
|
|
845
|
+
{
|
|
846
|
+
"version": "0.2.0",
|
|
847
|
+
"configurations": [
|
|
848
|
+
{
|
|
849
|
+
"name": "Bash-Debug",
|
|
850
|
+
"type": "bashdb",
|
|
851
|
+
"request": "launch",
|
|
852
|
+
"program": "${file}",
|
|
853
|
+
"cwd": "${workspaceFolder}",
|
|
854
|
+
"args": [],
|
|
855
|
+
"internalConsoleOptions": "openOnSessionStart"
|
|
856
|
+
}
|
|
857
|
+
]
|
|
858
|
+
}
|
|
859
|
+
```
|
|
860
|
+
|
|
861
|
+
---
|
|
862
|
+
|
|
863
|
+
## Web & Mobile
|
|
864
|
+
|
|
865
|
+
### JavaScript (Node.js)
|
|
866
|
+
|
|
867
|
+
#### Installation
|
|
868
|
+
```bash
|
|
869
|
+
# Built-in with Node.js
|
|
870
|
+
node --version
|
|
871
|
+
|
|
872
|
+
# VSCode (built-in debugger)
|
|
873
|
+
```
|
|
874
|
+
|
|
875
|
+
#### CLI Usage
|
|
876
|
+
```bash
|
|
877
|
+
# Start with inspector
|
|
878
|
+
node --inspect script.js
|
|
879
|
+
|
|
880
|
+
# Start with inspector and break at first line
|
|
881
|
+
node --inspect-brk script.js
|
|
882
|
+
|
|
883
|
+
# Connect with Chrome DevTools
|
|
884
|
+
# Navigate to chrome://inspect
|
|
885
|
+
|
|
886
|
+
# Built-in REPL debugging
|
|
887
|
+
node inspect script.js
|
|
888
|
+
debug> cont
|
|
889
|
+
debug> next
|
|
890
|
+
debug> step
|
|
891
|
+
debug> repl # Evaluate expressions
|
|
892
|
+
```
|
|
893
|
+
|
|
894
|
+
#### Code-Level Debugging
|
|
895
|
+
```javascript
|
|
896
|
+
// Trigger debugger breakpoint
|
|
897
|
+
debugger;
|
|
898
|
+
|
|
899
|
+
// When Chrome DevTools is open, execution will pause here
|
|
900
|
+
```
|
|
901
|
+
|
|
902
|
+
#### VSCode Configuration
|
|
903
|
+
```json
|
|
904
|
+
{
|
|
905
|
+
"version": "0.2.0",
|
|
906
|
+
"configurations": [
|
|
907
|
+
{
|
|
908
|
+
"type": "node",
|
|
909
|
+
"request": "launch",
|
|
910
|
+
"name": "Launch Program",
|
|
911
|
+
"skipFiles": ["<node_internals>/**"],
|
|
912
|
+
"program": "${workspaceFolder}/app.js"
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
"type": "node",
|
|
916
|
+
"request": "attach",
|
|
917
|
+
"name": "Attach",
|
|
918
|
+
"port": 9229,
|
|
919
|
+
"skipFiles": ["<node_internals>/**"]
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
"name": "Jest Tests",
|
|
923
|
+
"type": "node",
|
|
924
|
+
"request": "launch",
|
|
925
|
+
"runtimeArgs": [
|
|
926
|
+
"--inspect-brk",
|
|
927
|
+
"${workspaceFolder}/node_modules/.bin/jest",
|
|
928
|
+
"--runInBand"
|
|
929
|
+
],
|
|
930
|
+
"console": "integratedTerminal"
|
|
931
|
+
}
|
|
932
|
+
]
|
|
933
|
+
}
|
|
934
|
+
```
|
|
935
|
+
|
|
936
|
+
---
|
|
937
|
+
|
|
938
|
+
### TypeScript
|
|
939
|
+
|
|
940
|
+
#### Installation
|
|
941
|
+
```bash
|
|
942
|
+
# TypeScript + ts-node
|
|
943
|
+
npm install -D typescript ts-node @types/node
|
|
944
|
+
|
|
945
|
+
# VSCode (built-in support)
|
|
946
|
+
```
|
|
947
|
+
|
|
948
|
+
#### CLI Usage
|
|
949
|
+
```bash
|
|
950
|
+
# Compile with source maps
|
|
951
|
+
npx tsc --sourceMap
|
|
952
|
+
|
|
953
|
+
# Debug with Node.js
|
|
954
|
+
node --inspect -r ts-node/register script.ts
|
|
955
|
+
|
|
956
|
+
# Or use ts-node directly
|
|
957
|
+
ts-node --inspect script.ts
|
|
958
|
+
```
|
|
959
|
+
|
|
960
|
+
#### tsconfig.json
|
|
961
|
+
```json
|
|
962
|
+
{
|
|
963
|
+
"compilerOptions": {
|
|
964
|
+
"sourceMap": true,
|
|
965
|
+
"outDir": "./dist",
|
|
966
|
+
"rootDir": "./src"
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
#### VSCode Configuration
|
|
972
|
+
```json
|
|
973
|
+
{
|
|
974
|
+
"version": "0.2.0",
|
|
975
|
+
"configurations": [
|
|
976
|
+
{
|
|
977
|
+
"type": "node",
|
|
978
|
+
"request": "launch",
|
|
979
|
+
"name": "TypeScript: Current File",
|
|
980
|
+
"runtimeArgs": ["-r", "ts-node/register"],
|
|
981
|
+
"args": ["${file}"],
|
|
982
|
+
"cwd": "${workspaceFolder}",
|
|
983
|
+
"protocol": "inspector"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"type": "node",
|
|
987
|
+
"request": "launch",
|
|
988
|
+
"name": "TypeScript: Jest",
|
|
989
|
+
"program": "${workspaceFolder}/node_modules/.bin/jest",
|
|
990
|
+
"args": ["--runInBand"],
|
|
991
|
+
"console": "integratedTerminal"
|
|
992
|
+
}
|
|
993
|
+
]
|
|
994
|
+
}
|
|
995
|
+
```
|
|
996
|
+
|
|
997
|
+
---
|
|
998
|
+
|
|
999
|
+
### Dart/Flutter
|
|
1000
|
+
|
|
1001
|
+
#### Installation
|
|
1002
|
+
```bash
|
|
1003
|
+
# Install Flutter SDK
|
|
1004
|
+
# flutter.dev/docs/get-started/install
|
|
1005
|
+
|
|
1006
|
+
# VSCode extension
|
|
1007
|
+
code --install-extension Dart-Code.flutter
|
|
1008
|
+
```
|
|
1009
|
+
|
|
1010
|
+
#### CLI Usage
|
|
1011
|
+
```bash
|
|
1012
|
+
# Run with debugger enabled
|
|
1013
|
+
flutter run --observe
|
|
1014
|
+
|
|
1015
|
+
# Attach to running app
|
|
1016
|
+
flutter attach
|
|
1017
|
+
|
|
1018
|
+
# Dart VM Observatory
|
|
1019
|
+
# Opens in browser automatically
|
|
1020
|
+
|
|
1021
|
+
# Hot reload
|
|
1022
|
+
r # Reload
|
|
1023
|
+
R # Hot restart
|
|
1024
|
+
```
|
|
1025
|
+
|
|
1026
|
+
#### VSCode Configuration
|
|
1027
|
+
```json
|
|
1028
|
+
{
|
|
1029
|
+
"version": "0.2.0",
|
|
1030
|
+
"configurations": [
|
|
1031
|
+
{
|
|
1032
|
+
"name": "Flutter: Launch",
|
|
1033
|
+
"request": "launch",
|
|
1034
|
+
"type": "dart",
|
|
1035
|
+
"program": "lib/main.dart"
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
"name": "Flutter: Attach",
|
|
1039
|
+
"request": "attach",
|
|
1040
|
+
"type": "dart"
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
"name": "Dart: Tests",
|
|
1044
|
+
"request": "launch",
|
|
1045
|
+
"type": "dart",
|
|
1046
|
+
"program": "test/"
|
|
1047
|
+
}
|
|
1048
|
+
]
|
|
1049
|
+
}
|
|
1050
|
+
```
|
|
1051
|
+
|
|
1052
|
+
#### Flutter DevTools
|
|
1053
|
+
```bash
|
|
1054
|
+
# Open DevTools
|
|
1055
|
+
flutter pub global activate devtools
|
|
1056
|
+
flutter pub global run devtools
|
|
1057
|
+
|
|
1058
|
+
# Or from running app
|
|
1059
|
+
# Click DevTools link in terminal
|
|
1060
|
+
```
|
|
1061
|
+
|
|
1062
|
+
---
|
|
1063
|
+
|
|
1064
|
+
### Swift
|
|
1065
|
+
|
|
1066
|
+
#### Installation
|
|
1067
|
+
```bash
|
|
1068
|
+
# Xcode (macOS only)
|
|
1069
|
+
xcode-select --install
|
|
1070
|
+
|
|
1071
|
+
# LLDB comes with Xcode
|
|
1072
|
+
lldb --version
|
|
1073
|
+
|
|
1074
|
+
# VSCode extension
|
|
1075
|
+
code --install-extension vknabel.vscode-swift-development-environment
|
|
1076
|
+
```
|
|
1077
|
+
|
|
1078
|
+
#### CLI Usage
|
|
1079
|
+
```bash
|
|
1080
|
+
# Build and debug
|
|
1081
|
+
swift build
|
|
1082
|
+
lldb .build/debug/MyApp
|
|
1083
|
+
|
|
1084
|
+
# In LLDB
|
|
1085
|
+
(lldb) breakpoint set -n main
|
|
1086
|
+
(lldb) run
|
|
1087
|
+
(lldb) thread backtrace
|
|
1088
|
+
(lldb) frame variable
|
|
1089
|
+
```
|
|
1090
|
+
|
|
1091
|
+
#### Xcode Debugging
|
|
1092
|
+
1. Set breakpoints in gutter
|
|
1093
|
+
2. Run (⌘+R) or Debug (⌘+Y)
|
|
1094
|
+
3. Use LLDB console in bottom pane
|
|
1095
|
+
4. View hierarchy debugger: Debug → View Debugging → Capture View Hierarchy
|
|
1096
|
+
|
|
1097
|
+
#### LLDB Configuration for Swift
|
|
1098
|
+
```bash
|
|
1099
|
+
# ~/.lldbinit
|
|
1100
|
+
command script import lldb.macosx.heap
|
|
1101
|
+
settings set target.process.follow-fork-mode child
|
|
1102
|
+
settings set target.x86-disassembly-flavor intel
|
|
1103
|
+
```
|
|
1104
|
+
|
|
1105
|
+
---
|
|
1106
|
+
|
|
1107
|
+
## Functional & Concurrency
|
|
1108
|
+
|
|
1109
|
+
### Haskell
|
|
1110
|
+
|
|
1111
|
+
#### Installation
|
|
1112
|
+
```bash
|
|
1113
|
+
# GHC with GHCi debugger
|
|
1114
|
+
ghcup install ghc
|
|
1115
|
+
ghci --version
|
|
1116
|
+
|
|
1117
|
+
# VSCode extension
|
|
1118
|
+
code --install-extension haskell.haskell
|
|
1119
|
+
```
|
|
1120
|
+
|
|
1121
|
+
#### GHCi Debugger
|
|
1122
|
+
```bash
|
|
1123
|
+
# Load module with debugging
|
|
1124
|
+
ghci -fbreak-on-exception Main.hs
|
|
1125
|
+
|
|
1126
|
+
# Set breakpoint
|
|
1127
|
+
:break main
|
|
1128
|
+
:break MyModule.myFunction
|
|
1129
|
+
|
|
1130
|
+
# Run
|
|
1131
|
+
:main
|
|
1132
|
+
|
|
1133
|
+
# Step through
|
|
1134
|
+
:step
|
|
1135
|
+
:steplocal # Don't step into libraries
|
|
1136
|
+
:trace myFunction args
|
|
1137
|
+
|
|
1138
|
+
# Inspect
|
|
1139
|
+
:show breaks
|
|
1140
|
+
:show bindings
|
|
1141
|
+
:print variable
|
|
1142
|
+
```
|
|
1143
|
+
|
|
1144
|
+
#### Profiling
|
|
1145
|
+
```bash
|
|
1146
|
+
# Compile with profiling
|
|
1147
|
+
ghc -prof -fprof-auto Main.hs
|
|
1148
|
+
|
|
1149
|
+
# Run with profiling
|
|
1150
|
+
./Main +RTS -p
|
|
1151
|
+
|
|
1152
|
+
# View report
|
|
1153
|
+
cat Main.prof
|
|
1154
|
+
|
|
1155
|
+
# Heap profiling
|
|
1156
|
+
./Main +RTS -hy
|
|
1157
|
+
hp2ps Main.hp
|
|
1158
|
+
open Main.ps
|
|
1159
|
+
```
|
|
1160
|
+
|
|
1161
|
+
---
|
|
1162
|
+
|
|
1163
|
+
### Elixir
|
|
1164
|
+
|
|
1165
|
+
#### Installation
|
|
1166
|
+
```bash
|
|
1167
|
+
# Elixir includes debugging tools
|
|
1168
|
+
elixir --version
|
|
1169
|
+
|
|
1170
|
+
# VSCode extension
|
|
1171
|
+
code --install-extension JakeBecker.elixir-ls
|
|
1172
|
+
```
|
|
1173
|
+
|
|
1174
|
+
#### IEx Debugger
|
|
1175
|
+
```elixir
|
|
1176
|
+
# Start IEx
|
|
1177
|
+
iex -S mix
|
|
1178
|
+
|
|
1179
|
+
# Load debugger
|
|
1180
|
+
:debugger.start()
|
|
1181
|
+
|
|
1182
|
+
# Set breakpoint
|
|
1183
|
+
:int.break(MyModule, :my_function, 2) # arity 2
|
|
1184
|
+
|
|
1185
|
+
# Call function, GUI debugger opens
|
|
1186
|
+
MyModule.my_function(arg1, arg2)
|
|
1187
|
+
```
|
|
1188
|
+
|
|
1189
|
+
#### Observer
|
|
1190
|
+
```elixir
|
|
1191
|
+
# Start observer (live system inspection)
|
|
1192
|
+
:observer.start()
|
|
1193
|
+
|
|
1194
|
+
# Trace calls
|
|
1195
|
+
:sys.trace(pid, true)
|
|
1196
|
+
|
|
1197
|
+
# Get state
|
|
1198
|
+
:sys.get_status(pid)
|
|
1199
|
+
```
|
|
1200
|
+
|
|
1201
|
+
#### Phoenix LiveDashboard
|
|
1202
|
+
```elixir
|
|
1203
|
+
# Add to mix.exs
|
|
1204
|
+
{:phoenix_live_dashboard, "~> 0.8"}
|
|
1205
|
+
|
|
1206
|
+
# Add to router
|
|
1207
|
+
live_dashboard "/dashboard"
|
|
1208
|
+
|
|
1209
|
+
# Navigate to localhost:4000/dashboard
|
|
1210
|
+
```
|
|
1211
|
+
|
|
1212
|
+
---
|
|
1213
|
+
|
|
1214
|
+
### Julia
|
|
1215
|
+
|
|
1216
|
+
#### Installation
|
|
1217
|
+
```bash
|
|
1218
|
+
# Install Julia
|
|
1219
|
+
# julialang.org/downloads
|
|
1220
|
+
|
|
1221
|
+
# Install debugger
|
|
1222
|
+
julia> using Pkg
|
|
1223
|
+
julia> Pkg.add("Debugger")
|
|
1224
|
+
julia> Pkg.add("Infiltrator")
|
|
1225
|
+
|
|
1226
|
+
# VSCode extension
|
|
1227
|
+
code --install-extension julialang.language-julia
|
|
1228
|
+
```
|
|
1229
|
+
|
|
1230
|
+
#### CLI Usage
|
|
1231
|
+
```julia
|
|
1232
|
+
# Debugger.jl
|
|
1233
|
+
using Debugger
|
|
1234
|
+
|
|
1235
|
+
@enter my_function(args)
|
|
1236
|
+
|
|
1237
|
+
# Commands
|
|
1238
|
+
n # next
|
|
1239
|
+
s # step into
|
|
1240
|
+
finish # finish current function
|
|
1241
|
+
bt # backtrace
|
|
1242
|
+
```
|
|
1243
|
+
|
|
1244
|
+
#### Infiltrator.jl (Lightweight)
|
|
1245
|
+
```julia
|
|
1246
|
+
using Infiltrator
|
|
1247
|
+
|
|
1248
|
+
function my_function(x)
|
|
1249
|
+
y = x * 2
|
|
1250
|
+
@infiltrate # Breakpoint
|
|
1251
|
+
z = y + 1
|
|
1252
|
+
return z
|
|
1253
|
+
end
|
|
1254
|
+
|
|
1255
|
+
# Run function, drops into REPL at breakpoint
|
|
1256
|
+
```
|
|
1257
|
+
|
|
1258
|
+
#### VSCode Debugging
|
|
1259
|
+
```json
|
|
1260
|
+
{
|
|
1261
|
+
"version": "0.2.0",
|
|
1262
|
+
"configurations": [
|
|
1263
|
+
{
|
|
1264
|
+
"type": "julia",
|
|
1265
|
+
"request": "launch",
|
|
1266
|
+
"name": "Run Julia",
|
|
1267
|
+
"program": "${file}",
|
|
1268
|
+
"stopOnEntry": false,
|
|
1269
|
+
"cwd": "${workspaceFolder}"
|
|
1270
|
+
}
|
|
1271
|
+
]
|
|
1272
|
+
}
|
|
1273
|
+
```
|
|
1274
|
+
|
|
1275
|
+
---
|
|
1276
|
+
|
|
1277
|
+
### R
|
|
1278
|
+
|
|
1279
|
+
#### Installation
|
|
1280
|
+
```bash
|
|
1281
|
+
# R comes with debugging tools
|
|
1282
|
+
R --version
|
|
1283
|
+
|
|
1284
|
+
# RStudio (recommended)
|
|
1285
|
+
# Download from rstudio.com
|
|
1286
|
+
|
|
1287
|
+
# VSCode extension
|
|
1288
|
+
code --install-extension REditorSupport.r
|
|
1289
|
+
```
|
|
1290
|
+
|
|
1291
|
+
#### CLI Usage
|
|
1292
|
+
```R
|
|
1293
|
+
# Set breakpoint
|
|
1294
|
+
debug(myFunction)
|
|
1295
|
+
myFunction(args) # Enters debugger
|
|
1296
|
+
|
|
1297
|
+
# Or use browser()
|
|
1298
|
+
myFunction <- function(x) {
|
|
1299
|
+
browser() # Breakpoint
|
|
1300
|
+
result <- x * 2
|
|
1301
|
+
return(result)
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
# Commands
|
|
1305
|
+
n # next
|
|
1306
|
+
s # step into
|
|
1307
|
+
c # continue
|
|
1308
|
+
Q # quit
|
|
1309
|
+
```
|
|
1310
|
+
|
|
1311
|
+
#### RStudio Debugging
|
|
1312
|
+
1. Set breakpoints by clicking line numbers
|
|
1313
|
+
2. Source file with Debug button
|
|
1314
|
+
3. Use Debug menu: Debug → On Error → Break in Code
|
|
1315
|
+
|
|
1316
|
+
#### Traceback
|
|
1317
|
+
```R
|
|
1318
|
+
# After error
|
|
1319
|
+
traceback()
|
|
1320
|
+
|
|
1321
|
+
# Recover mode (interactive debugging)
|
|
1322
|
+
options(error = recover)
|
|
1323
|
+
myFunction() # On error, choose frame to debug
|
|
1324
|
+
```
|
|
1325
|
+
|
|
1326
|
+
---
|
|
1327
|
+
|
|
1328
|
+
## Enterprise & Data
|
|
1329
|
+
|
|
1330
|
+
### C#
|
|
1331
|
+
|
|
1332
|
+
#### Installation
|
|
1333
|
+
```bash
|
|
1334
|
+
# .NET SDK
|
|
1335
|
+
# dotnet.microsoft.com/download
|
|
1336
|
+
|
|
1337
|
+
# VSCode extension
|
|
1338
|
+
code --install-extension ms-dotnettools.csharp
|
|
1339
|
+
|
|
1340
|
+
# Visual Studio (full IDE, Windows)
|
|
1341
|
+
# visualstudio.microsoft.com
|
|
1342
|
+
```
|
|
1343
|
+
|
|
1344
|
+
#### CLI Usage
|
|
1345
|
+
```bash
|
|
1346
|
+
# Run with debugging
|
|
1347
|
+
dotnet run
|
|
1348
|
+
|
|
1349
|
+
# In VSCode, use integrated debugger
|
|
1350
|
+
```
|
|
1351
|
+
|
|
1352
|
+
#### Visual Studio Debugging
|
|
1353
|
+
1. Set breakpoints (F9)
|
|
1354
|
+
2. Start debugging (F5)
|
|
1355
|
+
3. Step over (F10), Step into (F11)
|
|
1356
|
+
4. Immediate Window for expression evaluation
|
|
1357
|
+
|
|
1358
|
+
#### Remote Debugging (vsdbg)
|
|
1359
|
+
```bash
|
|
1360
|
+
# Install vsdbg on remote machine
|
|
1361
|
+
curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/vsdbg
|
|
1362
|
+
|
|
1363
|
+
# VSCode configuration
|
|
1364
|
+
{
|
|
1365
|
+
"name": ".NET Core Attach (Remote)",
|
|
1366
|
+
"type": "coreclr",
|
|
1367
|
+
"request": "attach",
|
|
1368
|
+
"processId": "${command:pickRemoteProcess}",
|
|
1369
|
+
"pipeTransport": {
|
|
1370
|
+
"pipeCwd": "${workspaceFolder}",
|
|
1371
|
+
"pipeProgram": "ssh",
|
|
1372
|
+
"pipeArgs": ["user@remote-host"],
|
|
1373
|
+
"debuggerPath": "~/vsdbg/vsdbg"
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
```
|
|
1377
|
+
|
|
1378
|
+
---
|
|
1379
|
+
|
|
1380
|
+
### SQL
|
|
1381
|
+
|
|
1382
|
+
#### PostgreSQL Debugging
|
|
1383
|
+
```sql
|
|
1384
|
+
-- Enable verbose error messages
|
|
1385
|
+
\set VERBOSITY verbose
|
|
1386
|
+
|
|
1387
|
+
-- Explain query execution
|
|
1388
|
+
EXPLAIN ANALYZE SELECT * FROM users WHERE id = 1;
|
|
1389
|
+
|
|
1390
|
+
-- Check slow queries
|
|
1391
|
+
SELECT * FROM pg_stat_statements ORDER BY total_time DESC LIMIT 10;
|
|
1392
|
+
|
|
1393
|
+
-- Enable query logging in postgresql.conf
|
|
1394
|
+
log_statement = 'all'
|
|
1395
|
+
log_duration = on
|
|
1396
|
+
log_min_duration_statement = 100 -- ms
|
|
1397
|
+
```
|
|
1398
|
+
|
|
1399
|
+
#### MySQL Debugging
|
|
1400
|
+
```sql
|
|
1401
|
+
-- Show warnings
|
|
1402
|
+
SHOW WARNINGS;
|
|
1403
|
+
|
|
1404
|
+
-- Explain query
|
|
1405
|
+
EXPLAIN SELECT * FROM users WHERE id = 1;
|
|
1406
|
+
|
|
1407
|
+
-- Enable slow query log (in my.cnf)
|
|
1408
|
+
slow_query_log = 1
|
|
1409
|
+
slow_query_log_file = /var/log/mysql/slow.log
|
|
1410
|
+
long_query_time = 1
|
|
1411
|
+
```
|
|
1412
|
+
|
|
1413
|
+
#### pgAdmin Debugger
|
|
1414
|
+
1. Install pldbgapi extension
|
|
1415
|
+
2. Right-click function in pgAdmin
|
|
1416
|
+
3. Select "Debugging" → "Set breakpoint"
|
|
1417
|
+
4. Execute function, debugger opens
|
|
1418
|
+
|
|
1419
|
+
---
|
|
1420
|
+
|
|
1421
|
+
## Container & Distributed Systems
|
|
1422
|
+
|
|
1423
|
+
### Docker Debugging
|
|
1424
|
+
|
|
1425
|
+
#### Interactive Shell
|
|
1426
|
+
```bash
|
|
1427
|
+
# Exec into running container
|
|
1428
|
+
docker exec -it <container-name> /bin/sh
|
|
1429
|
+
|
|
1430
|
+
# Run with interactive shell
|
|
1431
|
+
docker run -it myimage /bin/bash
|
|
1432
|
+
```
|
|
1433
|
+
|
|
1434
|
+
#### Remote Debugging
|
|
1435
|
+
```dockerfile
|
|
1436
|
+
# Python example
|
|
1437
|
+
FROM python:3.11
|
|
1438
|
+
RUN pip install debugpy
|
|
1439
|
+
EXPOSE 5678
|
|
1440
|
+
CMD ["python", "-m", "debugpy", "--listen", "0.0.0.0:5678", "--wait-for-client", "app.py"]
|
|
1441
|
+
```
|
|
1442
|
+
|
|
1443
|
+
```bash
|
|
1444
|
+
# Run container
|
|
1445
|
+
docker run -p 5678:5678 myapp
|
|
1446
|
+
|
|
1447
|
+
# Attach from VSCode (see Python Remote Attach config above)
|
|
1448
|
+
```
|
|
1449
|
+
|
|
1450
|
+
#### Log Analysis
|
|
1451
|
+
```bash
|
|
1452
|
+
# Stream logs
|
|
1453
|
+
docker logs -f <container>
|
|
1454
|
+
|
|
1455
|
+
# Logs with timestamps
|
|
1456
|
+
docker logs --timestamps <container>
|
|
1457
|
+
|
|
1458
|
+
# Last N lines
|
|
1459
|
+
docker logs --tail 100 <container>
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
---
|
|
1463
|
+
|
|
1464
|
+
### Kubernetes Debugging
|
|
1465
|
+
|
|
1466
|
+
#### Port Forwarding
|
|
1467
|
+
```bash
|
|
1468
|
+
# Forward debugger port
|
|
1469
|
+
kubectl port-forward pod/myapp-pod 5005:5005
|
|
1470
|
+
|
|
1471
|
+
# Forward service
|
|
1472
|
+
kubectl port-forward svc/myapp-service 5005:5005
|
|
1473
|
+
```
|
|
1474
|
+
|
|
1475
|
+
#### Exec into Pod
|
|
1476
|
+
```bash
|
|
1477
|
+
# Get shell
|
|
1478
|
+
kubectl exec -it myapp-pod -- /bin/bash
|
|
1479
|
+
|
|
1480
|
+
# Specific container in multi-container pod
|
|
1481
|
+
kubectl exec -it myapp-pod -c sidecar -- /bin/sh
|
|
1482
|
+
```
|
|
1483
|
+
|
|
1484
|
+
#### Ephemeral Containers (K8s 1.23+)
|
|
1485
|
+
```bash
|
|
1486
|
+
# Debug with temporary container
|
|
1487
|
+
kubectl debug -it myapp-pod --image=busybox --target=myapp
|
|
1488
|
+
|
|
1489
|
+
# Copy pod and add debug tools
|
|
1490
|
+
kubectl debug myapp-pod -it --copy-to=myapp-debug --container=debug-tools --image=ubuntu
|
|
1491
|
+
```
|
|
1492
|
+
|
|
1493
|
+
#### Log Streaming
|
|
1494
|
+
```bash
|
|
1495
|
+
# Stream logs
|
|
1496
|
+
kubectl logs -f deployment/myapp
|
|
1497
|
+
|
|
1498
|
+
# All containers
|
|
1499
|
+
kubectl logs -f deployment/myapp --all-containers=true
|
|
1500
|
+
|
|
1501
|
+
# Previous container instance (after crash)
|
|
1502
|
+
kubectl logs myapp-pod --previous
|
|
1503
|
+
```
|
|
1504
|
+
|
|
1505
|
+
---
|
|
1506
|
+
|
|
1507
|
+
### OpenTelemetry Distributed Tracing
|
|
1508
|
+
|
|
1509
|
+
See SKILL.md for detailed code examples.
|
|
1510
|
+
|
|
1511
|
+
#### Setup Checklist
|
|
1512
|
+
- [ ] Install OpenTelemetry SDK for your language
|
|
1513
|
+
- [ ] Configure OTLP exporter (gRPC or HTTP)
|
|
1514
|
+
- [ ] Set up trace collector (Jaeger, Zipkin, or vendor)
|
|
1515
|
+
- [ ] Instrument key operations with spans
|
|
1516
|
+
- [ ] Add span attributes for context
|
|
1517
|
+
- [ ] Propagate trace context across services
|
|
1518
|
+
|
|
1519
|
+
#### Common Endpoints
|
|
1520
|
+
```bash
|
|
1521
|
+
# OTLP gRPC (default)
|
|
1522
|
+
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
|
|
1523
|
+
|
|
1524
|
+
# OTLP HTTP
|
|
1525
|
+
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
|
|
1526
|
+
|
|
1527
|
+
# Jaeger UI
|
|
1528
|
+
http://localhost:16686
|
|
1529
|
+
```
|
|
1530
|
+
|
|
1531
|
+
---
|
|
1532
|
+
|
|
1533
|
+
This reference guide provides installation, CLI usage, and VSCode configuration for all 23 supported languages plus container and distributed system debugging.
|