-
Notifications
You must be signed in to change notification settings - Fork 117
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
GDB 12.1: -var-create: unable to create variable object #437
Comments
As that command is available in GDB since < 7.1 I think using it in some places may be the way to go - but that shouldn't be this place; checking the notes on the GDB change, this mostly means that no command should rely on a stack frame or thread to be set (it should be always explicit requested), as it previously was in this extension in some places. @kmARC Starting from the message you see.. async varCreate(threadId: number, frameLevel: number, expression: string, name: string = "-", frame: string = "@"): Promise<VariableObject> {
if (trace)
this.log("stderr", "varCreate");
- let miCommand = "var-create ";
- if (threadId != 0) {
- miCommand += `--thread ${threadId} --frame ${frameLevel}`;
- }
- const res = await this.sendCommand(`${miCommand} ${this.quote(name)} ${frame} "${expression}"`);
+ cconst miCommand = `var-create --thread ${threadId} --frame ${frameLevel} ${this.quote(name)} ${frame} "${expression}"`;
+ const res = await this.sendCommand(`${miCommand}`);
return new VariableObject(res.result(""));
} and do the the same change to If this works out, then these changes, along with a Changelog entry, can be part of a PR. |
I have already fixed it in be19c27. |
I don't think so as you only pass the frame if there's a thread-id?!? |
I don't know if the thread id can even be zero in practice. The OP should just test the git version, but I don't know how to build the extension from source. |
Thanks for looking into it! Last week I couldn't build the I'm happy to report that today master succeeded to build and the issue is gone. I also tried removing the |
So this PR should be closed?
|
As of now, this report is still valid; is there a new release scheduled any time soon? |
I also have this issue and would be happy about a new version :-) |
Symptom
When using a recent version of gdb (anything after 2022 March 08), the thread context is not selected by the extension anymore, and therefore (multi-threaded?) binaries cannot be properly debugged. Our team encountered two issues:
-var-create: unable to create variable object
error displayed next to variables when selecting a different stack frame from the Call stack list (see screenshot)Cause
I git-bisected the offending commit in gdb: bminor/binutils-gdb@a9c82bc changed how the thread / stack frame context is selected. From the commit message:
Workaround
-stack-select-frame N
with N being the stack frame numberv0.27.0
of the extensionNote that I'm not sure if this is the right spot to invoke
-stack-select-frame
. It seems to be performant and does its job.System
gdb --version
>= 12.1 (compiled from source, broken after bminor/binutils-gdb@a9c82bc)gdb
(when invoking-stack-select-frame
)cwd
andtarget
are properly setOther mentions
The text was updated successfully, but these errors were encountered: