Skip to content

Refactoring to remove alwaysAllowCliCommand argument from evaluate requests#504

Draft
omarArm wants to merge 7 commits into
eclipse-cdt-cloud:mainfrom
omarArm:relaxFrameId
Draft

Refactoring to remove alwaysAllowCliCommand argument from evaluate requests#504
omarArm wants to merge 7 commits into
eclipse-cdt-cloud:mainfrom
omarArm:relaxFrameId

Conversation

@omarArm
Copy link
Copy Markdown
Contributor

@omarArm omarArm commented Mar 5, 2026

This PR should implement #503

In this PR, I did the following:

  1. Removed some guards in the evaluate request for better host debugging

@cwalther
Copy link
Copy Markdown
Contributor

cwalther commented Mar 5, 2026

I am not familiar enough with the expression evaluation stuff to give a meaningful review, but I support removing the restriction from commands that are not expression evaluations (start with >).

@jreineckearm
Copy link
Copy Markdown
Contributor

@omarArm , as discussed earlier today, please review if the global handle should be create right after a reset of frameHandles. At the moment it looks like it wouldn't be available while running for auxGdb, yet still working? Could be an indication that choosing and consistently handling -1 as global frameId is enough.

@omarArm
Copy link
Copy Markdown
Contributor Author

omarArm commented Mar 9, 2026

@jreineckearm It works while running for auxGDB because the value of globalFrameHandle is stored at the very first stackTraceRequest and it remains stored. This means while running any undefined frameId falls back to the value of globalFrameHandle

@omarArm omarArm changed the title falling back to global frameID whenever evaluate requests get sent without a frameID Refactoring to remove alwaysAllowCliCommand argument from evaluate requests Mar 10, 2026
@jonahgraham
Copy link
Copy Markdown
Contributor

I support what you are doing here in principle - but I don't understand what sequences you are allowing that used to be not allowed. Can you add a test with the sequence of commands that come from VSCode that you are trying to change behaviour of please?

I believe it would be a good idea to create a frame handle for global expressions in which undefined frameIDs would fall back to.

This seems like a reasonable thing to do when the adapter has info that the front-end isn't able to provide. However, I don't understand why the default of using thread 1 is the reasonable thing to do in this case.

@omarArm
Copy link
Copy Markdown
Contributor Author

omarArm commented Mar 11, 2026

@jonahgraham I am trying to allow CLI commands for host debugging. As the old pattern had the argument alwaysAllowCliCommand always set to false for host debugging. I removed the argument altogether.

I will try to add a test for it sure. I initially had the idea that the normal test routines provided in the evaluate request are enough.

As for the global frame handle, threadId = 1 and frameId = 0 are just place holders because the mi layer always sets up the command with --frame --thread. However, we are going to use floating frame-addr, so the threadID and frameID are going to be discarded by GDB anyway. For some reason though, gdb-mi did not accept having threadId = 0 while frame-addr = @. Therefore, I opted for the place holder.

Actually I will add a comment in the code explaining the whole pattern to avoid future confusion.

Edit: I removed the global handle from this PR. I figured the idea of supporting undefined frameIDs still need more investigation before getting into providing solutions

@jreineckearm
Copy link
Copy Markdown
Contributor

Apologies for the back and forth here. I think we tried to do too much in one go and didn't think the thread ID part through. I agree with the proposal to move the undefined theads/frame ID behaviour to a separate PR. #503 should be kept open for the time being.

The change done here should deal with removing the artificial limitations we introduced earlier for the gdb type while getting up to speed with the code base. I am still testing that part (or better trying to set up a gdb session suitable for testing), hence no approval yet. That should help to validate eclipse-cdt-cloud/cdt-gdb-vscode#202

I appreciate that you will be a way for a couple of weeks soon, @omarArm . Hence, we either have to park the next steps on #503 . Or someone else takes over. Need to see what my own bandwidth allows until you are back....

@omarArm
Copy link
Copy Markdown
Contributor Author

omarArm commented Mar 12, 2026

I found out that this won't properly work with gdb type. Hence, this PR needs more investigation. I am going to convert the PR into a draft instead until further notice.

@omarArm omarArm marked this pull request as draft March 12, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants