본문으로 건너뛰기
cccskills
무료GitHub에 공개

lldb

Use when debugging with LLDB on macOS, FreeBSD, or Linux-clang, mapping GDB commands to LLDB, Xcode or VS Code integration, LLDB Python scripting, or debugging Swift and Objective-C.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(3)

  • SKILL.md6.4 KB
  • agents/openai.yaml240 B
  • references/gdb-lldb-map.md3.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

LLDB

Contract

FieldBound contract
TriggerA program needs debugging with LLDB on macOS, FreeBSD, or a clang-built Linux tree, a GDB habit needs its LLDB equivalent, or LLDB needs driving from Xcode, VS Code, or Python.
AuthorityRead-only. Emits analysis and commands for the operator to run on the target; no file writes, no rollback needed. No remote mutation.
Side effectDiagnostic commands and a verdict in chat. Nothing is written.
DoneThe bug is localized to a frame, variable, or instruction, or the GDB-to-LLDB mapping for the needed command is given.

Inputs

  1. Binary (required): built with -g.
  2. Symptom (required): crash, hang, wrong value, or a GDB command that needs its LLDB form.
  3. Core file or PID (optional): for post-mortem or attach workflows.

Procedure

  1. Start the session.

    lldb ./prog                      # load a binary
    lldb ./prog -- arg1 arg2         # with arguments
    lldb -p 12345                    # attach to a PID
    lldb -c core.1234                # load a core
    lldb ./prog core.1234            # binary plus core
    

    Done when: LLDB has a live process or a loaded core.

  2. Map GDB habits to LLDB. The common cases:

    GDBLLDB
    run [args]process launch [args] / r
    continueprocess continue / c
    nextthread step-over / n
    stepthread step-in / s
    nextithread step-inst-over / ni
    stepithread step-inst / si
    finishthread step-out / finish
    break mainbreakpoint set -n main / b main
    break file.c:42breakpoint set -f file.c -l 42 / b file.c:42
    break *0x400abcbreakpoint set -a 0x400abc / b -a 0x400abc
    watch xwatchpoint set variable x / wa s v x
    print xframe variable x / p x
    info localsframe variable / fr v
    backtracethread backtrace / bt
    frame Nframe select N / f N
    info threadsthread list
    thread apply all btthread backtrace all
    x/10wx addrmemory read -s4 -fx -c10 addr / x/10xw addr
    set var = 42expression var = 42 / expr var = 42

    The full map lives in references/gdb-lldb-map.md. Done when: the needed command has its LLDB form.

  3. Set breakpoints.

    b main
    breakpoint set --name foo --condition 'x > 0'
    b file.c:42
    breakpoint set --file file.c --line 42
    b -a 0x100003f20                          # address
    breakpoint set --func-regex '^MyClass::'  # regex
    breakpoint set -o -n foo                  # one-shot
    breakpoint list                           # br l
    breakpoint delete 2
    breakpoint disable 1 / breakpoint enable 1
    breakpoint command add 1                  # commands on hit, end with DONE
    

    Done when: execution stops at the condition that matters.

  4. Inspect state.

    p x / p *ptr / p arr[0]
    frame variable                     # arguments and locals
    expression x * 2 + 1               # evaluate any expression
    register read / register read rip rsp
    memory read --size 4 --format x --count 10 0x7fff0000
    x/10xw 0x7fff0000                  # GDB-compatible syntax works
    image lookup --type MyClass        # type info
    type lookup MyClass
    

    Done when: the variable, register, or memory region in question is read.

  5. Set watchpoints.

    watchpoint set variable x                  # write watchpoint
    watchpoint set variable -w read x          # read watchpoint
    watchpoint set variable -w read_write x
    watchpoint set expression -- &x            # by address
    watchpoint list / watchpoint delete 1
    

    Done when: the write or read that corrupts state is trapped.

  6. Debug threads.

    thread list
    thread select 3
    thread backtrace all
    thread backtrace --count 5
    thread step-over                     # steps this thread only
    

    Done when: each thread's state is known.

  7. Use the Apple-specific surface.

    image lookup --address 0x18ab12345   # symbol in the shared cache
    image lookup --name objc_msgSend
    b "-[NSArray objectAtIndex:]"        # Objective-C method breakpoint
    po myObject                          # print-object, calls -description
    image list / image list -b           # loaded libraries
    

    Done when: Objective-C or shared-cache frames resolve.

  8. Drive LLDB from VS Code. Install the CodeLLDB extension and add a launch.json configuration:

    {
      "name": "Debug (lldb)",
      "type": "lldb",
      "request": "launch",
      "program": "${workspaceFolder}/build/prog",
      "args": [],
      "cwd": "${workspaceFolder}",
      "preLaunchTask": "build"
    }
    

    Done when: F5 launches the program under LLDB.

  9. Script LLDB with Python.

    import lldb
    
    def print_all_threads(debugger, command, result, internal_dict):
        target = debugger.GetSelectedTarget()
        process = target.GetProcess()
        for thread in process:
            print(f"Thread {thread.GetIndexID()}: {thread.GetName()}")
            for frame in thread:
                print(f"  {frame}")
    
    def __lldb_init_module(debugger, internal_dict):
        debugger.HandleCommand('command script add -f myscript.print_all_threads pthreads')
    

    Load with command script import /path/to/myscript.py. Done when: the script command runs inside LLDB.

Failure and recovery

  • <unavailable> for a variable: the value was optimized out; see debug-optimized-builds.
  • A GDB command has no LLDB form: check references/gdb-lldb-map.md; where no equivalent exists, the table says so.
  • Breakpoint on an Objective-C method misses: quote the full selector, b "-[Class method:]".
  • expression fails on a function call: the function may be inlined or stripped; call it by address or evaluate the expression manually.
  • Core will not load: confirm the binary matches the core; target create ./prog --core core needs the exact executable.

Output

The bug localized to a frame, variable, register, or instruction, with the LLDB commands that produced the evidence; or the GDB-to-LLDB mapping for the command that was asked about.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Not for the Rust FFI binding layer: use rust-ffi.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

Use when configuring ADC sampling time, DMA-driven ADC, calibration, or DAC channel setup on bare-metal MCUs. Not for the DMA stream itself: use dma-baremetal.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

af-xdp

무료

Use when creating AF_XDP sockets, configuring UMEM and XSK rings, writing an XDP redirect program, or choosing copy versus zero-copy mode. Not for full kernel bypass: use dpdk.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

Use when a completed session needs an agent-environment retrospective. Not for an engineering retrospective from telemetry: use engineering-retrospective.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

Use when a redacted, trimmed agent transcript must be appended to a GitHub PR or issue body, with human approval and preview. Not for automated or model-initiated insertion.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

agents-md

무료

Use when a repo needs agent setup, AGENTS.md added or made lean, CLAUDE.md audited, or agent instructions scored or pruned. Not for remote, credential, publish, deploy, or irreversible changes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

OutlineDriven의 스킬 모두 보기

이 스킬의 문제 신고