Skip to content

dotnet attach: evaluate_expression without frameId ignores the adopted anchor thread (#496 escape hatch incomplete) #600

Description

@debugmcpdev

Summary

On a .NET attach where the DAP-stopped thread is frameless and the session adopts a frame-bearing thread (the #465/#496 anchor mechanism), the adopted anchor is honoured by get_stack_trace, get_local_variables, and get_scopes — but evaluate_expression without a frameId is not routed to the adopted thread's top frame: it fails error CS0103: The name 'counter' does not exist in the current context, while get_local_variables on the same session returns counter = 33 and an explicit evaluate_expression { frameId: 1 } evaluates it fine. #496's escape hatch is two-thirds wired.

Observed on all three NPX servers during the end-of-series /testdebugger sweep (2026-08-30); pre-existing (the anchor mechanism predates the refactor series).

Suggested fix

When no frameId is supplied, resolve the default frame from the same anchor the locals path uses (the adopted thread's top frame), not from the raw stopped-event thread. Unit test at the session layer with the dotnet frameless-stopped-thread fixture: anchorless evaluate answers about the adopted thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions