Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "CDT/Archive/EnhancedExpressions"
(New page: == Introduction == Currently, the Registers view for CDT/GDB shows all registers in a flat list. For targets with a large number of registers this is not very user-friendly. == Proposa...) |
(→Proposal) |
||
Line 13: | Line 13: | ||
Note that CDT's Expressions view already allows the user to examine individual registers, so this feature would only introduce the pattern matching support. | Note that CDT's Expressions view already allows the user to examine individual registers, so this feature would only introduce the pattern matching support. | ||
− | Regular Expressions are very powerful but not always easy to quickly use. I suggest we instead support glob-patterns. Glob-patterns are simpler than full regular experssions, and are the patterns used in command-shell pattern matching ( * ? [] ). They are more user-friendly that regex and would provide enough flexibility for what we are trying to achieve. Details can be found | + | Regular Expressions are very powerful but not always easy to quickly use. I suggest we instead support glob-patterns. Glob-patterns are simpler than full regular experssions, and are the patterns used in command-shell pattern matching ( * ? [] ). They are more user-friendly that regex and would provide enough flexibility for what we are trying to achieve. Details on glob patterns can be found in [http://www.kernel.org/doc/man-pages/online/pages/man7/glob.7.html The Linux Glob man page] and in [http://en.wikipedia.org/wiki/Glob_(programming) Wikipedia] |
− | [http://www.kernel.org/doc/man-pages/online/pages/man7/glob.7.html Glob man page] | + | |
− | [http://en.wikipedia.org/wiki/Glob_(programming) | + | |
Below are screenshots of a prototype I have implemented. It would need some cleanup, but it shows | Below are screenshots of a prototype I have implemented. It would need some cleanup, but it shows | ||
how the feature would be used. | how the feature would be used. | ||
− | + | ||
[[Image:CDT_GlobExp2.png]] | [[Image:CDT_GlobExp2.png]] | ||
+ | |||
+ | |||
+ | The user would simply type the glob-expression in the "Add new expression" box as she would for any other expression. That pattern will be detected and all matching registers will be shown as children of the glob-expression. | ||
+ | |||
+ | [[Image:CDT_GlobExp1.png]] | ||
+ | |||
+ | |||
+ | Although this feature is focusing on registers (only expressions starting with $ will allow glob-patterns) it may be a nice enhancement to extend this to other expressions. If that was also supported, a user could do such things as create an expression 'myArray[20-120] to only show subset of an array; many other examples can be imagined as well. With this in mind, the prototype does allow for the expression: * In this case, all local variables will be shown in the Expressions view. This gives the Expressions view the ability to behave as the variables view does, following the current Debug view selection. | ||
+ | |||
+ | |||
[[Image:CDT_GlobExp3.png]] | [[Image:CDT_GlobExp3.png]] | ||
+ | |||
+ | Furthermore, with the use of view cloning, the user can clone the Enhanced Expressions view one or more times, to allow to look at different sets of expressions/registers and position them anywhere on the screen: | ||
+ | |||
+ | |||
[[Image:CDT_GlobExp4.png]] | [[Image:CDT_GlobExp4.png]] |
Revision as of 14:14, 5 June 2012
Introduction
Currently, the Registers view for CDT/GDB shows all registers in a flat list. For targets with a large number of registers this is not very user-friendly.
Proposal
Add support pattern-matching within the Expressions view to allow users to easily create groups of registers. For example:
$* would display all registers $st[0-5] would show $st0, $st1 , ... $st5 $*mm[0-1] would show any registers ending with mm0 or mm1
Note that CDT's Expressions view already allows the user to examine individual registers, so this feature would only introduce the pattern matching support.
Regular Expressions are very powerful but not always easy to quickly use. I suggest we instead support glob-patterns. Glob-patterns are simpler than full regular experssions, and are the patterns used in command-shell pattern matching ( * ? [] ). They are more user-friendly that regex and would provide enough flexibility for what we are trying to achieve. Details on glob patterns can be found in The Linux Glob man page and in Wikipedia
Below are screenshots of a prototype I have implemented. It would need some cleanup, but it shows how the feature would be used.
The user would simply type the glob-expression in the "Add new expression" box as she would for any other expression. That pattern will be detected and all matching registers will be shown as children of the glob-expression.
Although this feature is focusing on registers (only expressions starting with $ will allow glob-patterns) it may be a nice enhancement to extend this to other expressions. If that was also supported, a user could do such things as create an expression 'myArray[20-120] to only show subset of an array; many other examples can be imagined as well. With this in mind, the prototype does allow for the expression: * In this case, all local variables will be shown in the Expressions view. This gives the Expressions view the ability to behave as the variables view does, following the current Debug view selection.
Furthermore, with the use of view cloning, the user can clone the Enhanced Expressions view one or more times, to allow to look at different sets of expressions/registers and position them anywhere on the screen: