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

Add variable evaluation logic #16

Open
dylandreimerink opened this issue May 23, 2022 · 0 comments
Open

Add variable evaluation logic #16

dylandreimerink opened this issue May 23, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@dylandreimerink
Copy link
Owner

A common feature is to be able to perform some basic evaluations on the current program state. This issue proposes to add a eval/exec/call command to the debugger which then will evaluate an expression like local_var_a == struct a{.a=123, .b=234}, global_var_b >= 20 && !global_var_c, or simply local_var_d (which will print its value if it exists).

This has the following purposes/goals:

  • Together with the new command, this is an easy way to inspect the current program state.
  • These same expressions can be used for conditional breakpoints and logging break points.
  • Could be a stepping stone to more complex macros for more advanced automation.

The exact feature set is something to be determined and can be iterated over time, here are some initial suggestions:

  • Reference local variables (see Local variable inspection #13)
  • Reference global variables (see Global variable inspection #14)
  • Reference registers, perhaps like #R1 or some other prefix which is illegal in C identifiers to avoid conflicts
  • Have boolean operators ==, !=, >=, <=, <, >
  • Use BTF to match int, string, bool, struct types.
  • true and false keywords for boolean comparason
  • Round brackets(( and )) to indicate precedence, otherwise left to right.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant