Why does until *<addr> fail with a memory error while tbreak *<addr> works in GDB?

2026-06-14

Stack Overflow: View Question

Tags: linux, debugging, assembly, gdb

Score: 3 | Views: 102

The asker is reverse-engineering a stripped x86_64 binary in GDB and wants to run "until" a specific instruction address. The documentation claims until and tbreak accept the same location syntax, including the *addr form for raw addresses. But in practice:

Why this is interesting: it's a divergence inside GDB itself between two command implementations that document themselves as equivalent. The "0x1" smells like a parsing or dereference bug — GDB's expression evaluator is treating *0x401234 as "read a long from address 0x401234" (the C-style unary *) instead of as the linespec prefix that means "the literal address." tbreak dispatches to the linespec parser, which has a special case for the leading *; until appears to fall through to the generic expression evaluator, which interprets * as pointer dereference. The "0x1" the user sees is plausibly whatever low byte happened to live at 0x401234.

Direction toward an answer:

Gotchas: until also has a semantic constraint tbreak doesn't — it only stops if the target is within the current frame and at a higher address than the current PC. So even if the address parsing were fixed, until into an arbitrary stripped address can silently no-op (run to end of frame). For RE work on stripped binaries, tbreak + continue is genuinely the more robust idiom regardless of whether this is a bug.

This looks like a legitimate GDB bug worth filing against sourceware — the docs explicitly promise equivalence the implementation doesn't deliver.

The challenge: Two GDB commands documented as accepting identical syntax route through different parsers, exposing a real implementation asymmetry that the docs paper over.

All newsletters