summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-31 02:42:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-31 02:42:10 +0000
commit56abb12f8d66c9b73fc99ca2d4ada7f865184f16 (patch)
treedb8d95ace197caec8953874b80d96abe0c50b883 /misc
parente003725fc369cb45c93664aa993f5c380c1e771f (diff)
downloadruby-56abb12f8d66c9b73fc99ca2d4ada7f865184f16.tar.gz
lldb_cruby.py: eval outside frames
* misc/lldb_cruby.py (lldb_rp): evaluate without frames when no process is running, and show error messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/lldb_cruby.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py
index 4b5d6feb49..8284ac8498 100755
--- a/misc/lldb_cruby.py
+++ b/misc/lldb_cruby.py
@@ -48,7 +48,14 @@ def lldb_rp(debugger, command, result, internal_dict):
process = target.GetProcess()
thread = process.GetSelectedThread()
frame = thread.GetSelectedFrame()
- val = frame.EvaluateExpression(command)
+ if frame.IsValid():
+ val = frame.EvaluateExpression(command)
+ else:
+ val = target.EvaluateExpression(command)
+ error = val.GetError()
+ if error.Fail():
+ print >> result, error
+ return
num = val.GetValueAsSigned()
if num == RUBY_Qfalse:
print >> result, 'false'
@@ -57,7 +64,7 @@ def lldb_rp(debugger, command, result, internal_dict):
elif num == RUBY_Qnil:
print >> result, 'nil'
elif num == RUBY_Qundef:
- print >> result, 'Qundef'
+ print >> result, 'undef'
elif fixnum_p(num):
print >> result, num >> 1
elif flonum_p(num):