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

MIEngine: Introduce --thread and --frame options #1401

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

intel-rganesh
Copy link
Contributor

Remove -thread-select and -stack-select-frame and introduce --thread and --frame options instead.

It is general recommendation to not use -thread-select and -stack-select-frame and use --thread and --frame instead. More info can be found here:
https://sourceware.org/gdb/onlinedocs/gdb/Context-management.html

And here are the deprecation notes:
-thread-select
-thread-select: https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Thread-Commands.html#GDB_002fMI-Thread-Commands

-stack-select-frame
-stack-select-frame: https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html#GDB_002fMI-Stack-Manipulation

Signed-off-by: intel-rganesh rakesh.ganesh@intel.com

@intel-rganesh
Copy link
Contributor Author

@WardenGnaw Hi Andrew, since -thread-select and -stack-select-frame commands are deprecated in favor of --thread and --frame options respectively, we (at Intel) modified the fork of MI Engine we use for our gdb plugin, which we use with Intel oneAPI. We also wanted to contribute these changes to the upstream MI Engine repository. Could you review the PR and let me know if these changes look good? Please let me know if I am required to report this as an issue and track this in the PR additionally.

@WardenGnaw
Copy link
Member

@intel-rganesh Thanks for contributing this PR!

Do you know if there was a specific version of gdb that --thread and --frame was included? Would there be issues of a very old version of GDB not being able to support those flags?

@intel-rganesh
Copy link
Contributor Author

@WardenGnaw Source code of gdb 7.0.0 (Release date: Oct 06, 2009) includes this, and 6.8 does not. Please find the commit details here:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=1e92afda99a58f4427293937e49ef1ebe6bb3968

If we intend to support really old versions, I can try to fetch the version value from the log and use deprecated thread-select for older versions.

@WardenGnaw
Copy link
Member

@intel-rganesh I'm not able to see source code of GDB based on its licensing agreements.

However, version checks are useful since we do have some embedded engineers who may be using a really old version.
We have a version parser already at https://github.com/microsoft/MIEngine/blob/f530168188f23c4cf2c5799ce309ade66f854b4e/src/MICore/Debugger.cs#LL1033C1-L1048C10

@intel-rganesh intel-rganesh force-pushed the Introduce-New-Options branch 2 times, most recently from 431d72f to 503df4d Compare June 16, 2023 15:20
@intel-rganesh
Copy link
Contributor Author

I have amended my commit and used a version check that was recommended.
Please let me know if this looks good.

Copy link
Member

@WardenGnaw WardenGnaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Just one more comment.

src/MICore/CommandFactories/MICommandFactory.cs Outdated Show resolved Hide resolved
Remove -thread-select and -stack-select-frame and introduce --thread and --frame options instead.

It is general recommendation to not use -thread-select and -stack-select-frame and use --thread and --frame instead.
More info can be found here:
https://sourceware.org/gdb/onlinedocs/gdb/Context-management.html

And here are the deprecation notes:
-thread-select
-thread-select: https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Thread-Commands.html#GDB_002fMI-Thread-Commands

-stack-select-frame
-stack-select-frame: https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html#GDB_002fMI-Stack-Manipulation

Signed-off-by: intel-rganesh rakesh.ganesh@intel.com
@WardenGnaw WardenGnaw merged commit 9233ae1 into microsoft:main Jul 7, 2023
@WardenGnaw
Copy link
Member

@intel-rganesh Thank you for your contribution! We will try to get these changes in the next release as soon as we can.

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.

2 participants