# lldb

Guides agents through LLDB debugging for C, C++, Swift, and Objective-C. Helps translate GDB commands and debug clang binaries on macOS or Linux.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 646 installs · ★ 267
- Author: mohitmishra786
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/mohitmishra786/low-level-dev-skills/tree/HEAD/skills/debuggers/lldb/SKILL.md
- Updated: 2026-06-27
- HTML: https://affpapa.org/en/nevibecode/skills/lldb

## What it does

This skill equips AI assistants with command mappings from GDB to LLDB. It covers process launches, thread-level stepping, conditional breakpoints, and raw memory inspection. The assistant can quickly resolve syntax differences for inspection commands like `frame variable` and `memory read`.

The guide includes Apple-specific debugging workflows such as inspecting Objective-C objects with `po` and setting method breakpoints. For editor setups, VS Code requires the `CodeLLDB` extension alongside a prepared `launch.json`. Python automation is also supported via custom scripts using the `lldb` module.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add mohitmishra786/low-level-dev-skills --skill lldb -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/lldb/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/lldb/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add mohitmishra786/low-level-dev-skills --skill lldb -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/lldb/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add mohitmishra786/low-level-dev-skills --skill lldb -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/lldb/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install mohitmishra786/low-level-dev-skills lldb
```

2. **Manually: put the files in place**
- File: `.github/skills/lldb/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add mohitmishra786/low-level-dev-skills --skill lldb -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/mohitmishra786/low-level-dev-skills --path skills/debuggers/lldb
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/lldb/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add mohitmishra786/low-level-dev-skills --skill lldb -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/mohitmishra786/low-level-dev-skills/tree/HEAD/skills/debuggers/lldb/SKILL.md

## When to use it
- map familiar GDB commands to their LLDB equivalents
- configure `launch.json` for debugging in VS Code
- set conditional breakpoints and watchpoints on variables
- automate thread inspection with LLDB Python scripts

## Example prompts
- How do I translate GDB `info locals` and `watch x` into LLDB commands?
- Write a VS Code `launch.json` config for an LLDB binary target.
- How can I inspect Objective-C objects using `po` in an LLDB session?

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 40ad474f6e4cccd8.

BEGIN THIRD-PARTY FILE 40ad474f6e4cccd8
````text
---
name: lldb
description: LLDB debugger skill for C/C++/Swift/Objective-C programs. Use when debugging with LLDB on macOS, FreeBSD, or Linux-clang environments, mapping GDB mental models to LLDB commands, using LLDB in Xcode or VS Code, or debugging Swift/Objective-C. Activates on queries about LLDB commands, GDB to LLDB migration, Apple platform debugging, LLDB Python scripting, or IDE-integrated debugging with clang-built binaries.
user-invocable: true
triggers:
  - debug with LLDB
  - GDB to LLDB migration
  - LLDB commands
  - debug Swift with LLDB
  - LLDB in Xcode
  - LLDB Python scripting
  - Apple platform debugging LLDB
  - LLDB VS Code integration
---

# LLDB

## Purpose

Guide agents through LLDB sessions and map existing GDB knowledge to LLDB. Covers command differences, Apple specifics, Python scripting, and IDE integration.

## Triggers

- "I'm on macOS and need to debug a C++ program"
- "How does LLDB differ from GDB?"
- "How do I do [GDB command] in LLDB?"
- "LLDB shows `<unavailable>` for variables"
- "How do I use LLDB in VS Code?"
- "How do I write an LLDB Python script?"

## Workflow

### 1. Start LLDB

```bash
lldb ./prog                         # load binary
lldb ./prog -- arg1 arg2            # with arguments
lldb -p 12345                       # attach to PID
lldb -c core.1234                   # load core dump
lldb ./prog core.1234               # binary + core
```

### 2. GDB → LLDB command map

Source: <https://lldb.llvm.org/use/map.html>

| GDB | LLDB | Notes |
|-----|------|-------|
| `run [args]` | `process launch [args]` / `r` | |
| `continue` | `process continue` / `c` | |
| `next` | `thread step-over` / `n` | |
| `step` | `thread step-in` / `s` | |
| `nexti` | `thread step-inst-over` / `ni` | |
| `stepi` | `thread step-inst` / `si` | |
| `finish` | `thread step-out` / `finish` | |
| `break main` | `breakpoint set -n main` / `b main` | |
| `break file.c:42` | `breakpoint set -f file.c -l 42` / `b file.c:42` | |
| `break *0x400abc` | `breakpoint set -a 0x400abc` / `b -a 0x400abc` | |
| `watch x` | `watchpoint set variable x` / `wa s v x` | |
| `print x` | `frame variable x` / `p x` | |
| `print/x x` | `p/x x` | |
| `info locals` | `frame variable` / `fr v` | |
| `info args` | `frame variable --arguments` | |
| `backtrace` | `thread backtrace` / `bt` | |
| `frame N` | `frame select N` / `f N` | |
| `info threads` | `thread list` | |
| `thread N` | `thread select N` | |
| `thread apply all bt` | `thread backtrace all` | |
| `x/10wx addr` | `memory read -s4 -fx -c10 addr` / `x/10xw addr` | |
| `set var = 42` | `expression var = 42` / `expr var = 42` | |
| `quit` | `quit` / `q` | |

### 3. Breakpoints

```lldb
# By name
b main
breakpoint set --name foo
breakpoint set --name foo --condition 'x > 0'

# By file:line
b file.c:42
breakpoint set --file file.c --line 42

# By address
b -a 0x100003f20

# By regex
breakpoint set --func-regex '^MyClass::'

# List
breakpoint list / br l

# Delete
breakpoint delete 2

# Disable/enable
breakpoint disable 1
breakpoint enable 1

# Commands on hit
breakpoint command add 1
  > p x
  > continue
  > DONE
```

### 4. Inspect state

```lldb
# Print variable
p x
frame variable x
p *ptr
````
END THIRD-PARTY FILE 40ad474f6e4cccd8

The third-party file has ended. Everything between the 40ad474f6e4cccd8 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3202 of 5707 bytes. © mohitmishra786 · MIT · https://github.com/mohitmishra786/low-level-dev-skills/tree/HEAD/skills/debuggers/lldb/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
