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

How to change current thread? #150

Open
qgindi opened this issue Dec 7, 2023 · 6 comments
Open

How to change current thread? #150

qgindi opened this issue Dec 7, 2023 · 6 comments

Comments

@qgindi
Copy link

qgindi commented Dec 7, 2023

Using MI protocol, it seems there is no way to change current thread (m_debugger.SetLastStoppedThreadId?). The debugger does not implement -thread-select command or --thread argument. It seems it is possible only if using the VSCode protocol.

For example, when the user clicks the Pause button, the current thread is the last stopped thread, or a random thread if never stopped (often not even the main thread). Then the user may want to step-debug another thread.

@viewizard
Copy link
Member

Now --thread argument supported for stack-list-frames, stack-list-variables, var-create and step commands (exec-step, exec-next and exec-finish). What command, that you need don't support --thread argument?

@qgindi
Copy link
Author

qgindi commented Dec 7, 2023

Now I see, --thread is supported, although undocumented.
exec-interrupt should support it too. Then I would use -exec-interrupt --thread mainThread if never was stopped.

@qgindi qgindi closed this as completed Dec 7, 2023
@qgindi
Copy link
Author

qgindi commented Dec 7, 2023

The problem is that -exec-interrupt sets random current thread if never stopped. And difficult to find a workaround. Would be easier if there was -thread-select.

@qgindi qgindi reopened this Dec 7, 2023
@viewizard
Copy link
Member

Please note, GDB/MI protocol is not human oriented, IDE/plugins provide proper formed commands with --thread if need. I am just worry, why you need this command.

@qgindi
Copy link
Author

qgindi commented Dec 7, 2023

I'm adding your debugger to my C# script IDE project. Like in VS, VSCode, Rider. Almost everything works well, just several non-fatal problems.

@viewizard
Copy link
Member

I added this to "feature requests" list (as I see we planned same for CLI too), but at this moment we all involved in porting to riscv64 (.NET runtime/debugger), not sure this will be done in near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants