summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-14 13:51:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-14 13:51:19 +0000
commit604689628dc64d050a68f1ebe5e06f9105474936 (patch)
tree84a09689df2b995caae9e56689d050723718ed6d /eval.c
parenta1c02ee495d945f943fedc3f11fcb323289dc756 (diff)
* configure.in (LIBRUBY_A): append -static. [ruby-dev:18689]
* configure.in (LIBRUBYARG_STATIC, LIBRUBYARG_SHARED): linker argument to link static/shared library respectively. * Makefile.in (LIBRUBYARG_STATIC, LIBRUBYARG_SHARED): added. * bcc32/Makefile.sub, win32/Makefile.sub: ditto. * instruby.rb (LIBRUBY_A): install to libdir. * lib/mkmf.rb (link_command): link static library of ruby, or try_run fails unless LIBRUBY_SO is installed. [ruby-dev:18646] * eval.c (call_trace_func): toplevel caller was missing. [ruby-dev:18754] * eval.c (proc_to_s): adjust created line number. * parse.y (primary, do_block, brace_block): adjust line number of block to beginning line, instead of the first statement inside the block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/eval.c b/eval.c
index 3e9548d..79cde66 100644
--- a/eval.c
+++ b/eval.c
@@ -2103,6 +2103,7 @@ call_trace_func(event, node, self, id, klass)
if (node) {
ruby_current_node = node;
+ ruby_frame->node = node;
ruby_sourcefile = node->nd_file;
ruby_sourceline = nd_line(node);
}
@@ -2324,7 +2325,7 @@ rb_eval(self, n)
if (trace_func) {
call_trace_func("line", node, self,
ruby_frame->last_func,
- ruby_frame->last_class);
+ ruby_frame->last_class);
}
if (RTEST(rb_eval(self, node->nd_cond))) {
node = node->nd_body;
@@ -6686,17 +6687,18 @@ proc_to_s(self, other)
VALUE self, other;
{
struct BLOCK *data;
+ NODE *node;
char *cname = rb_class2name(CLASS_OF(self));
const int w = (SIZEOF_LONG * CHAR_BIT) / 4;
long len = strlen(cname)+6+w; /* 6:tags 16:addr */
VALUE str;
Data_Get_Struct(self, struct BLOCK, data);
- if (data->body) {
- len += strlen(data->body->nd_file) + 2 + (SIZEOF_LONG*CHAR_BIT-NODE_LSHIFT)/3;
+ if ((node = data->frame.node) || (node = data->body)) {
+ len += strlen(node->nd_file) + 2 + (SIZEOF_LONG*CHAR_BIT-NODE_LSHIFT)/3;
str = rb_str_new(0, len);
sprintf(RSTRING(str)->ptr, "#<%s:0x%.*lx@%s:%d>", cname, w, (VALUE)data->tag,
- data->body->nd_file, nd_line(data->body));
+ node->nd_file, nd_line(node));
}
else {
str = rb_str_new(0, len);