Commit cc11ee15 authored by Ben A Morgan's avatar Ben A Morgan

update grammar and preposition for debugger readme

parent 8af688e2
# How to use mruby debugger mrdb
# How to Use the mruby Debugger
copyright (c) 2014 Specified Non-Profit Corporation mruby Forum
## 1.Summary
This file documents the method for using the mruby debugger 'mrdb'
## 1. Summary
## 2 debugging with mrdb
This file documents the mruby debugger ('mrdb') methods.
## 2 Debugging with mrdb
## 2.1 Building mrdb
The trunk of the mruby source tree with most recent mrdb can be checked out with following command.
The trunk of the mruby source tree, with the most recent mrdb, can be checked out with the following command:
```bash
$ git clone https://github.com/mruby-Forum/mruby.git
```
Run make command
To run the `make` command:
```bash
$ cd mruby
$ make
```
By default, make command will install debugger files into mruby/bin.
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 following command.
You can add the path for mrdb on your host environment with the following command:
```bash
$ echo "export PATH=\$PATH:MRUBY_ROOT/bin" >> ~/.bashrc
$ source ~/.bashrc
```
*MRUBY_ROOT is the directory in which mruby source code will be installed.
`*MRUBY_ROOT` is the directory in which mruby source code will be installed.
To confirm mrdb was installed properly,run mrdb with --version option
To confirm mrdb was installed properly, run mrdb with the `--version` option:
```bash
$ mrdb --version
......@@ -41,23 +43,23 @@ mruby 1.1.0 (2014-11-19)
## 2.2 Basic Operation
### 2.2.1 debugging mruby script file(rb file) with mrdb
### 2.2.1 Debugging mruby Script Files (rb file) with mrdb
To invoke mruby debugger, just type mrdb.
To invoke the mruby debugger, just type `mrdb`.
To specify the script file,
To specify the script file:
```bash
$ mrdb [option] file name
```
For example : Debugging sample.rb
For example: Debugging sample.rb
```bash
$ mrdb sample.rb
```
You can execute shell commands listed below.
You can execute the shell commands listed below:
|command|description|
|:-:|:--|
......@@ -74,20 +76,20 @@ You can execute shell commands listed below.
|help|showing help|
|quit|terminating the mruby debugger|
### 2.2.2 debugging mruby binary file(mrb file) with mrdb
### 2.2.2 Debugging mruby Binary Files (mrb file) with mrdb
You can debug the mruby binary files.
#### 2.2.2.1 debugging the binary files
#### 2.2.2.1 Debugging the binary files
* notice
To debug mruby binary files, you need to compile mruby files with option -g.
To debug mruby binary files, you need to compile mruby files with option `-g`.
```bash
$ mrbc -g sample.rb
```
You can debug the mruby binary files with following command and the option -b.
You can debug the mruby binary files with following command and the option `-b`.
```bash
$ mrdb -b sample.mrb
......@@ -95,32 +97,36 @@ $ mrdb -b sample.mrb
Then you can execute all debugger shell commands.
#### break command
you can give any breakpoint to stop the program by specifying the line number and method name.
And the breakpoint list will be displayed after you finished to set the breakpoint successfully.
#### Break Command
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:
```
break [file:]lineno
b [file:]lineno
break [file:]linenum
b [file:]linenum
break [class:]method
b [class:]method
```
The breakpoint will be numbered in serial order from 1.The number which was given to deleted breakpoint will not be given to another breakpoint again.
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 specified the line number and method.
Be ware that breakpoint command will not check the validity of the class name and method name.
You can see the current breakpoint information by following options.
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
#### continue command
#### Continue Command
Usage:
```
continue [N]
c [N]
......@@ -128,21 +134,24 @@ c [N]
N: the next breakpoint number
Resuming the program and will stop the program at breakpoint at N (N-1 breakpoint will be ignored)
When resuming the program, it will stop at breakpoint N (N-1 breakpoint will be ignored).
When you run continue command without any specifying N ,Program will be stopped at next breakpoint.
When you run the `continue` command without specifying N, the program will be stopped at the next breakpoint.
Example:
```
(foo.rb:1) continue 3
```
Resuming the program and stopping the program at the third breakpoint.
#### delete command
This will resume the profram and stop it at the third breakpoint.
Deleting specified breakpoint
#### Delete Command
This will delete the specified breakpoint.
Usage:
```
delete [breakpoint-no]
d [breakpoint-no]
......@@ -151,22 +160,25 @@ d [breakpoint-no]
breakpoint-no: breakpoint number
Example:
```
(foo.rb:1) delete
```
Deleting all breakpoints
This will delete all of the breakpoints.
```
(foo.rb:1) delete 1 3
```
Deleting the breakpoint 1 and 3
This will delete the breakpoint at 1 and 3.
#### disable command
#### Disable Command
Disabling the specified breakpoint
This will disable the specified breakpoint.
Usage:
```
disable [breakpoint-no]
dis [breakpoint-no]
......@@ -175,22 +187,25 @@ dis [breakpoint-no]
reappointing: breakpoint number
Example:
```
(foo.rb:1) disable
```
Disabling all breakpoints
Use `disable` if you would like to disable all of the breakpoints.
```
(foo.rb:1) disable 1 3
```
Disabling the breakpoint 1 and 3
This will disable the breakpoints at 1 and 3.
#### enable command
#### Enable Command
Enabling the specified breakpoint
This will enable the specified breakpoints.
Usage:
```
enable [breakpoint-no]
e [breakpoint-no]
......@@ -199,6 +214,7 @@ e [breakpoint-no]
breakpoint-no: breakpoint number
Example:
```
(foo.rb:1) enable
```
......@@ -221,17 +237,20 @@ Same as print command, please see print command.
Displaying the help message.
Usage:
```
help [command]
h [command]
```
Typing help without any option will displays the command list.
#### info breakpoints command
Typing `help` without any options will display the command list.
#### Info Breakpoints Command
Displaying the specified breakpoint information.
Usage:
```
info breakpoints [breakpoint-no]
i b [breakpoint-no]
......@@ -240,7 +259,8 @@ i b [breakpoint-no]
breakpoint-no: breakpoint number
Typing "info breakpoints" without ant option will display all breakpoint information.
Example
Example:
```
(sample.rb:1) info breakpoints
Num Type Enb What
......@@ -249,7 +269,8 @@ Num Type Enb What
3 breakpoint y in sample_global_method
```
Displaying specified the breakpoint number
Displaying the specified breakpoint number:
```
(foo.rb:1) info breakpoints 1 3
Num Type Enb What
......@@ -257,11 +278,12 @@ Num Type Enb What
3 breakpoint y in sample_global_method
```
#### list command
#### List Command
Displaying the cords of the source file.
To display the code of the source file.
Usage:
```
list [filename:]first[,last]
l [filename]:first[,last]
......@@ -270,24 +292,28 @@ l [filename]:first[,last]
first: the opening row number
last : the closing row number
When you specify first , but not specify option "last" , you will get 10 rows.
When you don not specify both of first and last, you will next 10 rows.
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 file name and first row number
sample.rb:1) list sample2.rb:5
```
Specifying file name and first and last row number
Specifying the file name and the first and last row number:
```
(sample.rb:1) list sample2.rb:6,7
```
#### print command
#### Print Command
Evaluating the string as source code and printing the value.
Usage:
```
print [expr]
p [expr]
......@@ -295,11 +321,12 @@ p [expr]
expr: expression
the expression is mandatory.
The displayed expressions will be numbered in serial order from 1.
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:
```
(sample.rb:1) print 1+2
$1 = 3
......@@ -307,35 +334,37 @@ $1 = 3
$2 = main
```
below is the case of the exception:
Below is the case of the exception:
```
(sample.rb:1) print (1+2
$1 = SyntaxError: line 1: syntax error, unexpected $end, expecting ')'
```
#### quit command
#### Quit Command
Quitting the debugger.
Usage:
```
quit
q
```
#### run command
#### Run Command
Running the program and stopping at the first breakpoint.
Usage:
```
run
r
```
#### step command
Running the program step by step.
When the method and the block will be invoked, the program will be stop at the first row.
The program which is developed by C language will be ignored.
#### Step Command
EOF
This will run the program step by step.
When the method and the block are invoked, the program will be stop at the first row.
The program, which is developed in C, will be ignored.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment