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

Naive_interpreter : Adding object inspector #2696

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Delja
Copy link
Contributor

@Delja Delja commented May 17, 2018

Add an object inspector to the naive interpreter.
To use it, you call the .inspect_o method on the object you want to inspect. The interpreter will then display the object as a tree. Note that the call to .inspect_o is considered as a breakpoint and will stop the interpreter from running to enter on step-by-step mode. To define some breakpoints on start interpretation you can use the command –break, to add breakpoint enter ‘break [file name] [line numbers]’ to remove breakpoint enter ‘clear [file name] [line numbers]’.

The step-by-step mode offers different features:

  • The step-into which allows to enter a method during its call (Enter 'in' to perform this action).
  • The step-over which makes it possible to inspect the same method line by line. If there is no more line in the method we come back to the calling method, if there is no more line at all it means that the execution is over. (Press 'enter' to perform this action).
  • Display local variables of the currently executed method (Enter 'all' to perform this action)
  • The display of previously inspected objects (Enter 'watch' to perform this action)
  • Start the execution until the next breakpoint (Enter 'next' to perform this action)
  • Adding and removing breakpoint during the interpretation

If you enter anything else you will leave the step-by-step mode

@xymus
Copy link
Contributor

xymus commented May 20, 2018

🤖 ok to test

@Delja Delja force-pushed the stream branch 9 times, most recently from 088c2b1 to 0c82c50 Compare May 24, 2018 16:03
Copy link
Member

@privat privat left a comment

Choose a reason for hiding this comment

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

  • move most stuff into a submodule of native_interpreter (that you can intrude import)
  • simplify the frame management that is very complicated
  • use command names of gdb. eg. next step continue and finish

Delja added 6 commits June 12, 2018 11:39
This method is catch by the interpreter to display the object value and to start the step-by-step execution.
This method MUST not be used by programs, it is here for debugging in the interpreter

Signed-off-by: Florian Deljarry <[email protected]>
Add : - Class ObjectInspected to represent the inspected object
      - Class ObjectInspector to provide the inspect_object method that will return the inspect object as a tree (OrderedTree[ObjectInspected])

Signed-off-by: Florian Deljarry <[email protected]>
Add : 	-The step-by-step execution in naive_interpreter
	-Print the inspected object

Signed-off-by: Florian Deljarry <[email protected]>
Add:    -'backtrace full' option to print the local variables of the method
        -'watch' option to print all selected values with 'object_id'
        -'continue' option to execute the code until the next break point 'object_id'

Signed-off-by: Florian Deljarry <[email protected]>
Add:  	- Reading null variables and instances
	- Using step interpreter to interpretation


Signed-off-by: Florian Deljarry <[email protected]>
@Delja Delja force-pushed the stream branch 2 times, most recently from 9b04ba9 to 9d490aa Compare June 12, 2018 19:34
Adding the Possibility to add and remove breakpoint during the interpretationNew breakpoint future

Signed-off-by: Florian Deljarry <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants