Skip to content

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

Merged
WardenGnaw merged 2 commits intomicrosoft:mainfrom
iyerrakesh:Introduce-New-Options
Jul 7, 2023
Merged

MIEngine: Introduce --thread and --frame options#1401
WardenGnaw merged 2 commits intomicrosoft:mainfrom
iyerrakesh:Introduce-New-Options

Conversation

@iyerrakesh
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

@iyerrakesh
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.

@iyerrakesh iyerrakesh force-pushed the Introduce-New-Options branch from e83b4b5 to 64d6630 Compare May 16, 2023 12:08
@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?

@iyerrakesh
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

@iyerrakesh iyerrakesh force-pushed the Introduce-New-Options branch 2 times, most recently from 431d72f to 503df4d Compare June 16, 2023 15:20
@iyerrakesh
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.

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
@iyerrakesh iyerrakesh force-pushed the Introduce-New-Options branch from 503df4d to b7a764f Compare July 6, 2023 15:33
@iyerrakesh iyerrakesh requested a review from WardenGnaw July 6, 2023 15:40
@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