Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
fbf4089d
Commit
fbf4089d
authored
Apr 03, 2017
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove spaces around parens
parent
666787be
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
142 additions
and
142 deletions
+142
-142
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
+76
-76
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.h
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.h
+13
-13
mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c
mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c
+32
-32
mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c
mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c
+1
-1
mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c
mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c
+4
-4
mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c
mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c
+12
-12
src/class.c
src/class.c
+1
-1
src/vm.c
src/vm.c
+3
-3
No files found.
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c
View file @
fbf4089d
This diff is collapsed.
Click to expand it.
mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.h
View file @
fbf4089d
...
@@ -9,18 +9,18 @@
...
@@ -9,18 +9,18 @@
#include <mruby.h>
#include <mruby.h>
#include "mrdb.h"
#include "mrdb.h"
int32_t
mrb_debug_set_break_line
(
mrb_state
*
,
mrb_debug_context
*
,
const
char
*
,
uint16_t
);
int32_t
mrb_debug_set_break_line
(
mrb_state
*
,
mrb_debug_context
*
,
const
char
*
,
uint16_t
);
int32_t
mrb_debug_set_break_method
(
mrb_state
*
,
mrb_debug_context
*
,
const
char
*
,
const
char
*
);
int32_t
mrb_debug_set_break_method
(
mrb_state
*
,
mrb_debug_context
*
,
const
char
*
,
const
char
*
);
int32_t
mrb_debug_get_breaknum
(
mrb_state
*
,
mrb_debug_context
*
);
int32_t
mrb_debug_get_breaknum
(
mrb_state
*
,
mrb_debug_context
*
);
int32_t
mrb_debug_get_break_all
(
mrb_state
*
,
mrb_debug_context
*
,
uint32_t
,
mrb_debug_breakpoint
bp
[]);
int32_t
mrb_debug_get_break_all
(
mrb_state
*
,
mrb_debug_context
*
,
uint32_t
,
mrb_debug_breakpoint
bp
[]);
int32_t
mrb_debug_get_break
(
mrb_state
*
,
mrb_debug_context
*
,
uint32_t
,
mrb_debug_breakpoint
*
);
int32_t
mrb_debug_get_break
(
mrb_state
*
,
mrb_debug_context
*
,
uint32_t
,
mrb_debug_breakpoint
*
);
int32_t
mrb_debug_delete_break
(
mrb_state
*
,
mrb_debug_context
*
,
uint32_t
);
int32_t
mrb_debug_delete_break
(
mrb_state
*
,
mrb_debug_context
*
,
uint32_t
);
int32_t
mrb_debug_delete_break_all
(
mrb_state
*
,
mrb_debug_context
*
);
int32_t
mrb_debug_delete_break_all
(
mrb_state
*
,
mrb_debug_context
*
);
int32_t
mrb_debug_enable_break
(
mrb_state
*
,
mrb_debug_context
*
,
uint32_t
);
int32_t
mrb_debug_enable_break
(
mrb_state
*
,
mrb_debug_context
*
,
uint32_t
);
int32_t
mrb_debug_enable_break_all
(
mrb_state
*
,
mrb_debug_context
*
);
int32_t
mrb_debug_enable_break_all
(
mrb_state
*
,
mrb_debug_context
*
);
int32_t
mrb_debug_disable_break
(
mrb_state
*
,
mrb_debug_context
*
,
uint32_t
);
int32_t
mrb_debug_disable_break
(
mrb_state
*
,
mrb_debug_context
*
,
uint32_t
);
int32_t
mrb_debug_disable_break_all
(
mrb_state
*
,
mrb_debug_context
*
);
int32_t
mrb_debug_disable_break_all
(
mrb_state
*
,
mrb_debug_context
*
);
int32_t
mrb_debug_check_breakpoint_line
(
mrb_state
*
,
mrb_debug_context
*
,
const
char
*
,
uint16_t
);
int32_t
mrb_debug_check_breakpoint_line
(
mrb_state
*
,
mrb_debug_context
*
,
const
char
*
,
uint16_t
);
int32_t
mrb_debug_check_breakpoint_method
(
mrb_state
*
,
mrb_debug_context
*
,
struct
RClass
*
,
mrb_sym
,
mrb_bool
*
);
int32_t
mrb_debug_check_breakpoint_method
(
mrb_state
*
,
mrb_debug_context
*
,
struct
RClass
*
,
mrb_sym
,
mrb_bool
*
);
#endif
/* APIBREAK_H_ */
#endif
/* APIBREAK_H_ */
mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c
View file @
fbf4089d
...
@@ -70,12 +70,12 @@ parse_breakpoint_no(char* args)
...
@@ -70,12 +70,12 @@ parse_breakpoint_no(char* args)
char
*
ps
=
args
;
char
*
ps
=
args
;
uint32_t
l
;
uint32_t
l
;
if
((
*
ps
==
'0'
)
||
(
strlen
(
ps
)
>=
BPNO_LETTER_NUM
))
{
if
((
*
ps
==
'0'
)
||
(
strlen
(
ps
)
>=
BPNO_LETTER_NUM
))
{
return
0
;
return
0
;
}
}
while
(
!
(
ISBLANK
(
*
ps
)
||
ISCNTRL
(
*
ps
))
)
{
while
(
!
(
ISBLANK
(
*
ps
)
||
ISCNTRL
(
*
ps
))
)
{
if
(
!
ISDIGIT
(
*
ps
))
{
if
(
!
ISDIGIT
(
*
ps
))
{
return
0
;
return
0
;
}
}
ps
++
;
ps
++
;
...
@@ -90,7 +90,7 @@ exe_set_command_all(mrb_state *mrb, mrdb_state *mrdb, all_command_func func)
...
@@ -90,7 +90,7 @@ exe_set_command_all(mrb_state *mrb, mrdb_state *mrdb, all_command_func func)
{
{
int32_t
ret
=
MRB_DEBUG_OK
;
int32_t
ret
=
MRB_DEBUG_OK
;
if
(
mrdb
->
wcnt
==
1
)
{
if
(
mrdb
->
wcnt
==
1
)
{
ret
=
func
(
mrb
,
mrdb
->
dbg
);
ret
=
func
(
mrb
,
mrdb
->
dbg
);
print_api_common_error
(
ret
);
print_api_common_error
(
ret
);
return
TRUE
;
return
TRUE
;
...
@@ -109,15 +109,15 @@ exe_set_command_select(mrb_state *mrb, mrdb_state *mrdb, select_command_func fun
...
@@ -109,15 +109,15 @@ exe_set_command_select(mrb_state *mrb, mrdb_state *mrdb, select_command_func fun
for
(
i
=
1
;
i
<
mrdb
->
wcnt
;
i
++
)
{
for
(
i
=
1
;
i
<
mrdb
->
wcnt
;
i
++
)
{
ps
=
mrdb
->
words
[
i
];
ps
=
mrdb
->
words
[
i
];
bpno
=
parse_breakpoint_no
(
ps
);
bpno
=
parse_breakpoint_no
(
ps
);
if
(
bpno
==
0
)
{
if
(
bpno
==
0
)
{
printf
(
BREAK_ERR_MSG_INVALIDBPNO
,
ps
);
printf
(
BREAK_ERR_MSG_INVALIDBPNO
,
ps
);
break
;
break
;
}
}
ret
=
func
(
mrb
,
mrdb
->
dbg
,
(
uint32_t
)
bpno
);
ret
=
func
(
mrb
,
mrdb
->
dbg
,
(
uint32_t
)
bpno
);
if
(
ret
==
MRB_DEBUG_BREAK_INVALID_NO
)
{
if
(
ret
==
MRB_DEBUG_BREAK_INVALID_NO
)
{
printf
(
BREAK_ERR_MSG_NOBPNO
,
bpno
);
printf
(
BREAK_ERR_MSG_NOBPNO
,
bpno
);
}
}
else
if
(
ret
!=
MRB_DEBUG_OK
)
{
else
if
(
ret
!=
MRB_DEBUG_OK
)
{
print_api_common_error
(
ret
);
print_api_common_error
(
ret
);
}
}
}
}
...
@@ -128,24 +128,24 @@ check_bptype(char* args)
...
@@ -128,24 +128,24 @@ check_bptype(char* args)
{
{
char
*
ps
=
args
;
char
*
ps
=
args
;
if
(
ISBLANK
(
*
ps
)
||
ISCNTRL
(
*
ps
))
{
if
(
ISBLANK
(
*
ps
)
||
ISCNTRL
(
*
ps
))
{
puts
(
BREAK_ERR_MSG_BLANK
);
puts
(
BREAK_ERR_MSG_BLANK
);
return
MRB_DEBUG_BPTYPE_NONE
;
return
MRB_DEBUG_BPTYPE_NONE
;
}
}
if
(
!
ISDIGIT
(
*
ps
))
{
if
(
!
ISDIGIT
(
*
ps
))
{
return
MRB_DEBUG_BPTYPE_METHOD
;
return
MRB_DEBUG_BPTYPE_METHOD
;
}
}
while
(
!
(
ISBLANK
(
*
ps
)
||
ISCNTRL
(
*
ps
))
)
{
while
(
!
(
ISBLANK
(
*
ps
)
||
ISCNTRL
(
*
ps
))
)
{
if
(
!
ISDIGIT
(
*
ps
))
{
if
(
!
ISDIGIT
(
*
ps
))
{
printf
(
BREAK_ERR_MSG_INVALIDSTR
,
args
);
printf
(
BREAK_ERR_MSG_INVALIDSTR
,
args
);
return
MRB_DEBUG_BPTYPE_NONE
;
return
MRB_DEBUG_BPTYPE_NONE
;
}
}
ps
++
;
ps
++
;
}
}
if
((
*
args
==
'0'
)
||
(
strlen
(
args
)
>=
LINENO_MAX_DIGIT
))
{
if
((
*
args
==
'0'
)
||
(
strlen
(
args
)
>=
LINENO_MAX_DIGIT
))
{
puts
(
BREAK_ERR_MSG_RANGEOVER
);
puts
(
BREAK_ERR_MSG_RANGEOVER
);
return
MRB_DEBUG_BPTYPE_NONE
;
return
MRB_DEBUG_BPTYPE_NONE
;
}
}
...
@@ -158,12 +158,12 @@ print_breakpoint(mrb_debug_breakpoint *bp)
...
@@ -158,12 +158,12 @@ print_breakpoint(mrb_debug_breakpoint *bp)
{
{
const
char
*
enable_letter
[]
=
{
BREAK_INFO_MSG_DISABLE
,
BREAK_INFO_MSG_ENABLE
};
const
char
*
enable_letter
[]
=
{
BREAK_INFO_MSG_DISABLE
,
BREAK_INFO_MSG_ENABLE
};
if
(
bp
->
type
==
MRB_DEBUG_BPTYPE_LINE
)
{
if
(
bp
->
type
==
MRB_DEBUG_BPTYPE_LINE
)
{
printf
(
BREAK_INFO_MSG_LINEBREAK
,
printf
(
BREAK_INFO_MSG_LINEBREAK
,
bp
->
bpno
,
enable_letter
[
bp
->
enable
],
bp
->
point
.
linepoint
.
file
,
bp
->
point
.
linepoint
.
lineno
);
bp
->
bpno
,
enable_letter
[
bp
->
enable
],
bp
->
point
.
linepoint
.
file
,
bp
->
point
.
linepoint
.
lineno
);
}
}
else
{
else
{
if
(
bp
->
point
.
methodpoint
.
class_name
==
NULL
)
{
if
(
bp
->
point
.
methodpoint
.
class_name
==
NULL
)
{
printf
(
BREAK_INFO_MSG_METHODBREAK_NOCLASS
,
printf
(
BREAK_INFO_MSG_METHODBREAK_NOCLASS
,
bp
->
bpno
,
enable_letter
[
bp
->
enable
],
bp
->
point
.
methodpoint
.
method_name
);
bp
->
bpno
,
enable_letter
[
bp
->
enable
],
bp
->
point
.
methodpoint
.
method_name
);
}
}
...
@@ -183,18 +183,18 @@ info_break_all(mrb_state *mrb, mrdb_state *mrdb)
...
@@ -183,18 +183,18 @@ info_break_all(mrb_state *mrb, mrdb_state *mrdb)
mrb_debug_breakpoint
*
bp_list
;
mrb_debug_breakpoint
*
bp_list
;
bpnum
=
mrb_debug_get_breaknum
(
mrb
,
mrdb
->
dbg
);
bpnum
=
mrb_debug_get_breaknum
(
mrb
,
mrdb
->
dbg
);
if
(
bpnum
<
0
)
{
if
(
bpnum
<
0
)
{
print_api_common_error
(
bpnum
);
print_api_common_error
(
bpnum
);
return
;
return
;
}
}
else
if
(
bpnum
==
0
)
{
else
if
(
bpnum
==
0
)
{
puts
(
BREAK_ERR_MSG_NOBPNO_INFOALL
);
puts
(
BREAK_ERR_MSG_NOBPNO_INFOALL
);
return
;
return
;
}
}
bp_list
=
(
mrb_debug_breakpoint
*
)
mrb_malloc
(
mrb
,
bpnum
*
sizeof
(
mrb_debug_breakpoint
));
bp_list
=
(
mrb_debug_breakpoint
*
)
mrb_malloc
(
mrb
,
bpnum
*
sizeof
(
mrb_debug_breakpoint
));
ret
=
mrb_debug_get_break_all
(
mrb
,
mrdb
->
dbg
,
(
uint32_t
)
bpnum
,
bp_list
);
ret
=
mrb_debug_get_break_all
(
mrb
,
mrdb
->
dbg
,
(
uint32_t
)
bpnum
,
bp_list
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
print_api_common_error
(
ret
);
print_api_common_error
(
ret
);
return
;
return
;
}
}
...
@@ -219,21 +219,21 @@ info_break_select(mrb_state *mrb, mrdb_state *mrdb)
...
@@ -219,21 +219,21 @@ info_break_select(mrb_state *mrb, mrdb_state *mrdb)
for
(
i
=
2
;
i
<
mrdb
->
wcnt
;
i
++
)
{
for
(
i
=
2
;
i
<
mrdb
->
wcnt
;
i
++
)
{
ps
=
mrdb
->
words
[
i
];
ps
=
mrdb
->
words
[
i
];
bpno
=
parse_breakpoint_no
(
ps
);
bpno
=
parse_breakpoint_no
(
ps
);
if
(
bpno
==
0
)
{
if
(
bpno
==
0
)
{
puts
(
BREAK_ERR_MSG_INVALIDBPNO_INFO
);
puts
(
BREAK_ERR_MSG_INVALIDBPNO_INFO
);
break
;
break
;
}
}
ret
=
mrb_debug_get_break
(
mrb
,
mrdb
->
dbg
,
bpno
,
&
bp
);
ret
=
mrb_debug_get_break
(
mrb
,
mrdb
->
dbg
,
bpno
,
&
bp
);
if
(
ret
==
MRB_DEBUG_BREAK_INVALID_NO
)
{
if
(
ret
==
MRB_DEBUG_BREAK_INVALID_NO
)
{
printf
(
BREAK_ERR_MSG_NOBPNO_INFO
,
bpno
);
printf
(
BREAK_ERR_MSG_NOBPNO_INFO
,
bpno
);
break
;
break
;
}
}
else
if
(
ret
!=
MRB_DEBUG_OK
)
{
else
if
(
ret
!=
MRB_DEBUG_OK
)
{
print_api_common_error
(
ret
);
print_api_common_error
(
ret
);
break
;
break
;
}
}
else
if
(
isFirst
==
TRUE
)
{
else
if
(
isFirst
==
TRUE
)
{
isFirst
=
FALSE
;
isFirst
=
FALSE
;
puts
(
BREAK_INFO_MSG_HEADER
);
puts
(
BREAK_INFO_MSG_HEADER
);
}
}
...
@@ -250,17 +250,17 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c
...
@@ -250,17 +250,17 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c
mrb_debug_bptype
type
;
mrb_debug_bptype
type
;
uint32_t
l
;
uint32_t
l
;
if
(
mrdb
->
wcnt
<=
1
)
{
if
(
mrdb
->
wcnt
<=
1
)
{
puts
(
BREAK_ERR_MSG_BLANK
);
puts
(
BREAK_ERR_MSG_BLANK
);
return
MRB_DEBUG_BPTYPE_NONE
;
return
MRB_DEBUG_BPTYPE_NONE
;
}
}
args
=
mrdb
->
words
[
1
];
args
=
mrdb
->
words
[
1
];
if
((
body
=
strrchr
(
args
,
':'
))
==
NULL
)
{
if
((
body
=
strrchr
(
args
,
':'
))
==
NULL
)
{
body
=
args
;
body
=
args
;
type
=
check_bptype
(
body
);
type
=
check_bptype
(
body
);
}
else
{
}
else
{
if
(
body
==
args
)
{
if
(
body
==
args
)
{
printf
(
BREAK_ERR_MSG_INVALIDSTR
,
args
);
printf
(
BREAK_ERR_MSG_INVALIDSTR
,
args
);
return
MRB_DEBUG_BPTYPE_NONE
;
return
MRB_DEBUG_BPTYPE_NONE
;
}
}
...
@@ -271,7 +271,7 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c
...
@@ -271,7 +271,7 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c
switch
(
type
)
{
switch
(
type
)
{
case
MRB_DEBUG_BPTYPE_LINE
:
case
MRB_DEBUG_BPTYPE_LINE
:
STRTOUL
(
l
,
body
);
STRTOUL
(
l
,
body
);
if
(
l
<=
65535
)
{
if
(
l
<=
65535
)
{
*
line
=
l
;
*
line
=
l
;
*
file
=
(
body
==
args
)
?
mrb_debug_get_filename
(
dbg
->
irep
,
(
uint32_t
)(
dbg
->
pc
-
dbg
->
irep
->
iseq
))
:
args
;
*
file
=
(
body
==
args
)
?
mrb_debug_get_filename
(
dbg
->
irep
,
(
uint32_t
)(
dbg
->
pc
-
dbg
->
irep
->
iseq
))
:
args
;
}
else
{
}
else
{
...
@@ -280,9 +280,9 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c
...
@@ -280,9 +280,9 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c
}
}
break
;
break
;
case
MRB_DEBUG_BPTYPE_METHOD
:
case
MRB_DEBUG_BPTYPE_METHOD
:
if
(
body
==
args
)
{
if
(
body
==
args
)
{
/* method only */
/* method only */
if
(
ISUPPER
(
*
body
)
||
ISLOWER
(
*
body
)
||
(
*
body
==
'_'
)
)
{
if
(
ISUPPER
(
*
body
)
||
ISLOWER
(
*
body
)
||
(
*
body
==
'_'
)
)
{
*
method
=
body
;
*
method
=
body
;
*
cname
=
NULL
;
*
cname
=
NULL
;
}
else
{
}
else
{
...
@@ -290,7 +290,7 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c
...
@@ -290,7 +290,7 @@ parse_breakcommand(mrdb_state *mrdb, const char **file, uint32_t *line, char **c
type
=
MRB_DEBUG_BPTYPE_NONE
;
type
=
MRB_DEBUG_BPTYPE_NONE
;
}
}
}
else
{
}
else
{
if
(
ISUPPER
(
*
args
)
)
{
if
(
ISUPPER
(
*
args
)
)
{
switch
(
*
body
)
{
switch
(
*
body
)
{
case
'@'
:
case
'$'
:
case
'?'
:
case
'.'
:
case
','
:
case
':'
:
case
'@'
:
case
'$'
:
case
'?'
:
case
'.'
:
case
','
:
case
':'
:
case
';'
:
case
'#'
:
case
'\\'
:
case
'\''
:
case
'\"'
:
case
';'
:
case
'#'
:
case
'\\'
:
case
'\''
:
case
'\"'
:
...
@@ -379,7 +379,7 @@ dbgcmd_break(mrb_state *mrb, mrdb_state *mrdb)
...
@@ -379,7 +379,7 @@ dbgcmd_break(mrb_state *mrb, mrdb_state *mrdb)
dbgcmd_state
dbgcmd_state
dbgcmd_info_break
(
mrb_state
*
mrb
,
mrdb_state
*
mrdb
)
dbgcmd_info_break
(
mrb_state
*
mrb
,
mrdb_state
*
mrdb
)
{
{
if
(
mrdb
->
wcnt
==
2
)
{
if
(
mrdb
->
wcnt
==
2
)
{
info_break_all
(
mrb
,
mrdb
);
info_break_all
(
mrb
,
mrdb
);
}
}
else
{
else
{
...
@@ -395,7 +395,7 @@ dbgcmd_delete(mrb_state *mrb, mrdb_state *mrdb)
...
@@ -395,7 +395,7 @@ dbgcmd_delete(mrb_state *mrb, mrdb_state *mrdb)
mrb_bool
ret
=
FALSE
;
mrb_bool
ret
=
FALSE
;
ret
=
exe_set_command_all
(
mrb
,
mrdb
,
mrb_debug_delete_break_all
);
ret
=
exe_set_command_all
(
mrb
,
mrdb
,
mrb_debug_delete_break_all
);
if
(
ret
!=
TRUE
)
{
if
(
ret
!=
TRUE
)
{
exe_set_command_select
(
mrb
,
mrdb
,
mrb_debug_delete_break
);
exe_set_command_select
(
mrb
,
mrdb
,
mrb_debug_delete_break
);
}
}
...
@@ -408,7 +408,7 @@ dbgcmd_enable(mrb_state *mrb, mrdb_state *mrdb)
...
@@ -408,7 +408,7 @@ dbgcmd_enable(mrb_state *mrb, mrdb_state *mrdb)
mrb_bool
ret
=
FALSE
;
mrb_bool
ret
=
FALSE
;
ret
=
exe_set_command_all
(
mrb
,
mrdb
,
mrb_debug_enable_break_all
);
ret
=
exe_set_command_all
(
mrb
,
mrdb
,
mrb_debug_enable_break_all
);
if
(
ret
!=
TRUE
)
{
if
(
ret
!=
TRUE
)
{
exe_set_command_select
(
mrb
,
mrdb
,
mrb_debug_enable_break
);
exe_set_command_select
(
mrb
,
mrdb
,
mrb_debug_enable_break
);
}
}
...
@@ -421,7 +421,7 @@ dbgcmd_disable(mrb_state *mrb, mrdb_state *mrdb)
...
@@ -421,7 +421,7 @@ dbgcmd_disable(mrb_state *mrb, mrdb_state *mrdb)
mrb_bool
ret
=
FALSE
;
mrb_bool
ret
=
FALSE
;
ret
=
exe_set_command_all
(
mrb
,
mrdb
,
mrb_debug_disable_break_all
);
ret
=
exe_set_command_all
(
mrb
,
mrdb
,
mrb_debug_disable_break_all
);
if
(
ret
!=
TRUE
)
{
if
(
ret
!=
TRUE
)
{
exe_set_command_select
(
mrb
,
mrdb
,
mrb_debug_disable_break
);
exe_set_command_select
(
mrb
,
mrdb
,
mrb_debug_disable_break
);
}
}
return
DBGST_PROMPT
;
return
DBGST_PROMPT
;
...
...
mrbgems/mruby-bin-debugger/tools/mrdb/cmdmisc.c
View file @
fbf4089d
...
@@ -333,7 +333,7 @@ check_cmd_pattern(const char *pattern, const char *cmd)
...
@@ -333,7 +333,7 @@ check_cmd_pattern(const char *pattern, const char *cmd)
if
(
pattern
==
NULL
||
cmd
==
NULL
)
{
if
(
pattern
==
NULL
||
cmd
==
NULL
)
{
return
FALSE
;
return
FALSE
;
}
}
if
((
lbracket
=
strchr
(
pattern
,
'['
))
==
NULL
)
{
if
((
lbracket
=
strchr
(
pattern
,
'['
))
==
NULL
)
{
return
!
strcmp
(
pattern
,
cmd
);
return
!
strcmp
(
pattern
,
cmd
);
}
}
if
((
rbracket
=
strchr
(
pattern
,
']'
))
==
NULL
)
{
if
((
rbracket
=
strchr
(
pattern
,
']'
))
==
NULL
)
{
...
...
mrbgems/mruby-bin-debugger/tools/mrdb/cmdrun.c
View file @
fbf4089d
...
@@ -11,11 +11,11 @@ dbgcmd_run(mrb_state *mrb, mrdb_state *mrdb)
...
@@ -11,11 +11,11 @@ dbgcmd_run(mrb_state *mrb, mrdb_state *mrdb)
{
{
mrb_debug_context
*
dbg
=
mrdb
->
dbg
;
mrb_debug_context
*
dbg
=
mrdb
->
dbg
;
if
(
dbg
->
xm
==
DBG_INIT
){
if
(
dbg
->
xm
==
DBG_INIT
){
dbg
->
xm
=
DBG_RUN
;
dbg
->
xm
=
DBG_RUN
;
}
else
{
}
else
{
dbg
->
xm
=
DBG_QUIT
;
dbg
->
xm
=
DBG_QUIT
;
if
(
dbg
->
xphase
==
DBG_PHASE_RUNNING
){
if
(
dbg
->
xphase
==
DBG_PHASE_RUNNING
){
struct
RClass
*
exc
;
struct
RClass
*
exc
;
puts
(
"Start it from the beginning."
);
puts
(
"Start it from the beginning."
);
exc
=
mrb_define_class
(
mrb
,
"DebuggerRestart"
,
mrb_class_get
(
mrb
,
"Exception"
));
exc
=
mrb_define_class
(
mrb
,
"DebuggerRestart"
,
mrb_class_get
(
mrb
,
"Exception"
));
...
@@ -32,12 +32,12 @@ dbgcmd_continue(mrb_state *mrb, mrdb_state *mrdb)
...
@@ -32,12 +32,12 @@ dbgcmd_continue(mrb_state *mrb, mrdb_state *mrdb)
mrb_debug_context
*
dbg
=
mrdb
->
dbg
;
mrb_debug_context
*
dbg
=
mrdb
->
dbg
;
int
ccnt
=
1
;
int
ccnt
=
1
;
if
(
mrdb
->
wcnt
>
1
){
if
(
mrdb
->
wcnt
>
1
){
sscanf
(
mrdb
->
words
[
1
],
"%d"
,
&
ccnt
);
sscanf
(
mrdb
->
words
[
1
],
"%d"
,
&
ccnt
);
}
}
dbg
->
ccnt
=
(
uint16_t
)(
ccnt
>
0
?
ccnt
:
1
);
/* count of continue */
dbg
->
ccnt
=
(
uint16_t
)(
ccnt
>
0
?
ccnt
:
1
);
/* count of continue */
if
(
dbg
->
xphase
==
DBG_PHASE_AFTER_RUN
){
if
(
dbg
->
xphase
==
DBG_PHASE_AFTER_RUN
){
puts
(
"The program is not running."
);
puts
(
"The program is not running."
);
dbg
->
xm
=
DBG_QUIT
;
dbg
->
xm
=
DBG_QUIT
;
}
else
{
}
else
{
...
...
mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c
View file @
fbf4089d
...
@@ -406,7 +406,7 @@ print_info_stopped_break(mrb_state *mrb, mrdb_state *mrdb)
...
@@ -406,7 +406,7 @@ print_info_stopped_break(mrb_state *mrb, mrdb_state *mrdb)
const
char
*
class_name
;
const
char
*
class_name
;
ret
=
mrb_debug_get_break
(
mrb
,
mrdb
->
dbg
,
mrdb
->
dbg
->
stopped_bpno
,
&
bp
);
ret
=
mrb_debug_get_break
(
mrb
,
mrdb
->
dbg
,
mrdb
->
dbg
->
stopped_bpno
,
&
bp
);
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
switch
(
bp
.
type
)
{
switch
(
bp
.
type
)
{
case
MRB_DEBUG_BPTYPE_LINE
:
case
MRB_DEBUG_BPTYPE_LINE
:
file
=
bp
.
point
.
linepoint
.
file
;
file
=
bp
.
point
.
linepoint
.
file
;
...
@@ -416,13 +416,13 @@ print_info_stopped_break(mrb_state *mrb, mrdb_state *mrdb)
...
@@ -416,13 +416,13 @@ print_info_stopped_break(mrb_state *mrb, mrdb_state *mrdb)
case
MRB_DEBUG_BPTYPE_METHOD
:
case
MRB_DEBUG_BPTYPE_METHOD
:
method_name
=
bp
.
point
.
methodpoint
.
method_name
;
method_name
=
bp
.
point
.
methodpoint
.
method_name
;
class_name
=
bp
.
point
.
methodpoint
.
class_name
;
class_name
=
bp
.
point
.
methodpoint
.
class_name
;
if
(
class_name
==
NULL
)
{
if
(
class_name
==
NULL
)
{
printf
(
"Breakpoint %d, %s
\n
"
,
bp
.
bpno
,
method_name
);
printf
(
"Breakpoint %d, %s
\n
"
,
bp
.
bpno
,
method_name
);
}
}
else
{
else
{
printf
(
"Breakpoint %d, %s:%s
\n
"
,
bp
.
bpno
,
class_name
,
method_name
);
printf
(
"Breakpoint %d, %s:%s
\n
"
,
bp
.
bpno
,
class_name
,
method_name
);
}
}
if
(
mrdb
->
dbg
->
isCfunc
)
{
if
(
mrdb
->
dbg
->
isCfunc
)
{
printf
(
"Stopped before calling the C function.
\n
"
);
printf
(
"Stopped before calling the C function.
\n
"
);
}
}
break
;
break
;
...
@@ -445,7 +445,7 @@ print_info_stopped_code(mrb_state *mrb, mrdb_state *mrdb)
...
@@ -445,7 +445,7 @@ print_info_stopped_code(mrb_state *mrb, mrdb_state *mrdb)
{
{
char
*
file
=
mrb_debug_get_source
(
mrb
,
mrdb
,
mrdb
->
srcpath
,
mrdb
->
dbg
->
prvfile
);
char
*
file
=
mrb_debug_get_source
(
mrb
,
mrdb
,
mrdb
->
srcpath
,
mrdb
->
dbg
->
prvfile
);
uint16_t
lineno
=
mrdb
->
dbg
->
prvline
;
uint16_t
lineno
=
mrdb
->
dbg
->
prvline
;
if
(
file
!=
NULL
)
{
if
(
file
!=
NULL
)
{
mrb_debug_list
(
mrb
,
mrdb
->
dbg
,
file
,
lineno
,
lineno
);
mrb_debug_list
(
mrb
,
mrdb
->
dbg
,
file
,
lineno
,
lineno
);
mrb_free
(
mrb
,
file
);
mrb_free
(
mrb
,
file
);
}
}
...
@@ -531,9 +531,9 @@ check_method_breakpoint(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value
...
@@ -531,9 +531,9 @@ check_method_breakpoint(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value
sym
=
0
;
sym
=
0
;
break
;
break
;
}
}
if
(
sym
!=
0
)
{
if
(
sym
!=
0
)
{
dbg
->
method_bpno
=
mrb_debug_check_breakpoint_method
(
mrb
,
dbg
,
c
,
sym
,
&
isCfunc
);
dbg
->
method_bpno
=
mrb_debug_check_breakpoint_method
(
mrb
,
dbg
,
c
,
sym
,
&
isCfunc
);
if
(
isCfunc
)
{
if
(
isCfunc
)
{
bpno
=
dbg
->
method_bpno
;
bpno
=
dbg
->
method_bpno
;
dbg
->
method_bpno
=
0
;
dbg
->
method_bpno
=
0
;
}
}
...
@@ -557,7 +557,7 @@ mrb_code_fetch_hook(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value *reg
...
@@ -557,7 +557,7 @@ mrb_code_fetch_hook(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value *reg
dbg
->
pc
=
pc
;
dbg
->
pc
=
pc
;
dbg
->
regs
=
regs
;
dbg
->
regs
=
regs
;
if
(
dbg
->
xphase
==
DBG_PHASE_RESTART
)
{
if
(
dbg
->
xphase
==
DBG_PHASE_RESTART
)
{
dbg
->
root_irep
=
irep
;
dbg
->
root_irep
=
irep
;
dbg
->
prvfile
=
NULL
;
dbg
->
prvfile
=
NULL
;
dbg
->
prvline
=
0
;
dbg
->
prvline
=
0
;
...
@@ -582,7 +582,7 @@ mrb_code_fetch_hook(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value *reg
...
@@ -582,7 +582,7 @@ mrb_code_fetch_hook(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value *reg
if
(
!
file
||
(
dbg
->
prvfile
==
file
&&
dbg
->
prvline
==
line
))
{
if
(
!
file
||
(
dbg
->
prvfile
==
file
&&
dbg
->
prvline
==
line
))
{
return
;
return
;
}
}
if
((
intptr_t
)(
dbg
->
prvci
)
<
(
intptr_t
)(
mrb
->
c
->
ci
))
{
if
((
intptr_t
)(
dbg
->
prvci
)
<
(
intptr_t
)(
mrb
->
c
->
ci
))
{
return
;
return
;
}
}
dbg
->
prvci
=
NULL
;
dbg
->
prvci
=
NULL
;
...
@@ -623,7 +623,7 @@ mrb_code_fetch_hook(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value *reg
...
@@ -623,7 +623,7 @@ mrb_code_fetch_hook(mrb_state *mrb, mrb_irep *irep, mrb_code *pc, mrb_value *reg
dbg
->
prvfile
=
file
;
dbg
->
prvfile
=
file
;
dbg
->
prvline
=
line
;
dbg
->
prvline
=
line
;
if
(
dbg
->
bm
==
BRK_BREAK
&&
--
dbg
->
ccnt
>
0
)
{
if
(
dbg
->
bm
==
BRK_BREAK
&&
--
dbg
->
ccnt
>
0
)
{
return
;
return
;
}
}
dbg
->
break_hook
(
mrb
,
dbg
);
dbg
->
break_hook
(
mrb
,
dbg
);
...
@@ -646,7 +646,7 @@ mrb_debug_break_hook(mrb_state *mrb, mrb_debug_context *dbg)
...
@@ -646,7 +646,7 @@ mrb_debug_break_hook(mrb_state *mrb, mrb_debug_context *dbg)
st
=
cmd
->
func
(
mrb
,
mrdb
);
st
=
cmd
->
func
(
mrb
,
mrdb
);
if
(
(
st
==
DBGST_CONTINUE
)
||
(
st
==
DBGST_RESTART
)
)
break
;
if
((
st
==
DBGST_CONTINUE
)
||
(
st
==
DBGST_RESTART
)
)
break
;
}
}
return
dbg
->
xm
;
return
dbg
->
xm
;
}
}
...
@@ -683,7 +683,7 @@ main(int argc, char **argv)
...
@@ -683,7 +683,7 @@ main(int argc, char **argv)
mrb_assert
(
mrdb
&&
mrdb
->
dbg
);
mrb_assert
(
mrdb
&&
mrdb
->
dbg
);
mrdb
->
srcpath
=
args
.
srcpath
;
mrdb
->
srcpath
=
args
.
srcpath
;
if
(
mrdb
->
dbg
->
xm
==
DBG_QUIT
)
{
if
(
mrdb
->
dbg
->
xm
==
DBG_QUIT
)
{
mrdb
->
dbg
->
xphase
=
DBG_PHASE_RESTART
;
mrdb
->
dbg
->
xphase
=
DBG_PHASE_RESTART
;
}
}
else
{
else
{
...
@@ -750,7 +750,7 @@ main(int argc, char **argv)
...
@@ -750,7 +750,7 @@ main(int argc, char **argv)
break
;
break
;
}
}
if
(
cmd
->
func
(
mrb
,
mrdb
)
==
DBGST_RESTART
)
goto
l_restart
;
if
(
cmd
->
func
(
mrb
,
mrdb
)
==
DBGST_RESTART
)
goto
l_restart
;
}
}
cleanup
(
mrb
,
&
args
);
cleanup
(
mrb
,
&
args
);
...
...
src/class.c
View file @
fbf4089d
...
@@ -2225,7 +2225,7 @@ mrb_mod_module_function(mrb_state *mrb, mrb_value mod)
...
@@ -2225,7 +2225,7 @@ mrb_mod_module_function(mrb_state *mrb, mrb_value mod)
mrb_check_type
(
mrb
,
mod
,
MRB_TT_MODULE
);
mrb_check_type
(
mrb
,
mod
,
MRB_TT_MODULE
);
mrb_get_args
(
mrb
,
"*"
,
&
argv
,
&
argc
);
mrb_get_args
(
mrb
,
"*"
,
&
argv
,
&
argc
);
if
(
argc
==
0
)
{
if
(
argc
==
0
)
{
/* set MODFUNC SCOPE if implemented */
/* set MODFUNC SCOPE if implemented */
return
mod
;
return
mod
;
}
}
...
...
src/vm.c
View file @
fbf4089d
...
@@ -1203,7 +1203,7 @@ RETRY_TRY_BLOCK:
...
@@ -1203,7 +1203,7 @@ RETRY_TRY_BLOCK:
else
{
else
{
mrb_value
blk
=
regs
[
bidx
];
mrb_value
blk
=
regs
[
bidx
];
if
(
!
mrb_nil_p
(
blk
)
&&
mrb_type
(
blk
)
!=
MRB_TT_PROC
)
{
if
(
!
mrb_nil_p
(
blk
)
&&
mrb_type
(
blk
)
!=
MRB_TT_PROC
)
{
if
(
bidx
>=
mrb
->
c
->
ci
->
nregs
)
{
if
(
bidx
>=
mrb
->
c
->
ci
->
nregs
)
{
stack_extend
(
mrb
,
bidx
+
1
,
mrb
->
c
->
ci
->
nregs
);
stack_extend
(
mrb
,
bidx
+
1
,
mrb
->
c
->
ci
->
nregs
);
mrb
->
c
->
ci
->
nregs
=
bidx
+
1
;
mrb
->
c
->
ci
->
nregs
=
bidx
+
1
;
}
}
...
@@ -1365,7 +1365,7 @@ RETRY_TRY_BLOCK:
...
@@ -1365,7 +1365,7 @@ RETRY_TRY_BLOCK:
else
{
else
{
stack_extend
(
mrb
,
irep
->
nregs
,
ci
->
argc
+
2
);
stack_extend
(
mrb
,
irep
->
nregs
,
ci
->
argc
+
2
);
}
}
if
(
m
->
env
)
{
if
(
m
->
env
)
{
regs
[
0
]
=
m
->
env
->
stack
[
0
];
regs
[
0
]
=
m
->
env
->
stack
[
0
];
}
}
pc
=
irep
->
iseq
;
pc
=
irep
->
iseq
;
...
@@ -1442,7 +1442,7 @@ RETRY_TRY_BLOCK:
...
@@ -1442,7 +1442,7 @@ RETRY_TRY_BLOCK:
}
}
blk
=
regs
[
bidx
];
blk
=
regs
[
bidx
];
if
(
!
mrb_nil_p
(
blk
)
&&
mrb_type
(
blk
)
!=
MRB_TT_PROC
)
{
if
(
!
mrb_nil_p
(
blk
)
&&
mrb_type
(
blk
)
!=
MRB_TT_PROC
)
{
if
(
bidx
>=
ci
->
nregs
)
{
if
(
bidx
>=
ci
->
nregs
)
{
stack_extend
(
mrb
,
bidx
+
1
,
ci
->
nregs
);
stack_extend
(
mrb
,
bidx
+
1
,
ci
->
nregs
);
ci
->
nregs
=
bidx
+
1
;
ci
->
nregs
=
bidx
+
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment