summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-28 09:53:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-28 09:53:42 +0000
commit0a2f8b61d47116a2f2e17f6026fd7f17c2f15878 (patch)
tree04d1097b4a3e8e795f16306fe9f350a57a0f0057 /lib
parentdf9d49d0881d9596b9b7d23dbd42950d5048bd9d (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/debug.rb35
-rw-r--r--lib/mkmf.rb2
2 files changed, 27 insertions, 10 deletions
diff --git a/lib/debug.rb b/lib/debug.rb
index feb30c7..97be752 100644
--- a/lib/debug.rb
+++ b/lib/debug.rb
@@ -119,6 +119,15 @@ class DEBUGGER__
end
end
+ def debug_silent_eval(str, binding)
+ begin
+ val = eval(str, binding)
+ val
+ rescue StandardError, ScriptError
+ nil
+ end
+ end
+
def var_list(ary, binding)
ary.sort!
if false # ary.size < 0
@@ -307,9 +316,9 @@ class DEBUGGER__
when /^\s*disp(?:lay)?\s+(.+)$/
exp = $1
- display.push.push [true, exp]
- stdout.printf " %d: %s = %s\n", display.size, exp,
- eval(exp, binding) rescue "--"
+ display.push [true, exp]
+ stdout.printf "%d: ", display.size
+ display_expression(exp, binding)
when /^\s*disp(?:lay)?$/
display_expressions(binding)
@@ -493,12 +502,17 @@ EOHELP
n = 1
for d in display
if d[0]
- stdout.printf "%d: %s = %s\n", n, d[1], debug_eval(d[1], binding).to_s
+ stdout.printf "%d: ", n
+ display_expression(d[1], binding)
end
n += 1
end
end
+ def display_expression(exp, binding)
+ stdout.printf "%s = %s\n", exp, debug_silent_eval(exp, binding).to_s
+ end
+
def frame_set_pos(file, line)
if @frames[0]
@frames[0][1] = file
@@ -559,22 +573,25 @@ EOHELP
end
def check_break_points(file, pos, binding, id)
+ return false if break_points.empty?
+ MUTEX.lock
file = File.basename(file)
n = 1
for b in break_points
if b[0]
if b[1] == 0 and b[2] == file and b[3] == pos
- MUTEX.lock
stdout.printf "breakpoint %d, %s at %s:%s\n", n, debug_funcname(id), file, pos
return true
- elsif b[1] == 1 and debug_eval(b[2], binding)
- MUTEX.lock
- stdout.printf "watchpoint %d, %s at %s:%s\n", n, debug_funcname(id), file, pos
- return true
+ elsif b[1] == 1
+ if debug_silent_eval(b[2], binding)
+ stdout.printf "watchpoint %d, %s at %s:%s\n", n, debug_funcname(id), file, pos
+ return true
+ end
end
end
n += 1
end
+ MUTEX.unlock
return false
end
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 83afac6..63e89c2 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -30,7 +30,7 @@ $hdrdir.gsub!('/', '\\') if RUBY_PLATFORM =~ /mswin32/
CFLAGS = CONFIG["CFLAGS"]
if RUBY_PLATFORM == "m68k-human"
CFLAGS.gsub!(/-c..-stack=[0-9]+ */, '')
-elsif RUBY_PLATFORM =~ /-nextstep|-rhapsody/
+elsif RUBY_PLATFORM =~ /-nextstep|-rhapsody|-darwin/
CFLAGS.gsub!( /-arch\s\w*/, '' )
end