summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-03 11:20:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-10-03 11:20:31 +0000
commit4b6dffad02114175e59729eeb38b5db19c01e571 (patch)
tree6670d9fc55dcd61ef25bd527f056fb47697633ae
parent29cef5f795043a048a58874d90de0dfe01aa12ea (diff)
* bcc32/mkexports.rb: to work on cygwin via telnet.
[ruby-win32:358] * ext/tcltklib/tcltklib.c (ip_invoke): requires command name argument. [ruby-dev:18438] * eval.c (ruby_init, ruby_options): Init_stack() with local location. (ruby-bugs-ja:PR#277) * eval.c (rb_call0): disable trace call. [ruby-dev:18074] * eval.c (eval, rb_load): enable trace call. [ruby-dev:18074] * eval.c (rb_f_require): set source file name for extension libraries. [ruby-dev:18445] * ruby.c (translate_char): translate a character in a string; DOSISH only. [ruby-dev:18274] * ruby.c (ruby_init_loadpath): added argv[0] handling under Human68K. [ruby-dev:18274] * ruby.c (proc_options): translate directory separator in $0 to '/'. [ruby-dev:18274] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog27
-rw-r--r--bcc32/mkexports.rb15
-rw-r--r--eval.c25
-rw-r--r--ext/tcltklib/tcltklib.c3
-rw-r--r--ruby.c38
-rw-r--r--version.h4
6 files changed, 91 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index f7c4fcbf1c..5ec5c4dee6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+Thu Oct 3 20:16:12 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+
+ * bcc32/mkexports.rb: to work on cygwin via telnet.
+ [ruby-win32:358]
+
+ * ext/tcltklib/tcltklib.c (ip_invoke): requires command name
+ argument. [ruby-dev:18438]
+
+ * eval.c (ruby_init, ruby_options): Init_stack() with local
+ location. (ruby-bugs-ja:PR#277)
+
+ * eval.c (rb_call0): disable trace call. [ruby-dev:18074]
+
+ * eval.c (eval, rb_load): enable trace call. [ruby-dev:18074]
+
+ * eval.c (rb_f_require): set source file name for extension
+ libraries. [ruby-dev:18445]
+
+ * ruby.c (translate_char): translate a character in a string;
+ DOSISH only. [ruby-dev:18274]
+
+ * ruby.c (ruby_init_loadpath): added argv[0] handling under
+ Human68K. [ruby-dev:18274]
+
+ * ruby.c (proc_options): translate directory separator in $0 to
+ '/'. [ruby-dev:18274]
+
Thu Oct 3 00:27:26 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* lib/delegate.rb (Delegator::initialize): use Object#class
diff --git a/bcc32/mkexports.rb b/bcc32/mkexports.rb
index 531ba3a001..e34b441e2f 100644
--- a/bcc32/mkexports.rb
+++ b/bcc32/mkexports.rb
@@ -1,14 +1,13 @@
#!./miniruby -s
SYM = {}
-objs = ARGV.collect {|s| s.tr('/', '\\')}
-system("tdump -oiPUBDEF -oiPUBD32 #{objs.join(' ')} > pub.def")
-sleep(1)
-IO.foreach('pub.def'){|l|
- next unless /(PUBDEF|PUBD32)/ =~ l
- /'(.*?)'/ =~ l
- SYM[$1] = true
-}
+STDIN.reopen(open("nul"))
+ARGV.each do |obj|
+ IO.foreach("|tdump -q -oiPUBDEF -oiPUBD32 #{obj.tr('/', '\\')}") do |l|
+ next unless /(?:PUBDEF|PUBD32)/ =~ l
+ SYM[$1] = true if /'(.*?)'/ =~ l
+ end
+end
exports = []
if $name
diff --git a/eval.c b/eval.c
index 9771fd97b5..9a81419ea8 100644
--- a/eval.c
+++ b/eval.c
@@ -887,6 +887,8 @@ static void assign _((VALUE,NODE*,VALUE,int));
static VALUE trace_func = 0;
static int tracing = 0;
static void call_trace_func _((char*,NODE*,VALUE,ID,VALUE));
+#define ENABLE_TRACE() (tracing &= ~2)
+#define DISABLE_TRACE() (tracing |= 2)
#define SET_CURRENT_SOURCE() (ruby_sourcefile = ruby_current_node->nd_file, \
ruby_sourceline = nd_line(ruby_current_node))
@@ -1069,7 +1071,7 @@ ruby_init()
rb_origenviron = environ;
#endif
- Init_stack(0);
+ Init_stack((void*)&state);
Init_heap();
PUSH_SCOPE();
ruby_scope->local_vars = 0;
@@ -1190,6 +1192,7 @@ ruby_options(argc, argv)
{
int state;
+ Init_stack((void*)&state);
PUSH_TAG(PROT_NONE);
if ((state = EXEC_TAG()) == 0) {
ruby_process_options(argc, argv);
@@ -1866,7 +1869,7 @@ is_defined(self, node, buf)
}
check_bound:
{
- int call = nd_type(node)== NODE_CALL;
+ int call = nd_type(node)==NODE_CALL;
val = CLASS_OF(val);
if (call) {
@@ -4499,13 +4502,16 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
}
if (trace_func) {
int state;
+ volatile int old_tracing = tracing;
call_trace_func("c-call", ruby_current_node, recv, id, klass);
+ DISABLE_TRACE();
PUSH_TAG(PROT_FUNC);
if ((state = EXEC_TAG()) == 0) {
result = call_cfunc(body->nd_cfnc, recv, len, argc, argv);
}
POP_TAG();
+ tracing = old_tracing;
ruby_current_node = ruby_frame->node;
call_trace_func("c-return", ruby_current_node, recv, id, klass);
if (state) JUMP_TAG(state);
@@ -4968,6 +4974,7 @@ eval(self, src, scope, file, line)
struct FRAME frame;
NODE *nodesave = ruby_current_node;
volatile int iter = ruby_frame->iter;
+ volatile int old_tracing = tracing;
int state;
if (!NIL_P(scope)) {
@@ -5030,6 +5037,7 @@ eval(self, src, scope, file, line)
compile_error(0);
}
if (!NIL_P(result)) ruby_errinfo = result;
+ ENABLE_TRACE();
result = eval_node(self, node);
}
POP_TAG();
@@ -5071,6 +5079,7 @@ eval(self, src, scope, file, line)
}
ruby_current_node = nodesave;
ruby_set_current_source();
+ tracing = old_tracing;
if (state) {
if (state == TAG_RAISE) {
VALUE err;
@@ -5304,6 +5313,7 @@ rb_load(fname, wrap)
volatile ID last_func;
volatile VALUE wrapper = 0;
volatile VALUE self = ruby_top_self;
+ volatile int old_tracing = tracing;
NODE *saved_cref = ruby_cref;
TMP_PROTECT;
@@ -5357,6 +5367,7 @@ rb_load(fname, wrap)
node = ruby_eval_tree;
ALLOW_INTS;
if (ruby_nerrs == 0) {
+ ENABLE_TRACE();
eval_node(self, node);
}
}
@@ -5372,6 +5383,7 @@ rb_load(fname, wrap)
POP_CLASS();
POP_VARS();
ruby_wrapper = wrapper;
+ tracing = old_tracing;
if (ruby_nerrs > 0) {
ruby_nerrs = 0;
rb_exc_raise(ruby_errinfo);
@@ -5576,7 +5588,13 @@ rb_f_require(obj, fname)
rb_provide_feature(feature);
{
int volatile old_vmode = scope_vmode;
+ NODE *const volatile old_node = ruby_current_node;
+ const volatile old_func = ruby_frame->last_func;
+ ruby_current_node = 0;
+ ruby_sourcefile = rb_source_filename(RSTRING(fname)->ptr);
+ ruby_sourceline = 0;
+ ruby_frame->last_func = 0;
PUSH_TAG(PROT_NONE);
if ((state = EXEC_TAG()) == 0) {
void *handle;
@@ -5586,6 +5604,9 @@ rb_f_require(obj, fname)
rb_ary_push(ruby_dln_librefs, LONG2NUM((long)handle));
}
POP_TAG();
+ ruby_current_node = old_node;
+ ruby_set_current_source();
+ ruby_frame->last_func = old_func;
SCOPE_SET(old_vmode);
}
if (state) JUMP_TAG(state);
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index c90a807ae7..f4a307c9a9 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -767,6 +767,9 @@ ip_invoke(argc, argv, obj)
VALUE *alloc_argv, *alloc_result;
Tcl_QueuePosition position;
+ if (argc < 1) {
+ rb_raise(rb_eArgError, "command name missing");
+ }
if (eventloop_thread == 0 || current == eventloop_thread) {
DUMP2("invoke from current eventloop %lx", current);
return ip_invoke_real(argc, argv, obj);
diff --git a/ruby.c b/ruby.c
index e6adcc7614..a9dde28241 100644
--- a/ruby.c
+++ b/ruby.c
@@ -203,10 +203,30 @@ ruby_incpush(path)
}
}
-#if defined _WIN32 || defined __CYGWIN__ || defined __DJGPP__ || defined __EMX__
+#if defined DOSISH || defined __CYGWIN__
#define LOAD_RELATIVE 1
#endif
+#ifdef DOSISH
+static inline void translate_char _((char *, int, int));
+
+static inline void
+translate_char(p, from, to)
+ char *p;
+ int from, to;
+{
+ while (*p) {
+ if ((unsigned char)*p == from)
+ *p = to;
+#ifdef CharNext /* defined as CharNext[AW] on Windows. */
+ p = CharNext(p);
+#else
+ p += mblen(p, MB_CUR_MAX);
+#endif
+ }
+}
+#endif
+
void
ruby_init_loadpath()
{
@@ -224,19 +244,16 @@ ruby_init_loadpath()
#elif defined(DJGPP)
extern char *__dos_argv0;
strncpy(libpath, __dos_argv0, FILENAME_MAX);
-#define CharNext(p) ((p) + mblen(p, MB_CUR_MAX))
+#elif defined(__human68k__)
+ extern char **_argv;
+ strncpy(libpath, _argv[0], FILENAME_MAX);
#elif defined(__EMX__)
_execname(libpath, FILENAME_MAX);
#endif
-#ifndef CharNext /* defined as CharNext[AW] on Windows. */
-#define CharNext(p) ((p) + 1)
+#ifdef DOSISH
+ translate_char(libpath, '\\', '/');
#endif
-
- for (p = libpath; *p; p = CharNext(p))
- if (*p == '\\')
- *p = '/';
-
p = strrchr(libpath, '/');
if (p) {
*p = 0;
@@ -711,6 +728,9 @@ proc_options(argc, argv)
if (!e_script) {
argc--; argv++;
}
+#ifdef DOSISH
+ translate_char(script, '\\', '/');
+#endif
}
ruby_script(script);
diff --git a/version.h b/version.h
index e2c7b52566..6ab43d690d 100644
--- a/version.h
+++ b/version.h
@@ -1,4 +1,4 @@
#define RUBY_VERSION "1.7.3"
-#define RUBY_RELEASE_DATE "2002-10-02"
+#define RUBY_RELEASE_DATE "2002-10-03"
#define RUBY_VERSION_CODE 173
-#define RUBY_RELEASE_CODE 20021002
+#define RUBY_RELEASE_CODE 20021003