-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[LLDB] Add AST node classes, functions, etc. for Data Inspection Lang… #95738
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
Open
cmtice
wants to merge
10
commits into
llvm:main
Choose a base branch
from
cmtice:dil-ast
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c703c47
[LLDB] Add AST node classes, functions, etc. for Data Inspection Lang…
cmtice d38cdf0
[LLDB] Add AST node classes, functions, etc. for Data Inspection Lang…
cmtice c230c28
[LLDB] Add AST node classes, functions, etc. for Data Inspection Lang…
cmtice 17a5934
Fix clang format issue.
cmtice 1b4cdb7
Merge remote-tracking branch 'origin/main' into dil-ast
cmtice d5f7e77
[LLDB] Add AST node classes & functions for Data Inspection Language
cmtice 33d1345
[LLDB] Add AST node classes, functions, etc. for Data Inspection Lang…
cmtice e9ea8b2
Merge remote-tracking branch 'origin/main' into dil-ast
cmtice 41ced65
[LLDB] Add AST node clases, functions, etc. for Data Inspection Language
cmtice 4ff808a
Fix clang format issues.
cmtice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
(* LLDB Debug Expressions, a subset of C++ *) | ||
(* Insired by https://www.nongnu.org/hcb *) | ||
|
||
expression = unary_expression; | ||
|
||
unary_expression = postfix_expression | ||
| unary_operator unary_expression; | ||
|
||
unary_operator = "*" | "&" | "-" ; | ||
|
||
postfix_expression = primary_expression | ||
| postfix_expression "[" expression "]" | ||
| postfix_expression "." id_expression | ||
| postfix_expression "->" id_expression | ||
|
||
primary_expression = numeric_literal | ||
| boolean_literal | ||
| pointer_literal | ||
| id_expression; | ||
|
||
nested_name_specifier = namespace_name '::' | ||
| nested_name_specifier identifier "::"; | ||
|
||
namespace_name = identifier ; | ||
|
||
id_expression = unqualified_id | ||
| qualified_id ; | ||
|
||
unqualified_id = identifier ; | ||
|
||
qualified_id = [nested_name_specifier] unqualified_id | ||
| identifier ; | ||
|
||
identifier = ? clang::tok::identifier ? ; | ||
|
||
numeric_literal = ? clang::tok::numeric_constant ? ; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to allow state-changing expressions in the
frame var
language?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is pretty useful to be able to easily change the program state and afaik it's already possible with
expr
command. Generally other debugger allow this as well (e.g. Visual Studio), so I think it's a reasonable thing to do. However, for increments specifically there's a deeper reason here (and I would agree that they probably shouldn't be available for general use). See my big comment below for justification.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to have a convenient way to change a variable value without invoking the full expression parser (or going into python), but I think there's a discussion to be made about how to expose that functionality. For example, the current envisioned entry points into this code (the "frame variable" CLI cmd, and
SBFrame.GetValueForVariablePath
don't exactly sound like they ought to be modifying the variable in the process of "getting" it).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand, many users confuse or conflate "frame variable" with "p" (the short-cut for the expression evaluator), the "p" certainly allows updating the variable value...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might be one way to resolve this -- have p/dwim-print activate some "extended" mode of DIL which allows for variable modification. But let's save that for later...