Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested loop causes .dbg.locals of functions to disappear #1020

Open
peace-maker opened this issue Jan 10, 2025 · 0 comments
Open

Nested loop causes .dbg.locals of functions to disappear #1020

peace-maker opened this issue Jan 10, 2025 · 0 comments
Labels
bug compiler Problems with the compiler parsing source code.

Comments

@peace-maker
Copy link
Member

peace-maker commented Jan 10, 2025

When a function contains a nested loop, the debug symbols of the local variables stop getting emitted. Only the i and j variables remain, but the nFoo variable is gone. Without the nested loop, the nFoo variable is available in the .dbg.locals.

Tested with https://peace-maker.github.io/sourcepawn-disassembler-web/

public void OnPluginStart()
{
    RegServerCmd("test", Command_Test);
}

public Action Command_Test(int args)
{
    int nFoo = 6;
    PrintToServer("nFoo = %d", nFoo);

    for(int i = 0; i < 1; i++)
    {
        // Adding a nested loop will make the nFoo stack variable disappear from .dbg.locals
        for(int j = 0; j < 2; j++)
        {
        }
    }
    return Plugin_Handled;
}

peace-maker/sp-console-debugger#2

@peace-maker peace-maker added bug compiler Problems with the compiler parsing source code. labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug compiler Problems with the compiler parsing source code.
Projects
None yet
Development

No branches or pull requests

1 participant