Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The TracePoint Bumb!

The TracePoint Bumb!

RubyKaigi 2019 LT
https://rubykaigi.org/2019

Koichi ITO

April 19, 2019
Tweet

More Decks by Koichi ITO

Other Decks in Programming

Transcript

  1. Net::BufferedIO#rbuf_fill Use the lvar `tmp` Changed to assign the value

    of `@rbuf` or `nil` The value for the second default arg is `nil`
  2. %FpOFBNFUIPEUPTIPXUIFMWBS class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end
  3. MWBSTIPXFEJT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> ''
  4. %FpOFBTVCDMBTT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework end
  5. 6TFAMPDBM@WBSJBCMF@TFUA class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end Specify the event to evaluate the expression with `trace(:line)`
  6. 6TFAMPDBM@WBSJBCMF@TFUA class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end 4QFDJGZMWBSAIBSE@DPOpHA
  7. MWBSTIPXFEJT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end p Application.new.config #=> '' 4QFDJGZMWBSAIBSE@DPOpHA
  8. MWBSTIPXFEJT class Framework def initialize hard_config = '' @config_for_debug =

    "#{self.class}: #{hard_config}" end def config @config_for_debug end end p Framework.new.config #=> '' class Application < Framework def initialize trace = TracePoint.trace(:line) do |tp| tp.binding.local_variable_set(:hard_config, '') end super trace.disable end end p Application.new.config #=> '' p Framework.new.config #=> '' 4QFDJGZMWBSAIBSE@DPOpHA