Skip to content

Instantly share code, notes, and snippets.

@chuckremes
Created December 31, 2017 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuckremes/d838cba8cab96f92f95b3a16f1f468bb to your computer and use it in GitHub Desktop.
Save chuckremes/d838cba8cab96f92f95b3a16f1f468bb to your computer and use it in GitHub Desktop.
(lldb) up
frame #1: 0x0000000100066b8c rbx`rubinius::CallSite::Cache::poly_execute(state=0x000070000b08dc10, call_site=0x000000010c237d80, args=0x000070000b08bcf0) at call_site.hpp:223
220 cache->hit();
221 entries[i].hit();
222
-> 223 return entries[i].prediction()->executable()->execute(state,
224 entries[i].prediction()->executable(),
225 entries[i].prediction()->module(), args);
226 } else {
(lldb) p *cache
(rubinius::CallSite::Cache) $0 = (_size_ = 10, _hits_ = 886, _misses_ = 0, _evictions_ = 0, _entries_ = rubinius::CallSite::Cache::Entry [] @ 0x00007fa9cf21b1d0)
(lldb) p call_frame->compiled_code->show(state)
error: use of undeclared identifier 'call_frame'
(lldb) up
rbx was compiled with optimization - stepping may behave oddly; variables may not be available.
frame #2: 0x0000000100190485 rbx`rubinius::instructions::send_stack(rubinius::State*, rubinius::CallFrame*, long, long) [inlined] rubinius::CallSite::execute(this=<unavailable>, state=0x000070000b08dc10, args=0x000000000000458e) at call_site.hpp:305 [opt]
302 }
303
304 Object* execute(STATE, Arguments& args) {
-> 305 return _execute_(state, this, args);
306 }
307
308 void lookup(STATE, Arguments& args, Dispatch& dispatch, LookupData& lookup_data) {
(lldb) up
frame #3: 0x000000010019047f rbx`rubinius::instructions::send_stack(state=0x000070000b08dc10, call_frame=0x000070000b08beb0, literal=<unavailable>, count=<unavailable>) at send_stack.hpp:16 [opt]
13
14 stack_clear(count + 1);
15
-> 16 call_frame->return_value = call_site->execute(state, args);
17
18 state->vm()->checkpoint(state);
19
(lldb) p call_frame->compiled_code->show(state)
#<Rubinius::CompiledCode:0x10c226d00>
file: :thread.rb
iseq: #<Rubinius::InstructionSequence:0x10c227418>
opcodes: #<Rubinius::Tuple:0x10992d000>: 303
49
1
23
8
55
83
...
>
>
lines: #<Rubinius::Tuple:0x10c2320a0>: 51
-1
53
8
54
19
56
...
>
local_count: 4
local_names: #<Rubinius::Tuple:0x10c232548>: 4
:mutex
:timeout
:wchan
:signaled
>
name: :wait
required_args: 1
scope: #<Rubinius::LexicalScope:0x10a39fc50>
module: #<ConditionVariable(Class):0x10a39e700>
name: :ConditionVariable
superclass: #<Object(Class):0x103800170>
constant_table: #<Rubinius::ConstantTable:0x10a39e850>: 16
>
method_table: #<Rubinius::MethodTable:0x10a39e778>: 16
:wait, :signal, :initialize, :broadcast,
>
>
current_module: nil
parent: #<Rubinius::LexicalScope:0x10a39dde0>
module: #<Object(Class):0x103800170>
name: :Object
superclass: #<MainSpecs::Module(Rubinius::IncludedModule):0x11a5fbd28>
constant_table: #<Rubinius::ConstantTable:0x103800698>: 1024
:TOLERANCE, :SummaryFormatter:BeCloseMatcher, :SpinnerFormatter, :ExtensionsGuard, :ByteArraySpecs:Struct, :MethodFormatter:IncludeMatcher, :YamlFormatter:MAIN, :MonitorMixin, :ProfileFormatter, :NonComplianceGuard:Monitor, :InfinityMatcher, :JUnitFormatter, :TwoPi, :CustomArgumentError:BeComputedByMatcher:SpecTag, :PlatformGuard, :MyFiber:Signal, :Gem, :Digest:FileUtils:FDSet, :BeComputedByFunctionMatcher:MatchYAMLMatcher:QuarantineGuard:CallSiteSpecs:BeEmptyMatcher, :FileStat, :A:RunnerGuard, :ProcSpecs:FileTest, :Etc, :SpecGuard, :BeFalseMatcher, :RaiseErrorMatcher:ConditionVariable:Thread, :ImmediateValue, :Queue, :Third:SizedQueue, :BeKindOfMatcher, :RaiseExceptionMatcher:Continuation, :OutputMatcher, :ProfilerGuard, :TupleSpecs, :C:BeNaNMatcher, :UnspecifiedGuard:SpecifiedOnGuard:ScriptError, :Mock:StandardError, :ThreadGroup, :BeNilMatcher, :MathSpecs:TypeError, :KernelSpecs, :EnumSpecs:ArgumentError, :SupportedGuard, :IncludesMath:NameError, :BeTrueMatcher, :InstructionSpec, :SChild:RegexpError, :RUBY_ENGINE, :SpecExpectationNotFoundError:NoMethodError, :RUBY_ENGINE_VERSION, :StringIO, :OutputToFDMatcher, :SuperUserGuard, :CoreClassSpecs:SyntaxError, :RUBY_PATCHLEVEL, :BeValidDNSName:LoadError, :RUBY_PLATFORM, :TOPLEVEL_BINDING, :Whiskey:Exception, :RuntimeError, :RUBY_RELEASE_DATE, :TTYGuard, :UNIXSocket:Data, :SystemCallError, :RUBY_COPYRIGHT, :IOSpecs:Autoload, :SystemStackError, :RUBY_REVISION, :ComplainMatcher, :SPEC_TEMP_DIR:Proc, :LocalJumpError, :RUBY_DESCRIPTION, :SPEC_TEMP_UNIQUIFIER, :UserGuard, :CONST, :ArraySpecs:RangeError, :SPEC_TMEM_DIR_PID, :GCStatsAction, :ConstLookupSpecs, :TypeSpecs:FloatDomainError, :ExampleState:ZeroDivisionError, :ObjectSpecDupInitCopy:IOError, :IOStub, :RespondToMatcher, :MemoryAction, :RangeSpecs:InterpreterError, :EnumerableSpecGrep, :IPSocket, :ObjectSpecDup, :RegexpSpecsSubclass, :Channel:DeadlockError, :STDIN, :GC, :ObjectSpecs, :EnumerableSpecGrep2, :EnumeratorSpecs, :RegexpSpecsSubclassTwo:Object, :STDOUT, :SignedZeroMatcher, :UNIXServer:BasicObject, :STDERR, :Parser19Action, :UDPSocket, :ModuleSpecs_CS3:Class:Module, :ProfilerAction, :Socket, :ThreadSpecs:Array, :BlockingMatcher, :TCPSocket, :Mixin:WeakRef, :MatchFilter, :MainSpecs, :DefineMethodByProcClass, :BaseClass:Rubinius, :RegexpFilter:ProfileFilter, :MSpecMain, :TCPServer:Hash, :DebugAction, :MSpecRun:SpecDataRelation, :MSpecTag, :EnumerableSpecIncludeP, :Fcntl, :MyRange:Fiber, :PrimitiveFailure, :FFIStructSpecs:MemorySegmentionError, :NO_MATCHER_GIVEN, :EnumerableSpecIncludeP11:Errno, :SpecExpectationNotMetError, :FeatureGuard:CompileAsMatcher:ARGF, :Addrinfo, :RationalSpecs, :ModuleSpecs:Encoding, :Complex, :DEFAULT_RECORD_SEPARATOR, :RUBY_VERSION, :HashSpecs, :ConstantSpecsAdded:SignalException, :EqlMatcher:NoMemoryError, :Mod0, :ConstantSpecsIncludedModule:UncaughtThrowError, :Mod1:StopIteration, :MSpecCI, :EqualMatcher, :Meths, :Mod2:SecurityError, :EnumeratorLazySpecs, :UserMarshal, :Mod3:ThreadError, :UserDefined, :Mod4:NilClass, :FiberError, :EqualElementMatcher, :Mod5:TrueClass, :NotImplementedError, :ActionFilter, :MyClass, :UserString, :Mod6, :DefineMethodSpecClass:FalseClass, :Interrupt, :RubySL, :CompiledCodeSpecs, :UserRegexp, :Mod7:Numeric, :SystemExit, :LookupTableSpecs, :UserArray, :Mod8:Integer, :KeyError, :Tally, :UserHash, :Mod9:Fixnum, :FatalError, :File, :CODE_LOADING_DIR, :UserHashInitParams, :Mod10:Coercable, :Mod11:MSpecScript, :ComparableSpecs, :Mod12, :ProcFromMethod:Symbol, :Mutex, :MSpecOptions, :MockProxy, :ThreadRunner, :ReflectSpecs, :MarshalSpec, :Mod13, :ProcessSpecs:Mod14, :NumericSpecs:Mod15:EqualUtf16Matcher, :TagAction, :Mod16:EncodingSpecs, :Mod17:Mod18, :RUBY18_SIGNALS:Mod19:String, :Mod20:TallyAction, :Mod21:HaveConstantMatcher, :CS_CONST1, :Mod22:NIL, :VariableMatcher, :TagListAction, :ConstantSpecs, :BasicObjectSpecs, :UserDefinedWithIvar, :Mod23, :DestinationClass:MSpec, :Mod24, :ChildClass:Mod25, :DestinationModule:TagPurgeAction, :UserDefinedImmediate, :Mod26, :ObjectSpaceFixtures, :SymbolSpecs:UserPreviouslyDefinedWithInitializedIvar, :Mod27:StringSymbolAdapter, :CS_CONST20, :FloatSpecs, :Mod28:ARG0, :Binding, :Mod29:ARGV, :Math, :UserMarshalWithClassName:Config, :UserMarshalWithIvar:ExceptionSpecs, :UserObject:Kernel, :HaveClassVariableMatcher, :UserCustomConstructorString:Process, :RUBY_EXE, :NoMethodErrorSpecs, :UserData, :StringSpecs:IO, :Enumerable, :ObjectSpace, :TimerAction, :MockIntObject, :TagFilter, :OpenSSL:ENV, :HaveDataMatcher, :ScratchPad:BackgroundGuard:ThreadBacktraceLocationSpecs:TRUE, :HaveInstanceMethodMatcher, :MockObject:Dir, :SpecExpectation, :MethodMatcher, :BlockDeviceGuard, :MethodSpecs, :ObjectSpaceSpecEachObject:Time, :SpecVersion, :UserDataUnloadable, :YY, :ObjectSpaceSpecEachClass:NumericMockObject, :SocketError, :ObjectSpaceSpecEachModule:Range, :MethsMore, :ObjectSpaceSpecEachOtherObject:Regexp, :Comparable, :Parent, :StructClasses:MatchData, :Rational, :BugGuard, :BasicSocket:Bignum, :VersionGuard:Float, :ContextState, :HaveInstanceVariableMatcher:Child:Marshal, :PrettyPrint, :IncludeSpecsTop:Unmarshalable, :HaveMethodMatcher, :IncludeSpecsMiddle:Enumerator, :Method, :SpecPositiveOperatorMatcher, :PP, :FileSpecs, :IncludeSpecsClass:DirSpecs:HavePrivateInstanceMethodMatcher:MSpecOption, :SpecNegativeOperatorMatcher, :CompliantOnGuard, :ArraySub:Random, :RUBY_NAME, :NotCompliantOnGuard, :ArraySubPush:EncodingError, :ExceptionState, :BeAnInstanceOfMatcher, :HavePrivateMethodMatcher, :SameName:NamespaceTest:EOFError, :UnboundMethod:HaveProtectedInstanceMethodMatcher, :ConflictsGuard, :StrangeEach:SpecdocFormatter, :CS_CONST306, :BindingSpecs:HtmlFormatter:RbConfig, :DottedFormatter, :HavePublicInstanceMethodMatcher, :EndianGuard, :CS_CONST308, :EnumerableSpecs, :X:FALSE, :CROSS_COMPILING, :BeAncestorOfMatcher, :DescribeFormatter, :BigEndianGuard, :FFI:IndexError, :FileFormatter, :LittleEndianGuard, :CodeLoadingSpecs:HaveSingletonMethodMatcher, :SpecEvaluate, :UnitdiffFormatter
>
method_table: #<Rubinius::MethodTable:0x1038006d0>: 512
:hostname, :foo39, :foo103, :equal, :have_singleton_method, :foo40, :foo104, :extended_on, :fixture, :foo41, :foo105, :foo42, :foo106, :be_close, :flunk, :foo43, :foo107, :encode, :deviates_on, :foo44, :foo108, :module_specs_private_method_on_object, :output, :specify, :foo45, :foo109, :module_specs_protected_method_on_object, :foo46, :foo110, :module_specs_private_method_on_object_for_kernel_public, :be_computed_by, :be_positive_infinity, :hash_class, :foo47, :foo111, :Digest, :module_specs_public_method_on_object_for_kernel_protected, :be_negative_infinity, :new_hash, :foo48, :foo112, :module_specs_public_method_on_object_for_kernel_private, :platform_is, :mkdir_p, :foo49, :foo113, :mock_to_path, :foo50, :foo114, :module_specs_public_method_on_object, :be_computed_by_function, :equal_element, :string_mirror, :foo51, :foo115, :quarantine!, :nan_value, :foo52, :foo116, :describe, :little_endian, :infinity_value, :foo53, :foo117, :be_empty, :match_yaml, :bignum_value, :foo54, :foo118, :foo55, :foo119, :equal_utf16, :fixnum_max, :foo56, :foo120, :be_false, :raise_error, :fixnum_min, :foo57, :foo121, :new_io, :foo58, :runner_is, :pack_int, :foo59, :be_kind_of, :runner_is_not, :foo60, :cp, :ruby_exe_options, :foo61, :have_constant, :foo62, :be_nan, :foo63, :unspecified, :resolve_ruby_exe, :with_profiler, :foo64, :specified_on, :it_has_keys, :foo1, :foo65, :be_nil, :ruby_exe, :foo2, :foo66, :it_has_entries, :foo3, :foo67, :not_supported_on, :foo4, :foo68, :be_true, :raise_exception, :ruby_cmd, :foo5, :foo69, :foo6, :foo70, :unpack_format, :have_class_variable, :it_behaves_like, :as_superuser, :foo7, :foo71, :context, :foo8, :foo72, :be_valid_DNS_name, :output_to_fd, :foo9, :foo73, :have_data, :with_tty, :relates, :foo10, :foo74, :before, :process_is_foreground, :rm_r, :foo11, :foo75, :new_fd, :after, :stasy, :foo12, :foo76, :it, :as_user, :foo13, :foo77, :platform_is_not, :foo14, :foo78, :__show__, :it_should_behave_like, :pack_format, :foo15, :foo79, :have_instance_method, :with_block_device, :foo16, :foo80, :respond_to, :argv, :foo17, :foo81, :complain, :foo18, :foo82, :foo19, :foo83, :be_positive_zero, :new_datetime, :foo20, :foo84, :have_instance_variable, :be_negative_zero, :mock, :foo21, :foo85, :ruby_bug, :env, :foo22, :foo86, :foo23, :foo87, :have_method, :evaluate, :foo24, :foo88, :ruby_version_is, :foo25, :foo89, :foo26, :foo90, :main_public_method, :have_private_instance_method, :block_caller, :with_timezone, :foo27, :foo91, :main_private_method, :foo28, :foo92, :options_or_mode, :compliant_on, :foo29, :foo93, :fmode, :have_private_method, :not_compliant_on, :responds_to, :foo30, :foo94, :should, :stub!, :doc, :does_not_respond_to, :touch, :foo31, :foo95, :should_receive, :undefine, :new_character, :jit, :foo32, :foo96, :have_protected_instance_method, :should_not, :should_not_receive, :conflicts_with, :fake!, :foo33, :foo97, :be_an_instance_of, :with_feature, :mock_int, :foo34, :foo98, :mock_numeric, :windows_env_echo, :foo35, :foo99, :have_public_instance_method, :__mspec_object_id__, :username, :foo36, :foo100, :be_ancestor_of, :eql, :home_directory, :compile_as, :foo37, :foo101, :tmp, :big_endian, :dev_null, :foo38, :foo102,
>
>
current_module: nil
parent: nil
>
>
splat: nil
stack_size: 9
total_args: 2
code_id: nil
internalized: yes
>
(rubinius::Object *) $1 = 0x000000000000001a
(lldb) p call_frame->print_backtrace(state, 0, 0)
0x70000b08beb0: ConditionVariable#wait in thread.rb:63 (+102)
0x70000b08c2c0: __block__ in thread.rb:188 (+81)
0x70000b08c700: Mutex#synchronize in core/mutex.rb:62 (+12)
0x70000b08cac0: Queue#receive in thread.rb:180 (+19)
0x70000b08ced0: __block__ in /Users/cremes/dev/mygit/rubinius/spec/ruby/core/thread/list_spec.rb:25 (+5)
0x70000b08d770: Proc#call in core/proc.rb:20 (+247)
(lldb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment