![]() |
mruby 3.3.0
mruby is the lightweight implementation of the Ruby language
|
copyright (c) 2014 Specified Non-Profit Corporation mruby Forum
This file documents the mruby debugger ('mrdb') methods.
The trunk of the mruby source tree, with the most recent mrdb, can be checked out with the following command:
To run the make
command:
By default, the make
command will install the debugger files into mruby/bin.
You can add the path for mrdb on your host environment with the following command:
*MRUBY_ROOT
is the directory in which mruby source code will be installed.
To confirm mrdb was installed properly, run mrdb with the --version
option:
To invoke the mruby debugger, just type mrdb
.
To specify the script file:
For example: Debugging sample.rb
You can execute the shell commands listed below:
command | description |
---|---|
run | execute programs |
step | execute stepping |
continue | execute continuing program |
break | configure the breaking point |
delete | deleting the breaking points |
disable | disabling the breaking points |
enable | enabling the breaking points |
info breakpoints | showing list of the breaking points |
evaluating and printing the values of the mruby expressions in the script | |
list | displaying the source cords |
help | showing help |
quit | terminating the mruby debugger |
You can debug the mruby binary files.
-g
.You can debug the mruby binary files with following command and the option -b
.
Then you can execute all debugger shell commands.
You can use any breakpoint to stop the program by specifying the line number and method name. The breakpoint list will be displayed after you have set the breakpoint successfully.
Usage:
The breakpoint will be ordered in serial from 1. The number, which was given to the deleted breakpoint, will never be given to another breakpoint again.
You can give multiple breakpoints to the specified the line number and method. Be aware that the breakpoint command will not check the validity of the class name and method name.
You can get the current breakpoint information by the following options.
breakpoint breakpoint number : file name. line number
breakpoint breakpoint number : [class name,] method name
Usage:
N: the next breakpoint number
When resuming the program, it will stop at breakpoint N (N-1 breakpoint will be ignored).
When you run the continue
command without specifying N, the program will be stopped at the next breakpoint.
Example:
This will resume the program and stop it at the third breakpoint.
This will delete the specified breakpoint.
Usage:
breakpoint-no: breakpoint number
Example:
This will delete all the breakpoints.
This will delete the breakpoint at 1 and 3.
This will disable the specified breakpoint.
Usage:
reappointing: breakpoint number
Example:
Use disable
if you would like to disable all the breakpoints.
This will disable the breakpoints at 1 and 3.
This will enable the specified breakpoints.
Usage:
breakpoint-no: breakpoint number
Example:
Enabling all breakpoints
Enabling the breakpoint 1 and 3
Evaluating the string as source code and printing the value.
Same as print command, please see print command.
Displaying the help message.
Usage:
Typing help
without any options will display the command list.
Displaying the specified breakpoint information.
Usage:
breakpoint-no: breakpoint number
Typing "info breakpoints" without ant option will display all breakpoint information. Example:
Displaying the specified breakpoint number:
To display the code of the source file.
Usage:
first: the opening row number last : the closing row number
When you specify the first
, but not the last
option, you will receive 10 rows. When you do not specify both the first
and last
options, you will receive the next 10 rows.
Example:
Specifying the file name and the first and last row number:
Evaluating the string as source code and printing the value.
Usage:
expr: expression
The expression is mandatory. The displayed expressions will be serially ordered from 1. If an exception occurs, the exception information will be displayed, and the debugging will be continued.
Example:
Below is the case of the exception:
Quitting the debugger.
Usage:
Running the program and stopping at the first breakpoint.
Usage:
This will run the program step by step. When the method and the block are invoked, the program will stop at the first row. The program, which is developed in C, will be ignored.