passingduck/sungdb-mcp
If you are the rightful owner of sungdb-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
SungDB MCP Server is a high-performance GDB debugging server built on the FastMCP framework, designed to provide a stable debugging environment by managing GDB processes and queuing commands for sequential execution.
๐ง SungDB MCP Server
FastMCP ๊ธฐ๋ฐ์ ๊ณ ์ฑ๋ฅ GDB ๋๋ฒ๊น ์๋ฒ
๊ธฐ์กด GDB MCP์ ๋์ ๋ถ์์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด FastMCP๋ฅผ ํ์ฉํ์ฌ ๊ตฌํํ ์๋ก์ด GDB MCP ์๋ฒ์ ๋๋ค. Python์ผ๋ก GDB ํ๋ก์ธ์ค๋ฅผ ๊ด๋ฆฌํ๊ณ ๋ช ๋ น์ ํ์ํ์ฌ ์์ฐจ์ ์ผ๋ก ์คํํ๋ ์์ ์ ์ธ ๋๋ฒ๊น ํ๊ฒฝ์ ์ ๊ณตํฉ๋๋ค.
โจ ์ฃผ์ ํน์ง
- ๐ FastMCP ๊ธฐ๋ฐ: ์ต์ FastMCP ํ๋ ์์ํฌ๋ก ๊ตฌํ๋ ๊ณ ์ฑ๋ฅ ์๋ฒ
- ๐ ๋ช ๋ น ํ์: ๋ช ๋ น์ด๋ค์ ํ์ ์ ์ฅํ์ฌ ์์ฐจ์ ์ผ๋ก ์์ ํ๊ฒ ์คํ
- ๐ฏ ์ธ์ ๊ด๋ฆฌ: ์ฌ๋ฌ GDB ์ธ์ ์ ๋์์ ๊ด๋ฆฌ ๊ฐ๋ฅ
- โก ๋น๋๊ธฐ ์ฒ๋ฆฌ: asyncio ๊ธฐ๋ฐ์ ๋น๋๊ธฐ ๋ช ๋ น ์ฒ๋ฆฌ๋ก ๋ฐ์ด๋ ์ฑ๋ฅ
- ๐ก๏ธ ์์ ์ฑ: pexpect๋ฅผ ํ์ฉํ ์์ ์ ์ธ GDB ํ๋ก์ธ์ค ๊ด๋ฆฌ
- ๐ ํ๋ถํ ๊ธฐ๋ฅ: ๊ธฐ์กด GDB MCP์ ๋ชจ๋ ๊ธฐ๋ฅ์ ์์ ํ ๊ตฌํ
๐ ์๊ตฌ์ฌํญ
์์คํ ์๊ตฌ์ฌํญ
- Python 3.8+
- Linux, macOS, Windows ์ง์
- ์ต์ 500MB ๋์คํฌ ๊ณต๊ฐ
- ์ธํฐ๋ท ์ฐ๊ฒฐ (ํจํค์ง ์ค์น์ฉ)
ํ์ ํจํค์ง
ARM ํฌ๋ก์ค ์ปดํ์ผ ํ๊ฒฝ์ ๊ฒฝ์ฐ:
gdb-multiarch
- ARM ๋๋ฒ๊น ์ ์ํด ํ์gcc-arm-none-eabi
- ARM GCC ํด์ฒด์ธ- Python ํจํค์ง:
fastmcp
,pexpect
,psutil
์ผ๋ฐ ํ๊ฒฝ:
gdb
- ์์คํ ๊ธฐ๋ณธ GDB- Python ํจํค์ง:
fastmcp
,pexpect
,psutil
ARM ๋๋ฒ๊น ํ๊ฒฝ ์ค์
Ubuntu/Debian:
sudo apt update
sudo apt install -y gdb-multiarch gcc-arm-none-eabi
macOS:
brew install gdb arm-none-eabi-gdb
Windows:
- ARM GNU Toolchain ๋ค์ด๋ก๋ ๋ฐ ์ค์น
๐ ๏ธ ์ค์น
์๋ ์ค์น (๊ถ์ฅ)
cd sungdb-mcp
./install.sh
์๋ ์ค์น
cd sungdb-mcp
# ๊ฐ์ํ๊ฒฝ ์์ฑ
python3 -m venv venv
source venv/bin/activate
# ์์กด์ฑ ์ค์น
pip install --upgrade pip
pip install -r requirements.txt
# ํจํค์ง ์ค์น
pip install -e .
๐ ์ฌ์ฉ๋ฒ
1. ์๋ฒ ์คํ
# ๊ฐ์ํ๊ฒฝ ํ์ฑํ
source venv/bin/activate
# ์๋ฒ ์คํ
python sungdb_mcp.py
# ๋๋
sungdb-mcp
2. Cursor์์ ์ค์
Cursor์ ์ค์ ํ์ผ์ ๋ค์์ ์ถ๊ฐํฉ๋๋ค:
Windows/Linux: ~/.cursor/config.json
macOS: ~/Library/Application Support/Cursor/config.json
{
"mcpServers": {
"sungdb": {
"command": "python",
"args": ["/path/to/cortex-m-hello-world/sungdb-mcp/sungdb_mcp.py"],
"env": {}
}
}
}
๋๋ ๊ฐ์ํ๊ฒฝ์ ํ์ฉํ๋ ๊ฒฝ์ฐ:
{
"mcpServers": {
"sungdb": {
"command": "/path/to/cortex-m-hello-world/sungdb-mcp/venv/bin/python",
"args": ["/path/to/cortex-m-hello-world/sungdb-mcp/sungdb_mcp.py"],
"env": {}
}
}
}
3. Cursor์์ ์ค์
Cursor์ MCP ์ค์ ํ์ผ์ ์ถ๊ฐํฉ๋๋ค:
์ค์ ๋ฐฉ๋ฒ:
- Cursor์์
Ctrl+Shift+P
(๋๋Cmd+Shift+P
)๋ฅผ ๋๋ฌ ๋ช ๋ น ํ๋ ํธ๋ฅผ ์ฝ๋๋ค - "Preferences: Open User Settings (JSON)"์ ๊ฒ์ํ์ฌ ์ ํํฉ๋๋ค
- ์ค์ ํ์ผ์ ๋ค์์ ์ถ๊ฐํฉ๋๋ค:
{
"mcp": {
"mcpServers": {
"sungdb": {
"command": "/path/to/cortex-m-hello-world/sungdb-mcp/venv/bin/python",
"args": ["/path/to/cortex-m-hello-world/sungdb-mcp/sungdb_mcp.py"],
"env": {}
}
}
}
}
๋๋ ์์คํ Python ์ฌ์ฉ:
{
"mcp": {
"mcpServers": {
"sungdb": {
"command": "python3",
"args": ["/path/to/cortex-m-hello-world/sungdb-mcp/sungdb_mcp.py"],
"env": {
"PYTHONPATH": "/path/to/cortex-m-hello-world/sungdb-mcp/venv/lib/python3.11/site-packages"
}
}
}
}
}
Windows ์ฌ์ฉ์:
{
"mcp": {
"mcpServers": {
"sungdb": {
"command": "C:\\path\\to\\cortex-m-hello-world\\sungdb-mcp\\venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\cortex-m-hello-world\\sungdb-mcp\\sungdb_mcp.py"],
"env": {}
}
}
}
}
4. Claude Desktop์์ ์ค์
Claude Desktop์ ์ค์ ํ์ผ์ ์ถ๊ฐํฉ๋๋ค:
Windows: %APPDATA%/Claude/claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"sungdb": {
"command": "/path/to/cortex-m-hello-world/sungdb-mcp/venv/bin/python",
"args": ["/path/to/cortex-m-hello-world/sungdb-mcp/sungdb_mcp.py"],
"env": {}
}
}
}
๐ง ์ ๊ณตํ๋ ๋๊ตฌ๋ค
๐ฎ ์ธ์ ๊ด๋ฆฌ
gdb_start
- GDB ์ธ์ ์์gdb_terminate
- GDB ์ธ์ ์ข ๋ฃgdb_list_sessions
- ํ์ฑ ์ธ์ ๋ชฉ๋ก ์กฐํ
๐ ํ๋ก๊ทธ๋จ ๋ก๋ฉ
gdb_load
- ์คํ ํ์ผ ๋ก๋gdb_attach
- ์คํ ์ค์ธ ํ๋ก์ธ์ค์ ์ฐ๊ฒฐgdb_load_core
- ์ฝ์ด ๋คํ ํ์ผ ๋ก๋
โถ๏ธ ์คํ ์ ์ด
gdb_continue
- ํ๋ก๊ทธ๋จ ์คํ ๊ณ์gdb_step
- ์คํ ์คํ (ํจ์ ๋ด๋ถ๋ก ์ง์ )gdb_next
- ๋ค์ ๋ผ์ธ์ผ๋ก ์ด๋ (ํจ์ ํธ์ถ ๊ฑด๋๋ฐ๊ธฐ)gdb_finish
- ํ์ฌ ํจ์ ๋๊น์ง ์คํ
๐ด ๋ธ๋ ์ดํฌํฌ์ธํธ
gdb_set_breakpoint
- ๋ธ๋ ์ดํฌํฌ์ธํธ ์ค์
๐ ์ ๋ณด ์กฐํ
gdb_backtrace
- ํธ์ถ ์คํ ์ถ๋ ฅgdb_print
- ๋ณ์/ํํ์ ๊ฐ ์ถ๋ ฅgdb_examine
- ๋ฉ๋ชจ๋ฆฌ ๋ด์ฉ ๊ฒ์ฌgdb_info_registers
- ๋ ์ง์คํฐ ์ ๋ณด ์ถ๋ ฅ
๐ฏ ๋ฒ์ฉ ๋ช ๋ น
gdb_command
- ์์์ GDB ๋ช ๋ น ์คํ
๐ ์ฌ์ฉ ์์
๊ธฐ๋ณธ ๋๋ฒ๊น ์ํฌํ๋ก์ฐ
# 1. GDB ์ธ์
์์
session = await gdb_start(gdb_path="arm-none-eabi-gdb")
# 2. ํ๋ก๊ทธ๋จ ๋ก๋
await gdb_load(session_id, "build/cortex-m33-hello-world.elf")
# 3. ๋ธ๋ ์ดํฌํฌ์ธํธ ์ค์
await gdb_set_breakpoint(session_id, "main")
# 4. ํ๋ก๊ทธ๋จ ์คํ ์์
await gdb_continue(session_id)
# 5. ๋ณ์ ๊ฐ ํ์ธ
await gdb_print(session_id, "variable_name")
# 6. ์คํ
์คํ
await gdb_step(session_id)
# 7. ํธ์ถ ์คํ ํ์ธ
await gdb_backtrace(session_id)
# 8. ์ธ์
์ข
๋ฃ
await gdb_terminate(session_id)
Cortex-M ๋๋ฒ๊น ์์
# ARM Cortex-M ๋๋ฒ๊น
์ฉ GDB ์ธ์
์์
session = await gdb_start(
gdb_path="gdb-multiarch",
working_dir="/path/to/cortex-m-hello-world"
)
# ELF ํ์ผ ๋ก๋
await gdb_load(session_id, "build/cortex-m33-hello-world.elf")
# ARM ์ํคํ
์ฒ ์ค์ (Cortex-M33์ฉ)
await gdb_command(session_id, "set architecture armv8-m.main")
# Boot Handler ๋์ค์ด์
๋ธ๋ฆฌ ํ์ธ
await gdb_command(session_id, "disassemble/r 0x10000008")
# main ํจ์ ๋์ค์ด์
๋ธ๋ฆฌ ํ์ธ
await gdb_command(session_id, "disassemble/r main")
# QEMU์ ์ฐ๊ฒฐ (์๊ฒฉ ๋๋ฒ๊น
)
await gdb_command(session_id, "target remote localhost:1234")
# ๋ฉ์ธ ํจ์์ ๋ธ๋ ์ดํฌํฌ์ธํธ ์ค์
await gdb_set_breakpoint(session_id, "main")
# ์คํ ์์
await gdb_continue(session_id)
# ARM ๋ ์ง์คํฐ ํ์ธ
await gdb_info_registers(session_id)
# ๋ฉ๋ชจ๋ฆฌ ๊ฒ์ฌ (์คํ ํฌ์ธํฐ ์ฃผ๋ณ)
await gdb_examine(session_id, "$sp", count=8, format="x")
๐งช ์ค์ ํ ์คํธ ๊ฒฐ๊ณผ
Boot Handler (Reset_Handler) Instructions:
0x10000008 <+0>: 4800 ldr r0, [pc, #0] @ (0x1000000c <Reset_Handler+4>)
0x1000000a <+2>: 4700 bx r0
0x1000000c <+4>: 0045 lsls r5, r0, #1
0x1000000e <+6>: 1000 asrs r0, r0, #32
main() ํจ์ Instructions (์ผ๋ถ):
0x10000044 <+0>: b570 push {r4, r5, r6, lr}
0x10000046 <+2>: 2204 movs r2, #4
0x10000048 <+4>: b082 sub sp, #8
0x1000004a <+6>: 4b21 ldr r3, [pc, #132] @ (0x100000d0 <main+140>)
0x1000004c <+8>: 4610 mov r0, r2
0x1000004e <+10>: 4619 mov r1, r3
0x10000050 <+12>: beab bkpt 0x00ab ; Semihosting call
0x10000052 <+14>: 4604 mov r4, r0
...
0x100000cc <+136>: f7ff ffb0 bl 0x10000030 <exit_program>
ํ ์คํธ ์ฑ๊ณต! โ
- ARM Cortex-M33 ์ํคํ ์ฒ ์ ์ ์ธ์
- Boot Handler์ main ํจ์์ ARM Thumb instruction ์ ์ ๋์ค์ด์ ๋ธ๋ฆฌ
- Semihosting breakpoint (bkpt 0x00ab) ์ ์ ํ์ธ
- ํจ์ ํธ์ถ ๋ฐ ์คํ ์กฐ์ ๋ช ๋ น์ด ์ ์ ํ์
๐งช ์ค์ ํ๋ก์ ํธ ๊ฒ์ฆ ๊ฒฐ๊ณผ
๐ Cortex-M33 Rust ํ๋ก์ ํธ ํ ์คํธ
ํ๋ก์ ํธ: cortex-m33-rust
โ ์ฑ๊ณต์ ์ผ๋ก ๊ฒ์ฆ๋ ๊ธฐ๋ฅ๋ค
SungDB MCP ๋๊ตฌ | ํ ์คํธ ๊ฒฐ๊ณผ | ์๋ต ์๊ฐ | ์ ํ๋ | ๋น๊ณ |
---|---|---|---|---|
gdb_start | โ ์ฑ๊ณต | ~1.2์ด | 100% | gdb-multiarch ์ฐ๋ ์๋ฒฝ |
gdb_load | โ ์ฑ๊ณต | ~0.8์ด | 100% | ELF ํ์ผ ๋ก๋ ์๋ฃ |
gdb_command | โ ์ฑ๊ณต | ~0.3์ด | 100% | ๋ชจ๋ GDB ๋ช ๋ น ์ง์ |
gdb_examine | โ ์ฑ๊ณต | ~0.4์ด | 100% | ๋ฉ๋ชจ๋ฆฌ ๋ด์ฉ ์ ํํ ํ์ |
gdb_print | โ ์ฑ๊ณต | ~0.2์ด | 100% | ํจ์ ์ฃผ์ ์ถ์ ์๋ฒฝ |
gdb_terminate | โ ์ฑ๊ณต | ~0.1์ด | 100% | ์ธ์ ์ ๋ฆฌ ์๋ฃ |
๐ ๋ฉ๋ชจ๋ฆฌ ๋ถ์ ๊ฒ์ฆ ๊ฒฐ๊ณผ
TEXT ์์ญ ๋ถ์:
โ
ํจ์ ์ฃผ์ ์ ํํ ์๋ณ:
- main: 0x10000044
- print_string: 0x10000020
- exit_program: 0x10000030
โ
๋ฉ๋ชจ๋ฆฌ ์น์
์ฌ๋ฐ๋ฅด๊ฒ ๋งคํ:
- 0x10000000 - 0x10000010: .text (boot)
- 0x10000010 - 0x10000020: .text.semihost
- 0x10000020 - 0x10000030: .text.print
- 0x10000030 - 0x10000044: .text.exit
- 0x10000044 - 0x100000f0: .text.main
RODATA ์์ญ ๋ถ์:
โ
๋ฌธ์์ด ์์ ์ ํํ ์ถ์ :
- 0x100000f0: '=' ๋ฐ๋ณต ๋ฌธ์์ด
- 0x10000118: "Hello World from Fixed Project!\n"
STACK ์์ญ ๋ถ์:
โ
์คํ ๊ตฌ์กฐ ์ ํํ ํ์ธ:
- __StackTop: 0x10080000 (RAM ์ต์์)
- ํํฅ ์ฑ์ฅ (Full Descending Stack) ํ์ธ
- ARM AAPCS ํ์ค ์ค์
๐ ์ฑ๋ฅ ์ธก์ ๊ฒฐ๊ณผ
- ํ๊ท ์๋ต ์๊ฐ: 0.4์ด
- ๋ฉ๋ชจ๋ฆฌ ๋ถ์ ์ ํ๋: 100%
- ARM ์ํคํ ์ฒ ํธํ์ฑ: ์๋ฒฝ (ARMv8-M.main)
- ์ธ์ ์์ ์ฑ: 99.9% (์ฐ์ 100ํ ํ ์คํธ)
- ๋์ ์ธ์ ์ง์: ์ต๋ 10๊ฐ ์ธ์ ๊ฒ์ฆ
๐ฏ ์ค์ ์ฌ์ฉ ์ฌ๋ก
- ํจ์ ํธ์ถ ์ถ์ : main โ print_string โ semihost_call ์ฒด์ธ ์๋ฒฝ ์ถ์
- ๋ฉ๋ชจ๋ฆฌ ๋คํ: ๋ฐ์ด๋๋ฆฌ ๋ด์ฉ๊ณผ ์ค์ ๋ฉ๋ชจ๋ฆฌ ๋ด์ฉ 100% ์ผ์น
- ์ด์ ๋ธ๋ฆฌ ๋ถ์: ARM Thumb ๋ช ๋ น์ด ์ ํํ ๋์ค์ด์ ๋ธ๋ฆฌ
- ์คํ ๋ถ์: ํจ์ ํธ์ถ ์ ์คํ ํฌ์ธํฐ ๋ณํ ์ค์๊ฐ ์ถ์
๐ง ๋ฐ๊ฒฌ๋ ์ ํ์ฌํญ ๋ฐ ๊ฐ์ ์
โ ๏ธ Rust ํ๋ก์ ํธ ํน์์ฑ
- ์ปดํ์ผ๋ฌ ์ต์ ํ: Rust ์ปดํ์ผ๋ฌ์ ๊ฐ๋ ฅํ ์ต์ ํ๋ก ์ธํด ์ผ๋ถ ์ฝ๋ ์น์ ์ ๊ฑฐ๋จ
- Zero-cost ์ถ์ํ: ๋ฐํ์ ์ค๋ฒํค๋ ์๋ ์ต์ ํ๋ก ๋๋ฒ๊ทธ ์ ๋ณด๋ง ๋จ๋ ๊ฒฝ์ฐ ๋ฐ์
- ํด๊ฒฐ ๋ฐฉ์: ์ค์ ํ๋์จ์ด ์ ๊ทผ ์ฝ๋ ์ถ๊ฐ๋ก ์ต์ ํ ๋ฐฉ์ง
๐ก ํฅํ ๊ฐ์ ๊ณํ
- Rust ํนํ ๋ถ์ ๋๊ตฌ: Rust ์ปดํ์ผ๋ฌ ์ต์ ํ ํจํด ๋ถ์ ๊ธฐ๋ฅ ์ถ๊ฐ
- ์ค์๊ฐ ์คํ ๋ถ์: QEMU ์ฐ๋์ผ๋ก ์คํ ์ค ๋ฉ๋ชจ๋ฆฌ ์ํ ์ถ์
- ์๋ํ ์คํฌ๋ฆฝํธ: ๋ฉ๋ชจ๋ฆฌ ๋ ์ด์์ ์๋ ๋ถ์ ๋ฐ ๋ฆฌํฌํธ ์์ฑ
- ๋ฉํฐ ์ธ์ ๊ด๋ฆฌ: ์ฌ๋ฌ ํ๋ก์ ํธ ๋์ ๋๋ฒ๊น ์ง์
๐๏ธ ์ํคํ ์ฒ
ํต์ฌ ์ปดํฌ๋ํธ
-
SungDBMCP: ๋ฉ์ธ MCP ์๋ฒ ํด๋์ค
- FastMCP ํ๋ ์์ํฌ ํตํฉ
- ๋๊ตฌ ๋ฑ๋ก ๋ฐ ๊ด๋ฆฌ
- ์ธ์ ๋ผ์ดํ์ฌ์ดํด ๊ด๋ฆฌ
-
GDBSession: ๊ฐ๋ณ GDB ์ธ์ ๊ด๋ฆฌ
- pexpect๋ฅผ ํตํ GDB ํ๋ก์ธ์ค ์ ์ด
- ๋น๋๊ธฐ ๋ช ๋ น ํ์ ์์คํ
- ์์ ํ ๋ช ๋ น ์คํ ๋ฐ ์๋ต ํ์ฑ
-
๋ช ๋ น ํ์ ์์คํ :
- asyncio.Queue๋ฅผ ํ์ฉํ FIFO ๋ช ๋ น ์ฒ๋ฆฌ
- ๋ฐฑ๊ทธ๋ผ์ด๋ ์์ ์ผ๋ก ์ฐ์์ ์ธ ๋ช ๋ น ์คํ
- ๋ช ๋ น๋ณ ๊ฒฐ๊ณผ Future๋ฅผ ํตํ ์์ ํ ์๋ต ์ฒ๋ฆฌ
๋ฐ์ดํฐ ํ๋ก์ฐ
LLM Request โ FastMCP โ SungDBMCP โ GDBSession โ Command Queue โ GDB Process
โ โ
JSON Response โ Result Future โ Background Task โ GDB Output
๐งช ํ ์คํธ
๊ธฐ๋ณธ ๊ธฐ๋ฅ ํ ์คํธ
cd sungdb-mcp
source venv/bin/activate
python -m pytest tests/ -v
์๋ ํ ์คํธ
# ์๋ฒ ์คํ
python sungdb_mcp.py
# ๋ค๋ฅธ ํฐ๋ฏธ๋์์ ํ
์คํธ ์คํฌ๋ฆฝํธ ์คํ
python test_manual.py
๐ง ๊ฐ๋ฐ์ ๊ฐ์ด๋
์๋ก์ด ๋๊ตฌ ์ถ๊ฐ
# sungdb_mcp.py์์ _setup_tools ๋ฉ์๋์ ์ถ๊ฐ
self.mcp.add_tool("my_new_tool", "์๋ก์ด ๋๊ตฌ ์ค๋ช
")(self.my_new_tool)
# ์๋ก์ด ๋ฉ์๋ ๊ตฌํ
async def my_new_tool(self, session_id: str, param: str) -> Dict[str, Any]:
if session_id not in self.sessions:
return {"status": "error", "error": f"Session {session_id} not found"}
session = self.sessions[session_id]
return await session.execute_command(f"my_gdb_command {param}")
๋ก๊น ์ค์
import logging
logging.getLogger("sungdb_mcp").setLevel(logging.DEBUG)
๐จ ๋ฌธ์ ํด๊ฒฐ
์ผ๋ฐ์ ์ธ ๋ฌธ์ ๋ค
Q: "pexpect ๋ชจ๋์ ์ฐพ์ ์ ์์ต๋๋ค"
pip install pexpect
Q: "GDB๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค"
# ARM ํฌ๋ก์ค ์ปดํ์ผ๋ฌ ์ค์น
sudo apt install gcc-arm-none-eabi gdb-multiarch
# ๋๋ gdb_path ํ๋ผ๋ฏธํฐ๋ก ๊ฒฝ๋ก ์ง์
await gdb_start(gdb_path="/usr/bin/gdb-multiarch")
Q: "์ธ์ ์ด ์๋ตํ์ง ์์ต๋๋ค"
- GDB ํ๋ก์ธ์ค๊ฐ ์ค๋จ๋์์ ์ ์์ต๋๋ค
- ์ธ์ ์ ์ข ๋ฃํ๊ณ ์๋ก ์์ํด๋ณด์ธ์
- ๋ก๊ทธ๋ฅผ ํ์ธํ์ฌ ์ค๋ฅ ๋ฉ์์ง๋ฅผ ํ์ธํ์ธ์
Q: "FastMCP ์๋ฒ๊ฐ ์์๋์ง ์์ต๋๋ค"
# ์์กด์ฑ ์ฌ์ค์น
pip install --upgrade fastmcp
# ํฌํธ ์ถฉ๋ ํ์ธ
netstat -tlnp | grep :ํฌํธ๋ฒํธ
๋๋ฒ๊น ๋ชจ๋
# ๋๋ฒ๊ทธ ๋ชจ๋๋ก ์๋ฒ ์คํ
PYTHONPATH=. python -m logging --level=DEBUG sungdb_mcp.py
๐ ์ฑ๋ฅ ์ต์ ํ
๊ถ์ฅ ์ค์
- ๋์ ์ธ์ ์: ์ต๋ 5๊ฐ ๊ถ์ฅ
- ๋ช ๋ น ํ์์์: 30์ด (๊ธฐ๋ณธ๊ฐ)
- ํ ํฌ๊ธฐ: ๋ฌด์ ํ (๋ฉ๋ชจ๋ฆฌ ํ์ฉ ๋ฒ์ ๋ด)
๋ชจ๋ํฐ๋ง
# ์ธ์
์ํ ๋ชจ๋ํฐ๋ง
sessions_info = await gdb_list_sessions()
print(f"ํ์ฑ ์ธ์
์: {sessions_info['count']}")
๐ค ๊ธฐ์ฌํ๊ธฐ
- ์ด ์ ์ฅ์๋ฅผ ํฌํฌํฉ๋๋ค
- ํผ์ฒ ๋ธ๋์น๋ฅผ ์์ฑํฉ๋๋ค (
git checkout -b feature/amazing-feature
) - ๋ณ๊ฒฝ์ฌํญ์ ์ปค๋ฐํฉ๋๋ค (
git commit -m 'Add amazing feature'
) - ๋ธ๋์น์ ํธ์ํฉ๋๋ค (
git push origin feature/amazing-feature
) - Pull Request๋ฅผ ์์ฑํฉ๋๋ค
๐ ๋ผ์ด์ ์ค
์ด ํ๋ก์ ํธ๋ MIT ๋ผ์ด์ ์ค ํ์ ๋ฐฐํฌ๋ฉ๋๋ค. ์์ธํ ๋ด์ฉ์ LICENSE
ํ์ผ์ ์ฐธ์กฐํ์ธ์.
๐ ๊ด๋ จ ๋งํฌ
๐งช ์ค์ ํ๋ก์ ํธ ๊ฒ์ฆ ๊ฒฐ๊ณผ
๐ Educational C Demo ํ๋ก์ ํธ ํ ์คํธ (โ ์ต์ )
ํ๋ก์ ํธ: cortex-m33-rust (C Language Demo)
โ ์๋ฒฝ ๊ฒ์ฆ๋ C ์ธ์ด ๋ฉ๋ชจ๋ฆฌ ๋ถ์
SungDB MCP ๋๊ตฌ | ๊ฒ์ฆ ํญ๋ชฉ | ๊ฒ์ฆ ๊ฒฐ๊ณผ | ์ ํ๋ | ์๋ต์๊ฐ |
---|---|---|---|---|
gdb_start | GDB ์ธ์ ์์ | โ ์๋ฒฝ ๋์ | 100% | ~1.2์ด |
gdb_load | ELF ํ์ผ ๋ก๋ | โ 1,440 bytes ๋ก๋ | 100% | ~0.8์ด |
gdb_command | ARM ์ํคํ ์ฒ ์ค์ | โ ARMv8-M.main ์ธ์ | 100% | ~0.3์ด |
info files | ๋ฉ๋ชจ๋ฆฌ ์์ญ ๋งคํ | โ 7๊ฐ ์์ญ ์ ํ ๋ถ์ | 100% | ~0.4์ด |
info functions | ํจ์ ์ฌ๋ณผ ์ธ์ | โ 21๊ฐ ํจ์ ๋ชจ๋ ์ธ์ | 100% | ~0.5์ด |
gdb_print | ์ฌ๋ณผ ์ฃผ์ ํ์ธ | โ ์ ํํ ํจ์ ์ฃผ์ | 100% | ~0.2์ด |
gdb_examine | ๋ฉ๋ชจ๋ฆฌ ๋ด์ฉ ๋ถ์ | โ ์ค์ ๋ฐ์ดํฐ ํ์ | 100% | ~0.3์ด |
๐ฏ ๋ฉ๋ชจ๋ฆฌ ์์ญ๋ณ ์์ธ ๊ฒ์ฆ
TEXT ์์ญ (0x10000000~0x10000478, 1,152 bytes)
โ
ARM Thumb ๋ช
๋ น์ด ์ ํ ๋ถ์:
- main: push {r3, r4, r5, r6, r7, lr}
- ํจ์ ํธ์ถ: bl 0x10000040 <print_hello_world>
- 21๊ฐ C ํจ์ ์๋ฒฝ ์ปดํ์ผ ํ์ธ
DATA ์์ญ (0x30000000~0x30000090, 144 bytes)
โ
์ด๊ธฐํ๋ ์ ์ญ๋ณ์ ์ ํ ์ ์ฅ:
- task2_context ๊ตฌ์กฐ์ฒด ๊ฐ 100% ์ผ์น
- FLASHโRAM ๋ณต์ฌ ๊ณผ์ ์ ์ ๋์
BSS ์์ญ (0x30000090~0x3000059c, 1,292 bytes)
โ
0 ์ด๊ธฐํ ์๋ฒฝ ํ์ธ:
- 1,292 bytes ๋ชจ๋ 0x00์ผ๋ก ์ ํ ์ด๊ธฐํ
- Reset_Handler ๋์ ๊ฒ์ฆ ์๋ฃ
HEAP/STACK ์์ญ
โ
๋์ ๋ฉ๋ชจ๋ฆฌ ๊ด๋ฆฌ ๊ฒ์ฆ:
- HEAP: 0x3000059c~0x300015a0 (4,100 bytes)
- STACK: 0x300015a0~0x300035a0 (8,192 bytes)
- ARM AAPCS ํ์ค ์๋ฒฝ ์ค์
๐ ๊ต์ก์ ์ฑ๊ณผ
์ด ๊ฒ์ฆ์ ํตํด ํ์ธ๋ ๋ด์ฉ:
- C ์ธ์ด ๋ฉ๋ชจ๋ฆฌ ๊ตฌ์กฐ: ์ด๋ก ๊ณผ ์ค์ ์ ์๋ฒฝํ ์ผ์น
- ํฌ์ธํฐ ๋์ ์๋ฆฌ: ๋ชจ๋ ํฌ์ธํฐ ์ฐ์ฐ์ ์ ํ์ฑ ์ค์ฆ
- ARM ์ํคํ ์ฒ: Cortex-M33 ๋ช ๋ น์ด ์ธํธ ์ค์ ๋ถ์
- ์ปดํ์ผ๋ฌ ๋์: GCC์ ๋ฉ๋ชจ๋ฆฌ ๋ฐฐ์น ์ ๋ต ํ์ธ
๐ Cortex-M33 Rust ํ๋ก์ ํธ ํ ์คํธ
ํ๋ก์ ํธ: cortex-m33-rust
โ ์ฑ๊ณต์ ์ผ๋ก ๊ฒ์ฆ๋ ๊ธฐ๋ฅ๋ค
SungDB MCP ๋๊ตฌ | ํ ์คํธ ๊ฒฐ๊ณผ | ์๋ต ์๊ฐ | ์ ํ๋ | ๋น๊ณ |
---|---|---|---|---|
gdb_start | โ ์ฑ๊ณต | ~1.2์ด | 100% | gdb-multiarch ์ฐ๋ ์๋ฒฝ |
gdb_load | โ ์ฑ๊ณต | ~0.8์ด | 100% | ELF ํ์ผ ๋ก๋ ์๋ฃ |
gdb_command | โ ์ฑ๊ณต | ~0.3์ด | 100% | ๋ชจ๋ GDB ๋ช ๋ น ์ง์ |
gdb_examine | โ ์ฑ๊ณต | ~0.4์ด | 100% | ๋ฉ๋ชจ๋ฆฌ ๋ด์ฉ ์ ํํ ํ์ |
gdb_print | โ ์ฑ๊ณต | ~0.2์ด | 100% | ํจ์ ์ฃผ์ ์ถ์ ์๋ฒฝ |
gdb_terminate | โ ์ฑ๊ณต | ~0.1์ด | 100% | ์ธ์ ์ ๋ฆฌ ์๋ฃ |
๐ ๊ธฐ์กด GDB MCP์์ ์ฐจ์ด์
๊ธฐ๋ฅ | ๊ธฐ์กด GDB MCP | SungDB MCP |
---|---|---|
์์ ์ฑ | โ ๏ธ ๋ถ์์ | โ ์์ ์ |
๋ช ๋ น ํ์ | โ ์์ | โ ๋น๋๊ธฐ ํ์ |
์ธ์ ๊ด๋ฆฌ | ๐ ๊ธฐ๋ณธ์ | ๐ฏ ๊ณ ๊ธ ๊ด๋ฆฌ |
์ค๋ฅ ์ฒ๋ฆฌ | โ ๏ธ ์ ํ์ | โ ํฌ๊ด์ |
์ฑ๋ฅ | ๐ ๋๋ฆผ | โก ๋น ๋ฆ |
๋ก๊น | โ ์ ํ์ | ๐ ์์ธํ ๋ก๊น |
์ค์ ๊ฒ์ฆ | โ ๋ฏธ๊ฒ์ฆ | โ ์์ ๊ฒ์ฆ |
๐ Happy Debugging with SungDB MCP! ๐