Skip to content

Commit

Permalink
Merge pull request #247 from arkedge/feature/add_debug_files
Browse files Browse the repository at this point in the history
VS Code を使ったデバッグ手順の追加 / READMEの微修正
  • Loading branch information
meltingrabbit authored Dec 25, 2023
2 parents c204e87 + 9c649d3 commit ff373b2
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// 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": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'c2a-example-mobc'",
"cargo": {
"args": [
"build",
"--package=c2a-example-mobc"
],
"filter": {
"name": "c2a-example-mobc",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}/examples/mobc"
}
]
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

- [#246](https://github.com/arkedge/c2a-core/pull/246): `node_modules``.gitignore` に追加

### Documentation

- [#247](https://github.com/arkedge/c2a-core/pull/247): VS Code 等を使ったデバッグ手順を追加 / README の微修正

### Migration Guide
- [#240](https://github.com/arkedge/c2a-core/pull/240): user 側でのコードレベルでの対応は不要
- 新しい code-generator で生成したコードは,既存のものと diff が発生するため,改めてコード生成し直すとよい.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


## ドキュメント
- ドキュメント: https://github.com/arkedge/c2a-core/tree/develop/docs
- ドキュメント: https://github.com/arkedge/c2a-core/tree/main/docs
- リファレンス (TBD): https://github.com/ut-issl/c2a-reference
- [CHANGELOG](./CHANGELOG.md)

Expand All @@ -31,6 +31,7 @@
- C2A の SILS runtime として,以下のような実装が存在する.
- [c2a-sils-runtime](./sils-runtime)
- 今後の標準的な C2A の SILS runtime.これが導入済みの C2A user は基本的に `cargo run` すれば動作する.
- ドキュメント: [docs/sils/c2a_sils_runtime.md](./docs/sils/c2a_sils_runtime.md)
- [S2E](https://github.com/ut-issl/s2e-core)
- 宇宙環境シミュレータ.元々の SILS runtime 実装であり,姿勢制御モジュールなど,宇宙環境模擬が必要な C2A user についてはこちらを用いて検証を行う.
- 最小限の SILS-S2E は [S2E User for C2A Core](https://github.com/ut-issl/s2e-user-for-c2a-core) で実行可能.
Expand All @@ -44,7 +45,6 @@

### ブランチ
- `main`: リリース版([詳細](./docs/general/release.md)
- `develop`: 概ね検証された最新版(beta 機能含む)
- `feature/*` : 開発ブランチ
- `hotfix/*` : 重大バグ修正用ブランチ

Expand Down
31 changes: 29 additions & 2 deletions docs/sils/c2a_sils_runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
```
sudo apt install gcc-multilib protobuf-compiler libclang-dev cmake g++ g++-multilib
```
3. `/examples/subobc/``/examples/mobc/` で次を実行する.
3. `/examples/mobc/``/examples/subobc/` で次を実行する.
```
npm install
```
Expand All @@ -23,7 +23,7 @@ npm install
様々なパターンが存在するため,いくつかの例を示す.

### C2A そのものののみの実行
`/examples/subobc/``/examples/mobc/`
`/examples/mobc/``/examples/subobc/`
```
cargo run
```
Expand All @@ -33,8 +33,35 @@ cargo run
[c2a-devtools](https://github.com/arkedge/c2a-devtools) によって,c2a-sils-runtime によって実行されている SILS に対して,テレコマ通信が可能である.
使い方の詳細は,上記リンク先を参照のこと.

### C2A そのもの + c2a-devtools の実行
MOBC 環境 (`/examples/mobc/`) を例にする.

1. 1 つ目のターミナルで `/examples/mobc/` に移動し,次を実行する.
```
npm run devtools:sils
```
2. 2 つ目のターミナルで c2a-devtools を実行し,ブラウザを開くと,テレコマ通信が可能となる.


### C2A そのもの + c2a-devtools の実行 (VS Code を用いたデバッグ)
MOBC 環境 (`/examples/mobc/`) を例にする.
この手順によって,ブレークポイント等を用いた開発が可能となる.

1. 1 つ目のターミナルで `/examples/mobc/` に移動し,次を実行する.
```
npm run devtools:debug
```
2. VS Code のデバッガで `Debug executable 'c2a-example-mobc` を実行する.
3. 2 つ目のターミナルで c2a-devtools を実行し,ブラウザを開くと,テレコマ通信が可能となる.


### pytest の実行
以下を参照のこと.

- [mobc pytest](../../examples/mobc/src/src_user/Test/README.md)
- [subobc pytest](../../examples/subobc/src/src_user/Test/README.md)


## その他
`npm run *` コマンドについては,以下のファイルなどを参照すること.
https://github.com/arkedge/c2a-core/blob/63af0662d09ecf427e035602935891abc09d09dd/examples/mobc/package.json#L1-L25
3 changes: 2 additions & 1 deletion examples/mobc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
"run:gaia": "tmtc-c2a --satconfig satconfig.json --tlmcmddb tlmcmddb.json",
"run:kble": "bash -c 'while :; do kble -s <(jrsonnet spaghetti.jsonnet); sleep 1; done'",
"run-all": "run-p run:*",
"run-devtools": "run-p run:gaia run:kble",
"devtools:sils": "run-s build:* run-all",
"devtools:debug": "run-s build:* run-devtools",
"build:tlmcmddb-sub": "tlmcmddb-cli bundle --pretty ../subobc/tlm-cmd-db/TLM_DB/calced_data ../subobc/tlm-cmd-db/CMD_DB tlmcmddb-subobc.json",
"tlmcmddb-merge": "tlmcmddb-cli merge --pretty --output tlmcmddb.json tlmcmddb.json tlmcmddb-subobc.json",
"run-subobc:c2a-subobc": "env UART_KBLE_PORT=9697 cargo run --manifest-path ../subobc/Cargo.toml",
"run-subobc:c2a": "run-s run:c2a",
"run-subobc:gaia": "tmtc-c2a --satconfig satconfig.json --tlmcmddb tlmcmddb.json",
"run:kble": "bash -c 'while :; do kble -s <(jrsonnet spaghetti.jsonnet); sleep 1; done'",
"run-subobc:kble": "bash -c 'while :; do kble -s <(jrsonnet spaghetti.subobc.jsonnet); sleep 1; done'",
"run-subobc-all": "run-p run-subobc:*",
"devtools:sils-subobc": "run-s build:* tlmcmddb-merge run-subobc-all"
Expand Down

0 comments on commit ff373b2

Please sign in to comment.