Skip to content

Address expression context only on top of stack #163

@lzace817

Description

@lzace817

Description

when using a expression as the address on the memory inspector, it will not work properly for previous stack frames.
How to reproduce:

  • use the sample code bellow
#include <stdio.h>

static void foo(size_t val)
{
    printf("%ld\n", val*2); // <------------ break here
}

static void test(int n)
{
    foo(80*n);
}

int main(void)
{
    test(1);
    test(2);
    return 0;
}
  • set break point at the comment
  • run in debug
  • select test on the call stack
  • inspect the memory with expression &(n)
  • Error message: No symbol "n" in current context.

Expected behavior

it should be able to get the adress of the local variable with no errors.

Environment

  • OS: Ubuntu GNU/Linux
  • Browser:
  • Theia or VS Code Version:
    Version: 1.100.23258
    Commit: 557d9224936804f4aeb93625d7a45c97113627e4
    Date: 2025-05-15T18:24:48.143Z
    Electron: 34.5.4
    ElectronBuildId: undefined
    Chromium: 132.0.6834.210
    Node.js: 20.19.0
    V8: 13.2.152.41-electron.0
    OS: Linux x64 6.8.0-60-generic snap

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions