본문으로 건너뛰기
Skillpedia
일반 코딩48k · #4501

dwarf-expert

하는 일

DWARF라는 디버그 정보를 이해하고 다루도록 돕습니다. 이 데이터가 무엇인지 설명하고, 프로그램 분석에 사용하는 방법과 정확성을 확인하는 방법을 알려 줍니다.

사용하는 경우

  • ✓컴파일된 프로그램의 디버그 정보를 이해해야 할 때.
  • ✓DWARF 표준(버전 3, 4, 5)에 대한 답을 얻고 싶을 때.
  • ✓DWARF 데이터를 다루는 코드를 작성하거나 검토할 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/dwarf-expert/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/dwarf-expert/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“`llvm-dwarfdump --verify` 명령을 사용해서 제 프로그램의 DWARF 데이터가 올바른지 어떻게 확인할 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

DWARF 표준에 관한 공식 자료와 코드 예제를 참고해 작동합니다. 또한 `dwarfdump`나 `readelf` 같은 도구를 사용해 이 정보를 추출하고 분석하는 방법도 압니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Overview

This skill provides technical knowledge and expertise about the DWARF standard and how to interact with DWARF files. Tasks include answering questions about the DWARF standard, providing examples of various DWARF features, parsing and/or creating DWARF files, and writing/modifying/analyzing code that interacts with DWARF data.

When to Use This Skill

  • Understanding or parsing DWARF debug information from compiled binaries
  • Answering questions about the DWARF standard (v3, v4, v5)
  • Writing or reviewing code that interacts with DWARF data
  • Using dwarfdump or readelf to extract debug information
  • Verifying DWARF data integrity with llvm-dwarfdump --verify
  • Working with DWARF parsing libraries (libdwarf, pyelftools, gimli, etc.)

When NOT to Use This Skill

  • DWARF v1/v2 Analysis: Expertise limited to versions 3, 4, and 5.
  • General ELF Parsing: Use standard ELF tools if DWARF data isn't needed.
  • Executable Debugging: Use dedicated debugging tools (gdb, lldb, etc) for debugging executable code/runtime behavior.
  • Binary Reverse Engineering: Use dedicated RE tools (Ghidra, IDA) unless specifically analyzing DWARF sections.
  • Compiler Debugging: DWARF generation issues are compiler-specific, not covered here.

Authoritative Sources

When specific DWARF standard information is needed, use these authoritative sources:

  1. Official DWARF Standards (dwarfstd.org): Use web search to find specific sections of the official DWARF specification at dwarfstd.org. Search queries like "DWARF5 DW_TAG_subprogram attributes site:dwarfstd.org" are effective.

  2. LLVM DWARF Implementation: The LLVM project's DWARF handling code at llvm/lib/DebugInfo/DWARF/ serves as a reliable reference implementation. Key files include:

    • DWARFDie.cpp - DIE handling and attribute access
    • DWARFUnit.cpp - Compilation unit parsing
    • DWARFDebugLine.cpp - Line number information
    • DWARFVerifier.cpp - Validation logic
  3. libdwarf: The reference C implementation at github.com/davea42/libdwarf-code provides detailed handling of DWARF data structures.

Verification Workflows

Use llvm-dwarfdump verification options to validate DWARF data integrity:

Structural Validation

# Verify DWARF structure (compile units, DIE relationships, address ranges)
llvm-dwarfdump --verify <binary>

# Detailed error output with summary
llvm-dwarfdump --verify --error-display=full <binary>

# Machine-readable JSON error summary
llvm-dwarfdump --verify --verify-json=errors.json <binary>

Quality Metrics

# Output debug info quality metrics as JSON
llvm-dwarfdump --statistics <binary>

The --statistics output helps compare debug info quality across compiler versions and optimization levels.

Common Verification Patterns

  • After compilation: Verify binaries have valid DWARF before distribution
  • Comparing builds: Use --statistics to detect debug info quality regressions
  • Debugging debuggers: Identify malformed DWARF causing debugger issues
  • DWARF tool development: Validate parser output against known-good binaries

Parsing DWARF Debug Information

readelf

ELF files can be parsed via the readelf command ({baseDir}/reference/readelf.md). Use this for general ELF information, but prefer dwarfdump for DWARF-specific parsing.

dwarfdump

DWARF files can be parsed via the dwarfdump command, which is more effective at parsing and displaying complex DWARF information than readelf and should be used for most DWARF parsing tasks ({baseDir}/reference/dwarfdump.md).

Working With Code

This skill supports writing, modifying, and reviewing code that interacts with DWARF data. This may involve code that parses DWARF debug data from scratch or code that leverages libraries to parse and interact with DWARF data ({baseDir}/reference/coding.md).

Choosing Your Approach

┌─ Need to verify DWARF data integrity?
│   └─ Use `llvm-dwarfdump --verify` (see Verification Workflows above)
├─ Need to answer questions about the DWARF standard?
│   └─ Search dwarfstd.org or reference LLVM/libdwarf source
├─ Need simple section dump or general ELF info?
│   └─ Use `readelf` ({baseDir}/reference/readelf.md)
├─ Need to parse, search, and/or dump DWARF DIE nodes?
│   └─ Use `dwarfdump` ({baseDir}/reference/dwarfdump.md)
└─ Need to write, modify, or review code that interacts with DWARF data?
    └─ Refer to the coding reference ({baseDir}/reference/coding.md)

…
자주 묻는 질문

DWARF 데이터란 무엇인가요?

컴파일된 프로그램에 포함되는 추가 정보입니다. 변수 이름과 함수 이름처럼 디버깅 도구가 원래 소스 코드를 이해하도록 돕습니다.

이 도구는 어떤 DWARF 버전을 이해하나요?

DWARF 표준 버전 3, 4, 5를 이해합니다.

이 도구로 실행 중인 프로그램을 디버그할 수 있나요?

아니요, 이 도구는 프로그램의 실행 중 동작이 아니라 DWARF 데이터 자체를 분석하는 용도입니다. 실행 중 디버깅에는 GDB나 LLDB 같은 도구를 사용하세요.

상세 정보

작성자의 원본 설명

Provides expertise for analyzing DWARF debug files and understanding the DWARF debug format/standard (v3-v5). Triggers when understanding DWARF information, interacting with DWARF files, answering DWARF-related questions, or working with code that parses DWARF data.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4501
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