Skip to content

Commit

Permalink
matz
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Dec 27, 2000
1 parent 8369164 commit ceec42b
Show file tree
Hide file tree
Showing 9 changed files with 122 additions and 78 deletions.
37 changes: 23 additions & 14 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
Tue Dec 26 18:46:41 2000 NAKAMURA Hiroshi <nakahiro@sarion.co.jp>

* lib/debug.rb: Avoid thread deadlock in debugging stopped thread.

* lib/debug.rb: Uncleared 'finish' state.

Tue Dec 26 16:53:55 2000 Yukihiro Matsumoto <matz@ruby-lang.org>

* eval.c (rb_yield_0): remove dvar node by rb_gc_force_recycle()
more eagerly.

* eval.c (rb_f_binding): recycling should be stopped for outer
scope too.

Expand Down Expand Up @@ -859,7 +868,7 @@ Sat Sep 23 03:06:25 2000 Yukihiro Matsumoto <matz@ruby-lang.org>

Fri Sep 22 15:46:21 2000 Minero Aoki <aamine@dp.u-netsurf.ne.jp>

* lib/net/http.rb: too early parameter expantion in string.
* lib/net/http.rb: too early parameter expansion in string.

Fri Sep 22 13:58:51 2000 WATANABE Hirofumi <eban@os.rim.or.jp>

Expand Down Expand Up @@ -916,7 +925,7 @@ Wed Sep 20 23:21:38 2000 Yukihiro Matsumoto <matz@ruby-lang.org>

Wed Sep 20 14:01:45 2000 Yukihiro Matsumoto <matz@ruby-lang.org>

* eval.c (rb_provided): detect infnite load loop.
* eval.c (rb_provided): detect infinite load loop.

* eval.c (rb_provided): too weak filename comparison.

Expand Down Expand Up @@ -981,7 +990,7 @@ Thu Sep 14 02:46:54 2000 Yukihiro Matsumoto <matz@ruby-lang.org>

Wed Sep 13 17:01:03 2000 Yukihiro Matsumoto <matz@ruby-lang.org>

* bignum.c (rb_big_eq): imcomplete value compare of bignums.
* bignum.c (rb_big_eq): incomplete value comparison of bignums.

Wed Sep 13 06:39:54 2000 Yukihiro Matsumoto <matz@ruby-lang.org>

Expand Down Expand Up @@ -1106,7 +1115,7 @@ Fri Sep 1 10:36:29 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (aref_args,opt_call_args): add block_call to allow a
method without parentheses and with block as a last argument.

* hash.c (rb_hash_sort): should not retrun nil.
* hash.c (rb_hash_sort): should not return nil.

* re.c (match_aref): should use rb_reg_nth_match().

Expand Down Expand Up @@ -1274,7 +1283,7 @@ Fri Aug 11 15:43:46 2000 Yukihiro Matsumoto <matz@ruby-lang.org>

Thu Aug 10 08:05:03 2000 Yukihiro Matsumoto <matz@ruby-lang.org>

* eval.c (rb_callcc): returned current thread instaed of
* eval.c (rb_callcc): returned current thread instead of
continuation wrongly.

Thu Aug 10 05:40:28 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
Expand Down Expand Up @@ -1447,7 +1456,7 @@ Tue Jul 18 14:58:30 2000 Yukihiro Matsumoto <matz@netlab.co.jp>

Mon Jul 17 04:29:50 2000 Minero Aoki <aamine@dp.u-netsurf.ne.jp>

* lib/mkmf.rb: converts extention of $objs into $OBJEXT.
* lib/mkmf.rb: converts extension of $objs into $OBJEXT.

Sun Jul 16 03:02:34 2000 Dave Thomas <dave@thomases.com>

Expand Down Expand Up @@ -1544,7 +1553,7 @@ Mon Jul 10 09:07:54 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
Sat Jul 8 23:08:40 2000 Yukihiro Matsumoto <matz@netlab.co.jp>

