Extempore JIT Debugging Guide
digego/extempore
Debugging guide for Extempore covering its three layers, compilation paths, startup sequence and the batch, eval and interactive modes used to isolate JIT problems.
C++20 coroutines skill for understanding coroutine mechanics and debugging.
$ npx skills add mohitmishra786/low-level-dev-skills --skill cpp-coroutines -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install mohitmishra786/low-level-dev-skills cpp-coroutines --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/low-level-programming/cpp-coroutines .claude/skills/cpp-coroutines && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "cpp-coroutines" agent skill from https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/low-level-programming/cpp-coroutines into .claude/skills/cpp-coroutines/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpp-coroutines", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/low-level-programming/cpp-coroutinesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add mohitmishra786/low-level-dev-skills --skill cpp-coroutines -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install mohitmishra786/low-level-dev-skills cpp-coroutines --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/low-level-programming/cpp-coroutines .agents/skills/cpp-coroutines && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "cpp-coroutines" agent skill from https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/low-level-programming/cpp-coroutines into .agents/skills/cpp-coroutines/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpp-coroutines", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mohitmishra786/low-level-dev-skills --skill cpp-coroutines -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install mohitmishra786/low-level-dev-skills cpp-coroutines --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/low-level-programming/cpp-coroutines .cursor/skills/cpp-coroutines && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "cpp-coroutines" agent skill from https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/low-level-programming/cpp-coroutines into .cursor/skills/cpp-coroutines/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpp-coroutines", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/mohitmishra786/low-level-dev-skills.git --path skills/low-level-programming/cpp-coroutines--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add mohitmishra786/low-level-dev-skills --skill cpp-coroutines -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install mohitmishra786/low-level-dev-skills cpp-coroutines --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/low-level-programming/cpp-coroutines .gemini/skills/cpp-coroutines && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "cpp-coroutines" agent skill from https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/low-level-programming/cpp-coroutines into .gemini/skills/cpp-coroutines/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpp-coroutines", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install mohitmishra786/low-level-dev-skills cpp-coroutinesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add mohitmishra786/low-level-dev-skills --skill cpp-coroutines -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/low-level-programming/cpp-coroutines .github/skills/cpp-coroutines && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "cpp-coroutines" agent skill from https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/low-level-programming/cpp-coroutines into .github/skills/cpp-coroutines/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpp-coroutines", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mohitmishra786/low-level-dev-skills --skill cpp-coroutines -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install mohitmishra786/low-level-dev-skills cpp-coroutines --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/low-level-programming/cpp-coroutines .opencode/skills/cpp-coroutines && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "cpp-coroutines" agent skill from https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/low-level-programming/cpp-coroutines into .opencode/skills/cpp-coroutines/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpp-coroutines", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
cpp-coroutinesC++20 coroutines skill for understanding coroutine mechanics and debugging.
Cpp Coroutines is an agent skill from mohitmishra786/low-level-dev-skills. C++20 coroutines skill for understanding coroutine mechanics and debugging. Use when working with coawait, coyield, coreturn, implementing promisetype, understanding coroutine frame layout, debugging suspended coroutines in GDB, or inspecting frame allocation with Compiler Explorer. Activates on queries about C++20 coroutines, coawait, coyield, promisetype, coroutinehandle, coroutine suspension, or coroutine frame.
Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development, covering Debugging. It works with C++. The repository describes itself as: A curated suite of AI agent skills for systems and low-level programming with C/C++, Rust, and Zig toolchains, covering compilers, debuggers, profilers, build systems…. The licence is MIT.
11 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit bdc5847. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are cpp, bash and gdb).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Cpp Coroutines loads about 2.5k tokens when it runs. Until then it costs about 110 tokens; SKILL.md has 389 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from mohitmishra786/low-level-dev-skills at commit bdc5847, republished under its MIT licence (© mohitmishra786). 389 words, ~2,537 tokens.
.claude/skills/cpp-coroutines/SKILL.md (or your agent's skills folder).Guide agents through C++20 coroutine mechanics: co_await, co_yield, co_return, implementing the required promise_type, understanding coroutine frame memory layout, debugging suspended coroutines in GDB, and reducing frame allocation overhead.
// co_return — return a value and end the coroutine
co_return value;
// co_yield — produce a value, suspend, resume later
co_yield value;
// co_await — suspend until an awaitable completes
auto result = co_await some_awaitable;A function is a coroutine if it contains any of these three keywords. Its return type must be a coroutine type with a promise_type.
#include <coroutine>
#include <stdexcept>
#include <optional>
template <typename T>
struct Task {
struct promise_type {
std::optional<T> value;
std::exception_ptr exception;
Task get_return_object() {
return Task{std::coroutine_handle<promise_type>::from_promise(*this)};
}
std::suspend_always initial_suspend() { return {}; } // lazy start
std::suspend_always final_suspend() noexcept { return {}; }
void return_value(T v) { value = std::move(v); }
void unhandled_exception() { exception = std::current_exception(); }
};
std::coroutine_handle<promise_type> handle;
explicit Task(std::coroutine_handle<promise_type> h) : handle(h) {}
Task(Task&&) = default;
Task& operator=(Task&&) = default;
~Task() { if (handle) handle.destroy(); }
T get() {
handle.resume(); // resume to completion
if (handle.promise().exception)
std::rethrow_exception(handle.promise().exception);
return std::move(*handle.promise().value);
}
};
// Usage
Task<int> compute() {
co_return 42;
}
int main() {
auto task = compute();
int result = task.get(); // 42
}template <typename T>
struct Generator {
struct promise_type {
T current_value;
Generator get_return_object() {
return Generator{std::coroutine_handle<promise_type>::from_promise(*this)};
}
std::suspend_always initial_suspend() { return {}; }
std::suspend_always final_suspend() noexcept { return {}; }
void return_void() {}
void unhandled_exception() { throw; }
std::suspend_always yield_value(T value) {
current_value = value;
return {}; // suspend after yielding
}
};
std::coroutine_handle<promise_type> handle;
explicit Generator(std::coroutine_handle<promise_type> h) : handle(h) {}
~Generator() { if (handle) handle.destroy(); }
struct iterator {
std::coroutine_handle<promise_type> handle;
bool done;
iterator& operator++() {
handle.resume();
done = handle.done();
return *this;
}
T operator*() const { return handle.promise().current_value; }
bool operator!=(std::default_sentinel_t) const { return !done; }
};
iterator begin() {
handle.resume(); // advance to first yield
return {handle, handle.done()};
}
std::default_sentinel_t end() { return {}; }
};
// Usage
Generator<int> iota(int start, int end) {
for (int i = start; i < end; ++i)
co_yield i;
}
for (int x : iota(0, 5)) {
std::cout << x << ' '; // 0 1 2 3 4
}// An awaitable has three methods:
// await_ready() — true means don't suspend
// await_suspend(handle) — suspend: store handle, schedule resume
// await_resume() — return value of co_await expression
struct TimerAwaitable {
int delay_ms;
bool await_ready() const noexcept { return delay_ms <= 0; }
void await_suspend(std::coroutine_handle<> h) {
// Schedule h.resume() to be called after delay
std::thread([h, this]() {
std::this_thread::sleep_for(std::chrono::milliseconds(delay_ms));
h.resume();
}).detach();
}
void await_resume() const noexcept {} // no return value
};
// suspend_always and suspend_never are built-in awaitables
std::suspend_always{}; // always suspends
std::suspend_never{}; // never suspends (no-op)The compiler allocates a coroutine frame (heap object) containing:
// Inspect frame size with Compiler Explorer (godbolt.org)
// Compile with: g++ -std=c++20 -O2 -S
// Look for: operator new call size in the generated asm
// Or: clang -std=c++20 -O2 -emit-llvm -S | grep "coro.size"
// Reduce frame size:
// 1. Don't keep large objects alive across co_await
struct Bad {
std::vector<char> large_buf; // whole vector lives in frame
co_return large_buf.size(); // large_buf crosses suspension
};
// 2. Move data out before suspending
std::vector<char> buf = get_data();
size_t sz = buf.size(); // capture only what's needed
buf.clear(); // release before suspension
co_await next_event;
// sz still valid; buf released# Coroutines appear as regular stack frames after resume()
# To inspect a suspended coroutine:
(gdb) info locals
# Look for coroutine_handle variables
# Print the promise object
(gdb) p *(promise_type*)(handle.__handle_)
# GDB 14+ has coroutine-specific support
(gdb) info coroutines # GCC coroutine support (experimental)
# Step through coroutine execution
(gdb) step # enters co_await implementation
(gdb) finish # returns from coroutine frame function
(gdb) next # step over suspension point
# View all threads (coroutines running on thread pool)
(gdb) info threads
(gdb) thread 2
(gdb) btco_spawn and co_await#include <boost/asio.hpp>
#include <boost/asio/co_spawn.hpp>
#include <boost/asio/awaitable.hpp>
namespace net = boost::asio;
net::awaitable<void> echo_session(net::ip::tcp::socket socket) {
char buf[1024];
for (;;) {
std::size_t n = co_await socket.async_read_some(net::buffer(buf));
co_await net::async_write(socket, net::buffer(buf, n));
}
}
int main() {
net::io_context io;
net::co_spawn(io, listen_accept(io), net::detached);
io.run();
}co_spawn launches coroutines on an executor; co_await chains completion tokens without callback nesting.
std::generator (C++23)#include <generator>
#include <ranges>
std::generator<int> fibonacci() {
int a = 0, b = 1;
while (true) {
co_yield a;
auto next = a + b;
a = b;
b = next;
}
}
// Usage
for (int v : fibonacci() | std::views::take(10))
printf("%d\n", v);Lazy sequences without manual coroutine handle management — compiler provides std::generator promise type.
# Compile with debug info
g++ -std=c++20 -g -O0 -o app app.cpp
gdb ./app(gdb) break my_coro
(gdb) run
(gdb) info frame # current stack frame
(gdb) info locals # promise, handle in scope
# Inspect coroutine frame pointer (compiler-specific mangling)
(gdb) p *(MyPromise*)h.address() # h = coroutine_handle
# GCC coroutine support (GCC 14+)
(gdb) info coroutines
# Pretty-print promise state
(gdb) set print pretty on
(gdb) p promiseSuspended coroutines may not appear on stack until resumed — trace via stored coroutine_handle.
Coroutines increase template instantiation and header parsing cost:
| Mitigation | Effect |
|---|---|
-O2 HALO | Reduces generated frame glue |
Out-of-line co_await in .cpp | Cuts recompilation cascade |
| Pimpl for coroutine return types | Hides awaitable templates from headers |
ccache / modules | See skills/rust/rust-build-times patterns for C++ |
Measure with g++ -ftime-report or clang -ftime-trace. Coroutine-heavy headers (Asio) benefit from unity builds sparingly — balance with RAM use.
| Issue | Cause | Fix |
|---|---|---|
co_await in a non-coroutine | Function missing coroutine return type | Change return type to a coroutine type |
Dangling handle after co_return | Using handle after coroutine finishes | Check handle.done() before resume |
| Double-resume | Resuming an already-resumed coroutine | Track state; only resume when suspended |
| Coroutine frame never freed | Forgot handle.destroy() | Use RAII wrapper (Task, Generator) |
| Heap allocation overhead | New frame per coroutine call | Enable HALO (Heap Allocation eLision Optimization) with -O2 |
| Recursive co_await depth | Stack overflow from deep chains | Use std::coroutine_handle<> tail-call pattern |
skills/compilers/cpp-templates for other advanced C++20 featuresskills/rust/rust-async-internals for Rust's equivalent Future/Poll modelskills/debuggers/gdb for GDB session management© mohitmishra786, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/low-level-programming/cpp-coroutines of mohitmishra786/low-level-dev-skills.
Open the folder on GitHubat commit bdc5847
Cpp Coroutines next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Cpp Coroutines this skillmohitmishra786/low-level-dev-skills | 253 | — | ~2.5k | Automated safety check: Pass | MIT | |
| Extempore JIT Debugging Guidedigego/extempore | 1.5k | — | ~4.4k | Automated safety check: Pass | None | |
| OpenROAD Bug FixerThe-OpenROAD-Project/OpenROAD | 3.2k | — | ~784 | Automated safety check: Pass | BSD-3-Clause | |
| Cppcrazyguitar/cppcheatsheet | 290 | — | ~1.8k | Automated safety check: Pass | MIT | |
| MCP Debuggerdebugmcp/mcp-debugger | 171 | — | ~3.8k | Automated safety check: Pass | MIT | |
| Dbgtheodo-group/debug-that | 158 | — | ~1.9k | Automated safety check: Pass | MIT |
digego/extempore
Debugging guide for Extempore covering its three layers, compilation paths, startup sequence and the batch, eval and interactive modes used to isolate JIT problems.
The-OpenROAD-Project/OpenROAD
Fixes an OpenROAD bug from a GitHub issue or error code: finds the root cause, implements the fix, adds a regression test and prepares a signed-off commit.
crazyguitar/cppcheatsheet
Comprehensive C/C++ programming reference covering everything from C11-C23 and C++11-C++23, system programming, CUDA GPU computing, debugging tools, Rust interop, and advanced topics.
debugmcp/mcp-debugger
A skill your agent uses when investigating a bug, failing test, or unexpected runtime behavior and the mcp-debugger MCP server is available — drives real step-through debuggers (breakpoints, stack…
theodo-group/debug-that
Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.
JasonMa0012/MooaToon
A skill your agent uses when debugging UE C++ crashes, runtime bugs, or unexpected behavior with Rider MCP available.
mohitmishra786/low-level-dev-skills
Guides reading and writing AArch64 and ARM Thumb assembly: compiler output, inline asm, registers, the AAPCS calling convention and NEON or SVE basics.
mohitmishra786/low-level-dev-skills
Reference for RISC-V assembly on RV32 and RV64: register names and calling convention, extension naming, GCC and Clang inline asm, and QEMU with GDB debugging.
mohitmishra786/low-level-dev-skills
Explains x86-64 registers, the System V AMD64 calling convention, and how to read compiler-generated or inline assembly.
mohitmishra786/low-level-dev-skills
Guides your agent through Bazel for C/C++ projects: BUILD files, Bzlmod dependencies, toolchain registration, remote execution, dependency queries and sandbox debugging.
mohitmishra786/low-level-dev-skills
Binary hardening skill for security-hardened C/C++ builds. An agent skill from mohitmishra786/low-level-dev-skills.
mohitmishra786/low-level-dev-skills
GNU binutils skill for binary manipulation and analysis. An agent skill from mohitmishra786/low-level-dev-skills.
Works with
Categories
C++20 coroutines skill for understanding coroutine mechanics and debugging. Cpp Coroutines is an agent skill from mohitmishra786/low-level-dev-skills. C++20 coroutines skill for understanding coroutine mechanics and debugging.
Cpp Coroutines fits situations like: working with coawait; implementing promisetype; understanding coroutine frame layout; debugging suspended coroutines in GDB.
Run `npx skills add mohitmishra786/low-level-dev-skills --skill cpp-coroutines -a claude-code`. Or copy the skill folder (skills/low-level-programming/cpp-coroutines in mohitmishra786/low-level-dev-skills) into .claude/skills/cpp-coroutines in your project. Claude Code loads it when a task matches its description.
Run `npx skills add mohitmishra786/low-level-dev-skills --skill cpp-coroutines -a codex`. Or copy the skill folder (skills/low-level-programming/cpp-coroutines in mohitmishra786/low-level-dev-skills) into .agents/skills/cpp-coroutines in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mohitmishra786/low-level-dev-skills --skill cpp-coroutines -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cpp-coroutines, .gemini/skills/cpp-coroutines, .github/skills/cpp-coroutines and .opencode/skills/cpp-coroutines in your project.
SKILL.md names no scripts, command-line tools or credentials: Cpp Coroutines is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Cpp Coroutines is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Cpp Coroutines: Extempore JIT Debugging Guide (digego/extempore, 1.5k stars), OpenROAD Bug Fixer (The-OpenROAD-Project/OpenROAD, 3.2k stars), Cpp (crazyguitar/cppcheatsheet, 290 stars) and MCP Debugger (debugmcp/mcp-debugger, 171 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
mohitmishra786 (a GitHub user) maintains it in mohitmishra786/low-level-dev-skills, which has 253 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on June 27, 2026.
Source: mohitmishra786/low-level-dev-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.