{"id":"2e181f75-12ad-4170-99af-d355dd9ef456","shortId":"ApNhZR","kind":"skill","title":"gdb-cli","tagline":"GDB debugging assistant for AI agents - analyze core dumps, debug live processes, investigate crashes and deadlocks with source code correlation","description":"# GDB Debugging Assistant\n\n## Overview\n\nA GDB debugging skill designed for AI agents. Combines **source code analysis** with **runtime state inspection** using gdb-cli to provide intelligent debugging assistance for C/C++ programs.\n\n## When to Use This Skill\n\n- Analyze core dumps or crash dumps\n- Debug running processes with GDB attach\n- Investigate crashes, deadlocks, or memory issues\n- Get intelligent debugging assistance with source code context\n- Debug multi-threaded applications\n\n## Do Not Use This Skill When\n\n- The task is unrelated to C/C++ debugging\n- The user needs general-purpose assistance without debugging\n- No GDB is available (GDB 9.0+ with Python support required)\n\n## Prerequisites\n\n```bash\n# Install gdb-cli\npip install gdb-cli\n\n# Or from GitHub\npip install git+https://github.com/Cerdore/gdb-cli.git\n\n# Verify GDB has Python support\ngdb -nx -q -batch -ex \"python print('OK')\"\n```\n\n**Requirements:**\n- Python 3.6.8+\n- GDB 9.0+ with Python support enabled\n- Linux OS\n\n## How It Works\n\n### Step 1: Initialize Debug Session\n\n**For core dump analysis:**\n```bash\ngdb-cli load --binary <binary_path> --core <core_path> [--gdb-path <gdb_path>]\n```\n\n**For live process debugging:**\n```bash\ngdb-cli attach --pid <pid> [--binary <binary_path>]\n```\n\n**Output:** A session_id like `\"session_id\": \"a1b2c3\"`. Store this for subsequent commands.\n\n### Step 2: Gather Initial Information\n\n```bash\nSESSION=\"<session_id>\"\n\n# List all threads\ngdb-cli threads -s $SESSION\n\n# Get backtrace (with local variables)\ngdb-cli bt -s $SESSION --full\n\n# Get registers\ngdb-cli registers -s $SESSION\n```\n\n### Step 3: Correlate Source Code (CRITICAL)\n\nFor each frame in the backtrace:\n1. **Extract frame info**: `{file}:{line} in {function}`\n2. **Read source context**: Get ±20 lines around the crash point\n3. **Get local variables**: `gdb-cli locals-cmd -s $SESSION --frame <N>`\n4. **Analyze**: Correlate code logic with variable values\n\n**Example correlation:**\n```\nFrame #0: process_data() at src/worker.c:87\nSource code shows:\n  85: Node* node = get_node(id);\n  86: if (node == NULL) return;\n  87: node->data = value;  <- Crash here\n\nVariables show:\n  node = 0x0 (NULL)\n\nAnalysis: The NULL check on line 86 didn't catch the issue.\n```\n\n### Step 4: Deep Investigation\n\n```bash\n# Examine variables\ngdb-cli eval-cmd -s $SESSION \"variable_name\"\ngdb-cli eval-cmd -s $SESSION \"ptr->field\"\ngdb-cli ptype -s $SESSION \"struct_name\"\n\n# Memory inspection\ngdb-cli memory -s $SESSION \"0x7fffffffe000\" --size 64\n\n# Disassembly\ngdb-cli disasm -s $SESSION --count 20\n\n# Check all threads (for deadlock analysis)\ngdb-cli thread-apply -s $SESSION bt --all\n\n# View shared libraries\ngdb-cli sharedlibs -s $SESSION\n```\n\n### Step 5: Session Management\n\n```bash\n# List active sessions\ngdb-cli sessions\n\n# Check session status\ngdb-cli status -s $SESSION\n\n# Stop session (cleanup)\ngdb-cli stop -s $SESSION\n```\n\n## Common Debugging Patterns\n\n### Pattern: Null Pointer Dereference\n\n**Indicators:**\n- Crash on memory access instruction\n- Pointer variable is 0x0\n\n**Investigation:**\n```bash\ngdb-cli registers -s $SESSION  # Check RIP\ngdb-cli eval-cmd -s $SESSION \"ptr\"  # Check pointer value\n```\n\n### Pattern: Deadlock\n\n**Indicators:**\n- Multiple threads stuck in lock functions\n- `pthread_mutex_lock` in backtrace\n\n**Investigation:**\n```bash\ngdb-cli thread-apply -s $SESSION bt --all\n# Look for circular wait patterns\n```\n\n### Pattern: Memory Corruption\n\n**Indicators:**\n- Crash in malloc/free\n- Garbage values in variables\n\n**Investigation:**\n```bash\ngdb-cli memory -s $SESSION \"&variable\" --size 128\ngdb-cli registers -s $SESSION\n```\n\n## Examples\n\n### Example 1: Core Dump Analysis\n\n```bash\n# Load core dump\ngdb-cli load --binary ./myapp --core /tmp/core.1234\n\n# Get crash location\ngdb-cli bt -s a1b2c3 --full\n\n# Examine crash frame\ngdb-cli locals-cmd -s a1b2c3 --frame 0\n```\n\n### Example 2: Live Process Debugging\n\n```bash\n# Attach to stuck server\ngdb-cli attach --pid 12345\n\n# Check all threads\ngdb-cli threads -s b2c3d4\n\n# Get all backtraces\ngdb-cli thread-apply -s b2c3d4 bt --all\n```\n\n## Best Practices\n\n- Always read source code before drawing conclusions from variable values\n- Use `--range` for pagination on large thread counts or deep backtraces\n- Use `ptype` to understand complex data structures before examining values\n- Check all threads for multi-threaded issues\n- Cross-reference types with source code definitions\n\n## Security & Safety Notes\n\n- This skill requires GDB access to processes and core dumps\n- Attaching to processes may require appropriate permissions (sudo, ptrace_scope)\n- Core dumps may contain sensitive data - handle with care\n- Only debug processes you have authorization to analyze\n\n## Related Skills\n\n- `@systematic-debugging` - General debugging methodology\n- `@test-driven-development` - Write tests before implementation\n\n## Links\n\n- **Repository**: https://github.com/Cerdore/gdb-cli\n- **PyPI**: https://pypi.org/project/gdb-cli/\n- **Documentation**: https://github.com/Cerdore/gdb-cli#readme\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["gdb","cli","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows"],"capabilities":["skill","source-sickn33","skill-gdb-cli","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/gdb-cli","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34793 github stars · SKILL.md body (5,323 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-24T00:51:00.580Z","embedding":null,"createdAt":"2026-04-18T21:37:47.508Z","updatedAt":"2026-04-24T00:51:00.580Z","lastSeenAt":"2026-04-24T00:51:00.580Z","tsv":"'/cerdore/gdb-cli':744 '/cerdore/gdb-cli#readme':752 '/cerdore/gdb-cli.git':143 '/myapp':571 '/project/gdb-cli/':748 '/tmp/core.1234':573 '0':305,596 '0x0':334,474 '0x7fffffffe000':391 '1':172,262,558 '12345':612 '128':549 '2':215,270,598 '20':275,402 '3':251,281 '3.6.8':159 '4':294,349 '5':429 '64':393 '85':314 '86':320,342 '87':310,325 '9.0':119,161 'a1b2c3':208,582,594 'access':469,691 'activ':434 'agent':9,35 'ai':8,34 'alway':637 'analysi':39,179,336,408,561 'analyz':10,61,295,723 'appli':414,518,630 'applic':91 'appropri':702 'around':277 'ask':786 'assist':6,26,52,82,111 'attach':72,198,603,610,697 'author':721 'avail':117 'b2c3d4':621,632 'backtrac':231,261,510,624,657 'bash':125,180,194,219,352,432,476,512,540,562,602 'batch':152 'best':635 'binari':185,200,570 'boundari':794 'bt':238,417,521,580,633 'c/c':54,103 'care':715 'catch':345 'check':339,403,440,483,494,613,668 'circular':525 'clarif':788 'cleanup':451 'clear':761 'cli':3,47,129,134,183,197,226,237,246,287,357,367,377,387,397,411,424,438,445,454,479,487,515,543,552,568,579,589,609,618,627 'cmd':290,360,370,490,592 'code':22,38,85,254,297,312,640,682 'combin':36 'command':213 'common':458 'complex':662 'conclus':643 'contain':710 'context':86,273 'core':11,62,177,186,559,564,572,695,707 'correl':23,252,296,303 'corrupt':530 'count':401,654 'crash':17,65,74,279,329,466,532,575,585 'criteria':797 'critic':255 'cross':677 'cross-refer':676 'data':307,327,663,712 'deadlock':19,75,407,498 'debug':5,13,25,30,51,67,81,87,104,113,174,193,459,601,717,728,730 'deep':350,656 'definit':683 'derefer':464 'describ':765 'design':32 'develop':735 'didn':343 'disasm':398 'disassembl':394 'document':749 'draw':642 'driven':734 'dump':12,63,66,178,560,565,696,708 'enabl':165 'environ':777 'environment-specif':776 'eval':359,369,489 'eval-cmd':358,368,488 'ex':153 'examin':353,584,666 'exampl':302,556,557,597 'expert':782 'extract':263 'field':374 'file':266 'frame':258,264,293,304,586,595 'full':241,583 'function':269,505 'garbag':535 'gather':216 'gdb':2,4,24,29,46,71,115,118,128,133,145,149,160,182,188,196,225,236,245,286,356,366,376,386,396,410,423,437,444,453,478,486,514,542,551,567,578,588,608,617,626,690 'gdb-cli':1,45,127,132,181,195,224,235,244,285,355,365,375,385,395,409,422,436,443,452,477,485,513,541,550,566,577,587,607,616,625 'gdb-path':187 'general':109,729 'general-purpos':108 'get':79,230,242,274,282,317,574,622 'git':140 'github':137 'github.com':142,743,751 'github.com/cerdore/gdb-cli':742 'github.com/cerdore/gdb-cli#readme':750 'github.com/cerdore/gdb-cli.git':141 'handl':713 'id':204,207,319 'implement':739 'indic':465,499,531 'info':265 'inform':218 'initi':173,217 'input':791 'inspect':43,384 'instal':126,131,139 'instruct':470 'intellig':50,80 'investig':16,73,351,475,511,539 'issu':78,347,675 'larg':652 'librari':421 'like':205 'limit':753 'line':267,276,341 'link':740 'linux':166 'list':221,433 'live':14,191,599 'load':184,563,569 'local':233,283,289,591 'locals-cmd':288,590 'locat':576 'lock':504,508 'logic':298 'look':523 'malloc/free':534 'manag':431 'match':762 'may':700,709 'memori':77,383,388,468,529,544 'methodolog':731 'miss':799 'multi':89,673 'multi-thread':88,672 'multipl':500 'mutex':507 'name':364,382 'need':107 'node':315,316,318,322,326,333 'note':686 'null':323,335,338,462 'nx':150 'ok':156 'os':167 'output':201,771 'overview':27 'pagin':650 'path':189 'pattern':460,461,497,527,528 'permiss':703,792 'pid':199,611 'pip':130,138 'point':280 'pointer':463,471,495 'practic':636 'prerequisit':124 'print':155 'process':15,69,192,306,600,693,699,718 'program':55 'provid':49 'pthread':506 'ptr':373,493 'ptrace':705 'ptype':378,659 'purpos':110 'pypi':745 'pypi.org':747 'pypi.org/project/gdb-cli/':746 'python':121,147,154,158,163 'q':151 'rang':648 'read':271,638 'refer':678 'regist':243,247,480,553 'relat':724 'repositori':741 'requir':123,157,689,701,790 'return':324 'review':783 'rip':484 'run':68 'runtim':41 'safeti':685,793 'scope':706,764 'secur':684 'sensit':711 'server':606 'session':175,203,206,220,229,240,249,292,362,372,380,390,400,416,427,430,435,439,441,448,450,457,482,492,520,546,555 'share':420 'sharedlib':425 'show':313,332 'size':392,548 'skill':31,60,96,688,725,756 'skill-gdb-cli' 'sourc':21,37,84,253,272,311,639,681 'source-sickn33' 'specif':778 'src/worker.c':309 'state':42 'status':442,446 'step':171,214,250,348,428 'stop':449,455,784 'store':209 'struct':381 'structur':664 'stuck':502,605 'subsequ':212 'substitut':774 'success':796 'sudo':704 'support':122,148,164 'systemat':727 'systematic-debug':726 'task':99,760 'test':733,737,780 'test-driven-develop':732 'thread':90,223,227,405,413,501,517,615,619,629,653,670,674 'thread-appli':412,516,628 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'treat':769 'type':679 'understand':661 'unrel':101 'use':44,58,94,647,658,754 'user':106 'valid':779 'valu':301,328,496,536,646,667 'variabl':234,284,300,331,354,363,472,538,547,645 'verifi':144 'view':419 'wait':526 'without':112 'work':170 'write':736","prices":[{"id":"1e3cc690-11c1-487f-bd81-1d2343ab4436","listingId":"2e181f75-12ad-4170-99af-d355dd9ef456","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:37:47.508Z"}],"sources":[{"listingId":"2e181f75-12ad-4170-99af-d355dd9ef456","source":"github","sourceId":"sickn33/antigravity-awesome-skills/gdb-cli","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/gdb-cli","isPrimary":false,"firstSeenAt":"2026-04-18T21:37:47.508Z","lastSeenAt":"2026-04-24T00:51:00.580Z"}],"details":{"listingId":"2e181f75-12ad-4170-99af-d355dd9ef456","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"gdb-cli","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34793,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-24T00:28:59Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"605936819719a4363ee71065ba4cd0441a5923b3","skill_md_path":"skills/gdb-cli/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/gdb-cli"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"gdb-cli","description":"GDB debugging assistant for AI agents - analyze core dumps, debug live processes, investigate crashes and deadlocks with source code correlation"},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/gdb-cli"},"updatedAt":"2026-04-24T00:51:00.580Z"}}