* eval.c (rb_thread_start_0): should copy previous scopes to
prevent rb_gc_force_recylce().
prevent rb_gc_force_recycle().

Fri Jul 7 23:36:36 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>

Expand Down Expand Up @@ -1619,7 +1628,7 @@ Wed Jul 5 09:47:14 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* time.c (time_arg): Time::local, Time::gm now take 7th optional
argument for usec.

* numeric.c (num_ceil, etc): default ceil, floor, round, trancate
* numeric.c (num_ceil, etc): default ceil, floor, round, truncate
implementation for Numeric, using `to_f'.

* io.c (rb_io_reopen): clear fptr->path after free() to prevent
Expand Down Expand Up @@ -1710,7 +1719,7 @@ Mon Jul 3 13:15:02 2000 Yukihiro Matsumoto <matz@netlab.co.jp>

* bignum.c (rb_big_divmod): ditto.

* numeric.c (fixdivmod): does not depend C's undifined %
* numeric.c (fixdivmod): does not depend C's undefined %
behavior. adopt to fmod(3m) behavior.

* numeric.c (flo_mod): modulo now reserves fmod(3m) behavior.
Expand Down Expand Up @@ -1753,7 +1762,7 @@ Sat Jul 1 15:22:35 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
Sat Jul 1 15:22:35 2000 Yukihiro Matsumoto <matz@netlab.co.jp>

* eval.c (rb_eval): the value from RTEST() is not valid Ruby
objct. result should be either true or false.
object. result should be either true or false.

Sat Jul 1 09:30:06 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>

Expand Down Expand Up @@ -3946,7 +3955,7 @@ Thu Oct 21 16:14:19 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
* ruby.c (proc_options): use RUBYOPT environment variable to
retrieve the default options.

* dir.c (fnmatch): use eban's fnmatch; do not depend on systems's
* dir.c (fnmatch): use eban's fnmatch; do not depend on system's
fnmatch (which may have portability problem) anymore.

Wed Oct 20 15:14:24 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
Expand Down Expand Up @@ -6541,7 +6550,7 @@ Sun Nov 1 01:18:52 1998 EGUCHI Osamu <eguchi@shizuokanet.ne.jp>
Sat Oct 31 23:18:34 1998 Yukihiro Matsumoto <matz@netlab.co.jp>

* string.c (rb_str_split_method): negative LIMIT means number of
splitted fields are unlimited, as in perl.
split fields are unlimited, as in perl.

* string.c (rb_str_split_method): if LIMIT is unspecified,
trailing null fields are stripped.
Expand Down Expand Up @@ -8797,7 +8806,7 @@ Wed Nov 12 13:44:47 1997 Yukihiro Matsumoto <matz@netlab.co.jp>

Mon Nov 10 11:24:51 1997 Yukihiro Matsumoto <matz@netlab.co.jp>

* regex.c (re_compile_pattern): non-resitering parens (?:..).
* regex.c (re_compile_pattern): non-registering parens (?:..).

* regex.c (re_compile_pattern): new meta character \< (wordbeg)
and \> (wordend).
Expand Down Expand Up @@ -9053,7 +9062,7 @@ Tue Sep 16 17:54:25 1997 Yukihiro Matsumoto <matz@netlab.co.jp>
* ruby.c (ruby_prog_init): close stdaux and stdprn for MSDOS.

* ruby.c (ruby_prog_init): should not add path from environment
variable, if ruby is running under seuid.
variable, if ruby is running under setuid.

* process.c (init_ids): check suid check for setuid/seteuid etc.

Expand Down
15 changes: 9 additions & 6 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ in the mail body (not subject) to the address <ruby-talk-ctl@netlab.co.jp>.

This is what you need to do to compile and install Ruby:

1. Run ./configure, which will generate config.h and Makefile.
1. If ./configure does not exist or is older than configure.in,
run autoconf to (re)generate configure.

2. Edit defines.h if you need. Probably this step will not need.
2. Run ./configure, which will generate config.h and Makefile.

3. Remove comment mark(#) before the module names from ext/Setup (or
3. Edit defines.h if you need. Probably this step will not need.

4. Remove comment mark(#) before the module names from ext/Setup (or
add module names if not present), if you want to link modules
statically.

Expand All @@ -59,13 +62,13 @@ This is what you need to do to compile and install Ruby:
remove comment mark from the line "#option nodynamic" in
ext/Setup.

4. Run make.
5. Run make.

5. Optionally, run 'make test' to check whether the compiled Ruby
6. Optionally, run 'make test' to check whether the compiled Ruby
interpreter works well. If you see the message "test succeeded",
your ruby works as it should (hopefully).

6. Run 'make install'
7. Run 'make install'

You may have to be a super user to install ruby.

Expand Down
16 changes: 10 additions & 6 deletions README.jp
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@ Ruby

�ʲ��μ��ǹԤäƤ���������

1. configure��¹Ԥ���Makefile�ʤɤ���������
1. �⤷configure�ե����뤬���Ĥ���ʤ����⤷����
configure.in���Ť��褦�ʤ顢autoconf��¹Ԥ���
������configure����������

2. (ɬ�פʤ��)defines.h���Խ�����
2. configure��¹Ԥ���Makefile�ʤɤ���������

3. (ɬ�פʤ��)defines.h���Խ�����

¿ʬ��ɬ��̵���Ȼפ��ޤ���

3. (ɬ�פʤ��)ext/Setup����Ū�˥�󥯤����ĥ�⥸�塼���
4. (ɬ�פʤ��)ext/Setup����Ū�˥�󥯤����ĥ�⥸�塼���
���ꤹ��

ext/Setup�˵��Ҥ����⥸�塼�����Ū�˥�󥯤���ޤ���
Expand All @@ -95,14 +99,14 @@ Ruby
��ĥ�⥸�塼������Ѥ��뤿��ˤϡ����餫������Ū�˥��
�����Ƥ���ɬ�פ�����ޤ���

4. make��¹Ԥ��ƥ���ѥ��뤹��
5. make��¹Ԥ��ƥ���ѥ��뤹��

5. make test�ǥƥ��Ȥ�Ԥ���
6. make test�ǥƥ��Ȥ�Ԥ���

��test succeeded�פ�ɽ�������������Ǥ����������ƥ���
���������Ƥⴰ�������ݾڤ���Ƥ������ǤϤ���ޤ���

6. make install
7. make install

root�Ǻ�Ȥ���ɬ�פ����뤫�⤷��ޤ���

Expand Down
19 changes: 10 additions & 9 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,7 @@ rb_eval(self, n)

/* nodes for speed-up(default match) */
case NODE_MATCH:
result = rb_reg_match2(node->nd_head->nd_lit);
result = rb_reg_match2(node->nd_lit);
break;

/* nodes for speed-up(literal match) */
Expand Down Expand Up @@ -3558,17 +3558,18 @@ rb_yield_0(val, self, klass, acheck)
pop_state:
POP_ITER();
POP_CLASS();
if ((block->flags & BLOCK_D_SCOPE) &&
if (ruby_dyna_vars && (block->flags & BLOCK_D_SCOPE) &&
!FL_TEST(ruby_dyna_vars, DVAR_DONT_RECYCLE)) {
struct RVarmap *vars = ruby_dyna_vars;
struct RVarmap *vars, *tmp;

while (vars && vars->id != 0) {
struct RVarmap *tmp = vars->next;
rb_gc_force_recycle((VALUE)vars);
vars = tmp;
}
if (ruby_dyna_vars && ruby_dyna_vars->id == 0) {
if (ruby_dyna_vars->id == 0) {
vars = ruby_dyna_vars->next;
rb_gc_force_recycle((VALUE)ruby_dyna_vars);
while (vars && vars->id != 0) {
tmp = vars->next;
rb_gc_force_recycle((VALUE)vars);
vars = tmp;
}
}
}
POP_VARS();
Expand Down
2 changes: 1 addition & 1 deletion ext/extmk.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def create_makefile(target)

if $configure_args['--enable-shared'] or "@LIBRUBY@" != "@LIBRUBY_A@"
$libs = "@LIBRUBYARG@ " + $libs
$LIBPATH |= [$topdir]
$LIBPATH.unshift $topdir
end

defflag = ''
Expand Down
48 changes: 35 additions & 13 deletions lib/debug.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,25 @@ def stop_next(n=1)
@stop_next = n
end

def suspend
def set_suspend
@suspend_next = true
end

def clear_suspend
@suspend_next = false
end

def suspend_all
DEBUGGER__.suspend
end

def resume_all
DEBUGGER__.resume
end

def check_suspend
while (Thread.critical = true; @suspend_next)
waiting.push Thread.current
DEBUGGER__.waiting.push Thread.current
@suspend_next = false
Thread.stop
end
Expand All @@ -131,14 +143,18 @@ def display
DEBUGGER__.display
end

def waiting
DEBUGGER__.waiting
def context(th)
DEBUGGER__.context(th)
end

def set_trace_all(arg)
DEBUGGER__.set_trace(arg)
end

def set_last_thread(th)
DEBUGGER__.set_last_thread(th)
end

def debug_eval(str, binding)
begin
val = eval(str, binding)
Expand Down Expand Up @@ -237,7 +253,7 @@ def thnum

def debug_command(file, line, id, binding)
MUTEX.lock
DEBUGGER__.set_last_thread(Thread.current)
set_last_thread(Thread.current)
frame_pos = 0
binding_file = file
binding_line = line
Expand Down Expand Up @@ -506,7 +522,7 @@ def debug_command(file, line, id, binding)
end
end
MUTEX.unlock
DEBUGGER__.resume_all_thread
resume_all
end

def debug_print_help
Expand Down Expand Up @@ -662,14 +678,14 @@ def excn_handle(file, line, id, binding)
stdout.printf "\tfrom %s\n", i
end
end
DEBUGGER__.suspend_all_thread
suspend_all
debug_command(file, line, id, binding)
end
end

def trace_func(event, file, line, id, binding, klass)
Tracer.trace_func(event, file, line, id, binding, klass) if trace?
DEBUGGER__.context(Thread.current).check_suspend
context(Thread.current).check_suspend
@file = file
@line = line
case event
Expand All @@ -687,7 +703,7 @@ def trace_func(event, file, line, id, binding, klass)
@stop_next = 1
else
@no_step = nil
DEBUGGER__.suspend_all_thread
suspend_all
debug_command(file, line, id, binding)
@last = [file, line]
end
Expand All @@ -697,7 +713,7 @@ def trace_func(event, file, line, id, binding, klass)
@frames.unshift [binding, file, line, id]
if check_break_points(file, id.id2name, binding, id) or
check_break_points(klass.to_s, id.id2name, binding, id)
DEBUGGER__.suspend_all_thread
suspend_all
debug_command(file, line, id, binding)
end

Expand All @@ -710,6 +726,7 @@ def trace_func(event, file, line, id, binding, klass)
when 'return', 'end'
if @frames.size == @finish_pos
@stop_next = 1
@finish_pos = 0
end
@frames.shift

Expand Down Expand Up @@ -767,20 +784,25 @@ def set_last_thread(th)
@last_thread = th
end

def suspend_all_thread
def suspend
Thread.critical = true
make_thread_list
for th in @thread_list
next if th[0] == Thread.current
context(th[0]).suspend
context(th[0]).set_suspend
end
Thread.critical = false
# Schedule other threads to suspend as soon as possible.
Thread.pass
end

def resume_all_thread
def resume
Thread.critical = true
make_thread_list
for th in @thread_list
next if th[0] == Thread.current
context(th[0]).clear_suspend
end
waiting.each do |th|
th.run
end
Expand Down
Loading

0 comments on commit ceec42b

Please sign in to comment.