ruby-changes:46859
From: nobu <ko1@a...>
Date: Wed, 31 May 2017 11:42:15 +0900 (JST)
Subject: [ruby-changes:46859] nobu:r58974 (trunk): lldb_cruby.py: eval outside frames
nobu 2017-05-31 11:42:10 +0900 (Wed, 31 May 2017) New Revision: 58974 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58974 Log: lldb_cruby.py: eval outside frames * misc/lldb_cruby.py (lldb_rp): evaluate without frames when no process is running, and show error messages. Modified files: trunk/misc/lldb_cruby.py Index: misc/lldb_cruby.py =================================================================== --- misc/lldb_cruby.py (revision 58973) +++ misc/lldb_cruby.py (revision 58974) @@ -48,7 +48,14 @@ def lldb_rp(debugger, command, result, i https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L48 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, i https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L64 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): -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/