…-line testing
An IDE integrating the debugger needs to know whether a given source line can
carry a breakpoint, i.e. whether any bytecode maps to that line. The debug
position table already holds this information (per procedure, a list of
FileName/Position/Row/Col records), but there was no public way to query it
by row - callers had to either walk the private tables or fall back to a
text heuristic that cannot tell a declaration body or comment from real code.
HasCodeAtRow(Row, Fn) returns True when any procedure has a position entry
for that source row (Fn '' matches any module). It is a small read-only scan
of the already-loaded position tables; it returns False when no debug data
is loaded.
Verified DCC32/DCC64: against a compiled script the table correctly reports
executable lines True and declaration / begin / blank lines False.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Adds TPSCustomDebugExec.HasCodeAtRow(Row, Fn) - a public, read-only query
answering "can a breakpoint sit on this source line?" by scanning the debug
position tables that are already built during LoadDebugData.
Why
An IDE/editor integrating the debugger has to decide, per source line, whether
to offer a breakpoint (gutter glyph, F5 toggle). The information is exact in
the position table - every opcode records its source row - but there was no
public accessor: callers had to walk the private FDebugDataForProcs tables
themselves, or fall back to a text heuristic that cannot distinguish a
declaration body, a comment or a continuation line from real executable code.
What
A small scan of the loaded tables; returns False when no debug data is loaded.
No new state, no behavior change to existing methods.
Verified
DCC32/DCC64: against a compiled script the table correctly reports executable
lines True and declaration / begin / blank lines False (exactly what a gutter
needs). Trivial portable Pascal - no Exit(value)/generics.
🤖 Generated with Claude Code