Skip to content

Debugging Tool Ripgrep

Mainkill1 edited this page Sep 21, 2026 · 1 revision

ripgrep (rg)

← Debugging Tools and Commands

ripgrep performs fast recursive source searches while respecting ignore rules. Use it after runtime evidence supplies a function, state name, register, trace label, or failure message.

Property Details
Supported OS Windows, Linux, macOS.
Install Install ripgrep using a package manager or official binary release.
Verify rg --version
Primary output See the workflow below.

When to use it

Once profiling gives you a symbol, register name, trace label, or FIXME, rg is the fastest way to map it back into the source tree.

Find a function or identifier

rg -n "tlb_reset_dirty_range_all" .
rg -n "create_pipeline" hw include ui

Follow related state and callers

rg -n "tlb_reset_dirty_range_all|tlb_reset_dirty|dirty_range" .
rg -n "vkQueueSubmit|vkWaitForFences|pgraph_vk_finish" hw/xbox

Search known incomplete behavior

rg -n "FIXME|TODO|assert\(" hw/xbox

Read the result

rg gives static source locations. The next job is to reconstruct:

caller
 -> state mutation
 -> callee
 -> synchronization / cache / DMA side effect
 -> return / retry / guest-visible result

A text match is not runtime evidence. Use it to understand the path already identified by the trace.


Boundaries and common mistakes

A text match is static evidence. Reconstruct callers, state ownership, error handling, and synchronization, then prove the relevant path executed.

By default ripgrep honors ignore files and skips hidden/binary files. Use -uuu only when the investigation intentionally needs ignored, hidden, and binary content.

Evidence to retain

  • Tool name and exact version.
  • Source commit/tree and executable SHA-256.
  • The complete command or saved profile used.
  • Input artifact hashes and the explicitly selected time or address range.
  • Raw output plus any derived report; do not retain only a screenshot or conclusion.
  • Admission failures, warnings, dropped events, incomplete rows, or unsupported operations.

Official references

Related xemu guides

Clone this wiki locally