Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sambarza authored Nov 8, 2024
1 parent 890e975 commit 42dc3c0
Showing 1 changed file with 59 additions and 29 deletions.
88 changes: 59 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,64 @@ Would you like to debug your Cheshire Cat plugin running in a Docker container w

![image](https://github.com/sambarza/cc-vscode-debugpy/assets/3630051/8c8c12e9-3cff-477a-860d-2b0fc943163e)

6. Open the root Cat folder with VSCode, the root folder is the folder that contains the `core` folder
7. If run the Cat with `docker compose up` use following `launch.json` VSCode configuration file:
6. In the VSCode debug configuration file `launch.json` put this (see [here] for other configurations (https://github.com/sambarza/cc-vscode-debugpy/edit/main/README.md#other-launchjson-configuration-for-special-cases)):
```json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Remote Attach to Cat",
"type": "python",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}/plugins",
"remoteRoot": "/app/cat/plugins"
}
],
"justMyCode": true
}
]
}
```

9. Start the debug in VSCode using the new `Python: Remote Attach to Cat` configuration

## What I can do?
All the VSCode debugging feature are available:
- Breakpoints
- Watching Variables
- Call Stack
- Debug Console
- Conditional Breakpoints
- Logpoints
- ...

## Screenshot
Using this plugin to debug this plugin ;-)
![image](https://github.com/sambarza/cc-vscode-debugpy/assets/3630051/73b2dfe8-5fdb-4997-b41d-5c3499b99e39)

## How to always listen for debug
In the plugin settings, there is an option to always start listening for debugging without the need to ask the Cat for debugging each time:
![image](https://github.com/sambarza/cc-vscode-debugpy/assets/3630051/b4fe1c0e-7b9b-401b-9ab2-61cf6b5c2ce9)

## How to debug the bootstrap process
If you need to debug something during the Cat boostrap process, activate the `Listen on bootstrap` setting, then stop and start the Cat, the bootstrap process will be blocked waiting for a debug connection:
![image](https://github.com/sambarza/cc-vscode-debugpy/assets/3630051/d936f939-8393-4fd7-82da-077086d0c04c)

When starting up, there is a message in the console log that indicates the waiting connection:
![alt text](waiting_connection.png)

## Other ´launch.json´ configurations for special cases

### If you cloned the Cat core and ran it with `docker compose up`:
```json
{
// Use IntelliSense to learn about possible attributes.
Expand All @@ -47,7 +103,7 @@ Would you like to debug your Cheshire Cat plugin running in a Docker container w
]
}
```
8. If you run the Cat with `docker run` use following `launch.json` VSCode configuration file:
### If you cloned the Cat core and ran it with `docker run`:
```json
{
// Use IntelliSense to learn about possible attributes.
Expand All @@ -74,29 +130,3 @@ Would you like to debug your Cheshire Cat plugin running in a Docker container w
]
}
```
9. Start the debug in VSCode using the new `Python: Remote Attach to Cat` configuration

## What I can do?
All the VSCode debugging feature are available:
- Breakpoints
- Watching Variables
- Call Stack
- Debug Console
- Conditional Breakpoints
- Logpoints
- ...

## Screenshot
Using this plugin to debug this plugin ;-)
![image](https://github.com/sambarza/cc-vscode-debugpy/assets/3630051/73b2dfe8-5fdb-4997-b41d-5c3499b99e39)

## How to always listen for debug
In the plugin settings, there is an option to always start listening for debugging without the need to ask the Cat for debugging each time:
![image](https://github.com/sambarza/cc-vscode-debugpy/assets/3630051/b4fe1c0e-7b9b-401b-9ab2-61cf6b5c2ce9)

## How to debug the bootstrap process
If you need to debug something during the Cat boostrap process, activate the `Listen on bootstrap` setting, then stop and start the Cat, the bootstrap process will be blocked waiting for a debug connection:
![image](https://github.com/sambarza/cc-vscode-debugpy/assets/3630051/d936f939-8393-4fd7-82da-077086d0c04c)

When starting up, there is a message in the console log that indicates the waiting connection:
![alt text](waiting_connection.png)

0 comments on commit 42dc3c0

Please sign in to comment.