#byebug

2023-05-25

Halp, I think #byebug has me in a hostage situation. Serves me right for attempting to do another active record query when I hit an exception

“Cyebug)

(byebug) exit

*%% ThreadError Exception: Attempt to unlock a mutex which is locked by another thread/fiber oAt

(byebug) exit

*%x*% ThreadError Exception: Attempt to unlock a mutex which is locked by another thread/fiber gt

“Cyebug)

(byebug) exit

*%x*% ThreadError Exception: Attempt to unlock a mutex which is locked by another thread/fiber At

(byebug)

(0 > 0)
GenghisKen CoarGenghisKen@ruby.social
2022-11-27

Weirdness trying to modify #Ruby's default #𝚒𝚗𝚜𝚙𝚎𝚌𝚝 method. If I don't have an #𝚒𝚗𝚜𝚙𝚎𝚌𝚝 method in my #class, I get the usual

"#<𝚌𝚕𝚊𝚜𝚜𝚗𝚊𝚖𝚎:𝚒𝚗𝚜𝚝𝚊𝚗𝚌𝚎 @𝚒𝚟𝚊𝚛=𝚟𝚊𝚕𝚞𝚎, @𝚘𝚝𝚑𝚎𝚛_𝚒𝚟𝚊𝚛=𝚟𝚊𝚕𝚞𝚎>"

But if I define one like this,

def inspect
defval = super
return defval
end

what I get is

"#<𝚌𝚕𝚊𝚜𝚜𝚗𝚊𝚖𝚎:𝚒𝚗𝚜𝚝𝚊𝚗𝚌𝚎 ...>"

And I get anomalous results in the #byebug debugger, defval gets the above result. But if I enter "defval = super" by hand in the debugger, I get the original default output from 𝚒𝚗𝚜𝚙𝚎𝚌𝚝. ?

2019-06-12

When debugging #ruby, I always struggled to get #byebug to enter the contents of a block, painstakingly stepping through internal methods and watching out for the yield. If you've ever debugged #Rails and/or callbacks, you'll know this pain.

Today, I learned you can just type `c <line number>` to jump straight into the block while skipping all of the plumbing that yields to it.

:ruby: 🐜 🚫 👍

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst