Skip to content

Commit ceec42b

Browse files
author
matz
committed
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 8369164 commit ceec42b

File tree

9 files changed

+122
-78
lines changed

9 files changed

+122
-78
lines changed

ChangeLog

+23-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
Tue Dec 26 18:46:41 2000 NAKAMURA Hiroshi <nakahiro@sarion.co.jp>
2+
3+
* lib/debug.rb: Avoid thread deadlock in debugging stopped thread.
4+
5+
* lib/debug.rb: Uncleared 'finish' state.
6+
17
Tue Dec 26 16:53:55 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
28

9+
* eval.c (rb_yield_0): remove dvar node by rb_gc_force_recycle()
10+
more eagerly.
11+
312
* eval.c (rb_f_binding): recycling should be stopped for outer
413
scope too.
514

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

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

862-
* lib/net/http.rb: too early parameter expantion in string.
871+
* lib/net/http.rb: too early parameter expansion in string.
863872

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

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

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

919-
* eval.c (rb_provided): detect infnite load loop.
928+
* eval.c (rb_provided): detect infinite load loop.
920929

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

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

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

984-
* bignum.c (rb_big_eq): imcomplete value compare of bignums.
993+
* bignum.c (rb_big_eq): incomplete value comparison of bignums.
985994

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

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

1109-
* hash.c (rb_hash_sort): should not retrun nil.
1118+
* hash.c (rb_hash_sort): should not return nil.
11101119

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

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

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

1277-
* eval.c (rb_callcc): returned current thread instaed of
1286+
* eval.c (rb_callcc): returned current thread instead of
12781287
continuation wrongly.
12791288

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

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

1450-
* lib/mkmf.rb: converts extention of $objs into $OBJEXT.
1459+
* lib/mkmf.rb: converts extension of $objs into $OBJEXT.
14511460

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

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

15461555
* eval.c (rb_thread_start_0): should copy previous scopes to
1547-
prevent rb_gc_force_recylce().
1556+
prevent rb_gc_force_recycle().
15481557

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

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

1622-
* numeric.c (num_ceil, etc): default ceil, floor, round, trancate
1631+
* numeric.c (num_ceil, etc): default ceil, floor, round, truncate
16231632
implementation for Numeric, using `to_f'.
16241633

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

17111720
* bignum.c (rb_big_divmod): ditto.
17121721

1713-
* numeric.c (fixdivmod): does not depend C's undifined %
1722+
* numeric.c (fixdivmod): does not depend C's undefined %
17141723
behavior. adopt to fmod(3m) behavior.
17151724

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

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

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

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

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

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

65436552
* string.c (rb_str_split_method): negative LIMIT means number of
6544-
splitted fields are unlimited, as in perl.
6553+
split fields are unlimited, as in perl.
65456554

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

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

8800-
* regex.c (re_compile_pattern): non-resitering parens (?:..).
8809+
* regex.c (re_compile_pattern): non-registering parens (?:..).
88018810

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

90559064
* ruby.c (ruby_prog_init): should not add path from environment
9056-
variable, if ruby is running under seuid.
9065+
variable, if ruby is running under setuid.
90579066

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

README

+9-6
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,14 @@ in the mail body (not subject) to the address <ruby-talk-ctl@netlab.co.jp>.
4646

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

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

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

53-
3. Remove comment mark(#) before the module names from ext/Setup (or
54+
3. Edit defines.h if you need. Probably this step will not need.
55+
56+
4. Remove comment mark(#) before the module names from ext/Setup (or
5457
add module names if not present), if you want to link modules
5558
statically.
5659

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

62-
4. Run make.
65+
5. Run make.
6366

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

68-
6. Run 'make install'
71+
7. Run 'make install'
6972

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

README.jp

+10-6
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,17 @@ Ruby
7878

7979
�ʲ��μ��ǹԤäƤ���������
8080

81-
1. configure��¹Ԥ���Makefile�ʤɤ���������
81+
1. �⤷configure�ե����뤬���Ĥ���ʤ����⤷����
82+
configure.in���Ť��褦�ʤ顢autoconf��¹Ԥ���
83+
������configure����������
8284

83-
2. (ɬ�פʤ��)defines.h���Խ�����
85+
2. configure��¹Ԥ���Makefile�ʤɤ���������
86+
87+
3. (ɬ�פʤ��)defines.h���Խ�����
8488

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

87-
3. (ɬ�פʤ��)ext/Setup����Ū�˥�󥯤����ĥ�⥸�塼���
91+
4. (ɬ�פʤ��)ext/Setup����Ū�˥�󥯤����ĥ�⥸�塼���
8892
���ꤹ��
8993

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

98-
4. make��¹Ԥ��ƥ���ѥ��뤹��
102+
5. make��¹Ԥ��ƥ���ѥ��뤹��
99103

100-
5. make test�ǥƥ��Ȥ�Ԥ���
104+
6. make test�ǥƥ��Ȥ�Ԥ���
101105

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

105-
6. make install
109+
7. make install
106110

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

eval.c

+10-9
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,7 @@ rb_eval(self, n)
19821982

19831983
/* nodes for speed-up(default match) */
19841984
case NODE_MATCH:
1985-
result = rb_reg_match2(node->nd_head->nd_lit);
1985+
result = rb_reg_match2(node->nd_lit);
19861986
break;
19871987

19881988
/* nodes for speed-up(literal match) */
@@ -3558,17 +3558,18 @@ rb_yield_0(val, self, klass, acheck)
35583558
pop_state:
35593559
POP_ITER();
35603560
POP_CLASS();
3561-
if ((block->flags & BLOCK_D_SCOPE) &&
3561+
if (ruby_dyna_vars && (block->flags & BLOCK_D_SCOPE) &&
35623562
!FL_TEST(ruby_dyna_vars, DVAR_DONT_RECYCLE)) {
3563-
struct RVarmap *vars = ruby_dyna_vars;
3563+
struct RVarmap *vars, *tmp;
35643564

3565-
while (vars && vars->id != 0) {
3566-
struct RVarmap *tmp = vars->next;
3567-
rb_gc_force_recycle((VALUE)vars);
3568-
vars = tmp;
3569-
}
3570-
if (ruby_dyna_vars && ruby_dyna_vars->id == 0) {
3565+
if (ruby_dyna_vars->id == 0) {
3566+
vars = ruby_dyna_vars->next;
35713567
rb_gc_force_recycle((VALUE)ruby_dyna_vars);
3568+
while (vars && vars->id != 0) {
3569+
tmp = vars->next;
3570+
rb_gc_force_recycle((VALUE)vars);
3571+
vars = tmp;
3572+
}
35723573
}
35733574
}
35743575
POP_VARS();

ext/extmk.rb.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def create_makefile(target)
370370

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

376376
defflag = ''

lib/debug.rb

+35-13
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,25 @@ def stop_next(n=1)
9898
@stop_next = n
9999
end
100100

101-
def suspend
101+
def set_suspend
102102
@suspend_next = true
103103
end
104104

105+
def clear_suspend
106+
@suspend_next = false
107+
end
108+
109+
def suspend_all
110+
DEBUGGER__.suspend
111+
end
112+
113+
def resume_all
114+
DEBUGGER__.resume
115+
end
116+
105117
def check_suspend
106118
while (Thread.critical = true; @suspend_next)
107-
waiting.push Thread.current
119+
DEBUGGER__.waiting.push Thread.current
108120
@suspend_next = false
109121
Thread.stop
110122
end
@@ -131,14 +143,18 @@ def display
131143
DEBUGGER__.display
132144
end
133145

134-
def waiting
135-
DEBUGGER__.waiting
146+
def context(th)
147+
DEBUGGER__.context(th)
136148
end
137149

138150
def set_trace_all(arg)
139151
DEBUGGER__.set_trace(arg)
140152
end
141153

154+
def set_last_thread(th)
155+
DEBUGGER__.set_last_thread(th)
156+
end
157+
142158
def debug_eval(str, binding)
143159
begin
144160
val = eval(str, binding)
@@ -237,7 +253,7 @@ def thnum
237253

238254
def debug_command(file, line, id, binding)
239255
MUTEX.lock
240-
DEBUGGER__.set_last_thread(Thread.current)
256+
set_last_thread(Thread.current)
241257
frame_pos = 0
242258
binding_file = file
243259
binding_line = line
@@ -506,7 +522,7 @@ def debug_command(file, line, id, binding)
506522
end
507523
end
508524
MUTEX.unlock
509-
DEBUGGER__.resume_all_thread
525+
resume_all
510526
end
511527

512528
def debug_print_help
@@ -662,14 +678,14 @@ def excn_handle(file, line, id, binding)
662678
stdout.printf "\tfrom %s\n", i
663679
end
664680
end
665-
DEBUGGER__.suspend_all_thread
681+
suspend_all
666682
debug_command(file, line, id, binding)
667683
end
668684
end
669685

670686
def trace_func(event, file, line, id, binding, klass)
671687
Tracer.trace_func(event, file, line, id, binding, klass) if trace?
672-
DEBUGGER__.context(Thread.current).check_suspend
688+
context(Thread.current).check_suspend
673689
@file = file
674690
@line = line
675691
case event
@@ -687,7 +703,7 @@ def trace_func(event, file, line, id, binding, klass)
687703
@stop_next = 1
688704
else
689705
@no_step = nil
690-
DEBUGGER__.suspend_all_thread
706+
suspend_all
691707
debug_command(file, line, id, binding)
692708
@last = [file, line]
693709
end
@@ -697,7 +713,7 @@ def trace_func(event, file, line, id, binding, klass)
697713
@frames.unshift [binding, file, line, id]
698714
if check_break_points(file, id.id2name, binding, id) or
699715
check_break_points(klass.to_s, id.id2name, binding, id)
700-
DEBUGGER__.suspend_all_thread
716+
suspend_all
701717
debug_command(file, line, id, binding)
702718
end
703719

@@ -710,6 +726,7 @@ def trace_func(event, file, line, id, binding, klass)
710726
when 'return', 'end'
711727
if @frames.size == @finish_pos
712728
@stop_next = 1
729+
@finish_pos = 0
713730
end
714731
@frames.shift
715732

@@ -767,20 +784,25 @@ def set_last_thread(th)
767784
@last_thread = th
768785
end
769786

770-
def suspend_all_thread
787+
def suspend
771788
Thread.critical = true
772789
make_thread_list
773790
for th in @thread_list
774791
next if th[0] == Thread.current
775-
context(th[0]).suspend
792+
context(th[0]).set_suspend
776793
end
777794
Thread.critical = false
778795
# Schedule other threads to suspend as soon as possible.
779796
Thread.pass
780797
end
781798

782-
def resume_all_thread
799+
def resume
783800
Thread.critical = true
801+
make_thread_list
802+
for th in @thread_list
803+
next if th[0] == Thread.current
804+
context(th[0]).clear_suspend
805+
end
784806
waiting.each do |th|
785807
th.run
786808
end

0 commit comments

Comments
 (0)