Giter Club home page Giter Club logo

Comments (3)

ko1 avatar ko1 commented on July 18, 2024

STDIN from pipe will not work because Reline needs input.

$ echo p 1 | exe/rdbg
# No sourcefile available for -
=>#0    <main> at -:1
#<Thread:0x00007f42ded32368@DEBUGGER__::SESSION@server /home/ko1/ruby/debug/lib/debug/session.rb:179 run> terminated with exception (report_on_exception is true):
/home/ko1/ruby/install/trunk/lib/ruby/3.3.0+0/reline/ansi.rb:152:in `raw': Inappropriate ioctl for device (Errno::ENOTTY)

BTW remote debugging works fine.

[master]$ echo p 1 | exe/rdbg -O
DEBUGGER: Debugger can attach via UNIX domain socket (/run/user/1000/rdbg-3543)
DEBUGGER: wait for debugger connection...
DEBUGGER: Connected.
1
DEBUGGER: Disconnected.

hmm. can be used by pipe command line tool?

from debug.

st0012 avatar st0012 commented on July 18, 2024

I agree that showing help is better 👍

from debug.

dentarg avatar dentarg commented on July 18, 2024

But I think nobody use this feature

I would use it if it worked, to debug Rack/Puma on the fly:

$ echo 'app { |env| require "debug";debugger;[200, {}, ["OK"]] }' | puma --config /dev/stdin --port 0
Puma starting in single mode...
* Puma version: 6.4.2 (ruby 3.2.4-p170) ("The Eagle of Durango")
*  Min threads: 0
*  Max threads: 5
*  Environment: development
*          PID: 60630
* Listening on http://0.0.0.0:51168/
Use Ctrl-C to stop
# No sourcefile available for /dev/stdin
=>#0	block {|env={"rack.version"=>[1, 6], "rack.errors"=>...|} in _load_from at /dev/stdin:1
  #1	Puma::Configuration::ConfigMiddleware#call(env={"rack.version"=>[1, 6], "rack.errors"=>...) at ~/.arm64_rubies/3.2.4/lib/ruby/gems/3.2.0/gems/puma-6.4.2/lib/puma/configuration.rb:272
  # and 6 frames (use `bt' command for all frames)
▽#<Thread:0x0000000104ce37b8@DEBUGGER__::SESSION@server /Users/dentarg/.arm64_rubies/3.2.4/lib/ruby/gems/3.2.0/gems/debug-1.9.2/lib/debug/session.rb:179 run> terminated with exception (report_on_exception is true):
/Users/dentarg/.arm64_rubies/3.2.4/lib/ruby/gems/3.2.0/gems/reline-0.5.3/lib/reline/ansi.rb:284:in `pread': not opened for reading (IOError)
...

from debug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.