Skip to content

Set a variable from a different frame #1142

@brichet

Description

@brichet

Is there a way to copy a local variable (in a function) to the global scope (module), in order to inspect it after debugging ?

In my experience, sending a setExpression request with a global variable as expression does not create a global variable:

type: "request",
command: "setExpression",
arguments: {
   expression: "globals()['global_variable']", 
   value: "local_variable", 
   frameId: local_function_frame_id
},
seq: XXX,

The above request will create a variable within the frame of the function only. This variable will not be accessible from the frame of the module.

I may have misunderstood how frames and scopes work, I'd be happy to have some clarification if this is the case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions