左边的栈里面可以 set frame 跳到之前的栈,实现方法里面的进退自如。
# 一、cursor 的 python debug
**结论:** 对于 FastAPI + Uvicorn,必须选择 **"Debug using launch.json"** 并配置好 launch.json 文件!

**❌ 不要用 "Debug Python File"**
因为直接运行 `main.py` 不会启动 Uvicorn 服务器
**✅ 应该用 "Debug using launch.json"**
因为需要通过 uvicorn 模块启动,而不是直接运行文件
|特性|Debug Python File|Debug using launch.json|
|---|---|---|
|配置文件|不需要|需要 launch.json|
|适用场景|简单脚本|复杂应用/服务器|
|参数传递|不支持|支持|
|环境变量|不支持|支持|
|模块启动|不支持|支持 (如 uvicorn)|
|**你的情况**|❌ 不适用|✅ 使用这个|
# `launch.json` 在哪儿?
```Java
你的项目根目录/
├── .vscode/
│ └── launch.json 👈 在这里
├── app/
│ └── main.py
├── requirements.txt
└── ...
```
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "FastAPI Debug",
"type": "debugpy",
"request": "launch",
"module": "uvicorn",
"args": [
"app.main:app",
"--host", "0.0.0.0",
"--port", "8080",
"--reload"
],
"jinja": true,
"justMyCode": false
}
]
}
```
# mark object

# step out
出栈到调用这个函数的地方
