用途:为本地、远程、容器和生产环境提供跨语言系统化调试工作流,覆盖 Python、Go、Rust、Node.js。
主要能力与用法: Python 使用内置 pdb(breakpoint())、增强工具 ipdb、pudb、debugpy,测试失败可用 pytest --pdb。常用命令有 list、next、step、continue、print、where、quit。 Go 使用 Delve:go install github.com/go-delve/delve/cmd/dlv@latest,命令包括 dlv debug main.go、dlv test、dlv attach <pid>,支持 break、continue、next、step、print、goroutine(s)、stack 等。 Rust 使用 rust-lldb 或 rust-gdb,cargo build 默认包含符号;命令包括 breakpoint set -f/-n、run、continue、next、step、print、frame variable、backtrace、thread list。可配合 VS Code CodeLLDB 扩展。 Node.js 使用 node --inspect-brk、node --inspect 或 --inspect=0.0.0.0:9229,可在 chrome://inspect 或 VS Code launch.json 中调试。 容器与 Kubernetes:使用 kubectl debug -it <pod> --image=nicolaka/netshoot,可加 --share-processes、--target;适合已崩溃、distroless/精简镜像或无 shell 场景。Docker 可用 docker exec -it,无 shell 时用 --pid=container、--net=container 启动 busybox。 生产调试:强调结构化日志、关联 ID、OpenTelemetry 分布式追踪与错误跟踪平台(Sentry、New Relic、Datadog、Rollbar)。流程为检测、定位、复现、修复、验证,建议用功能开关与金丝雀发布。
适用场景:本地开发断点调试、测试失败调试、远程附加、容器与 Kubernetes pod 排障、goroutine 死锁、核心转储分析、分布式故障与竞态条件排查。
限制与注意事项:生产调试须评估性能开销、避免阻塞操作、避免泄露密钥与 PII、保证可回滚,并优先查看日志。具体各语言深度参考文件、示例目录及关联技能(auth-security、performance-engineering、kubernetes-operations、testing-strategies、observability)在资料中提及,未提供进一步细节。