Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use default max_lines when calling up & down #1094

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HeyNonster
Copy link

@HeyNonster HeyNonster commented Apr 4, 2024

Description

Both up and down only show 1 source line when called, I think it would be more useful if they provided more context. This removes the max_lines: 1 kwarg when they call show_src. max_lines in show_src will default to CONFIG[:show_src_lines]1.

Big thanks to @st0012 for showing me and @bquorning where this behavior is defined.

Footnotes

  1. (https://github.com/ruby/debug/blob/0b77e8294b5b220b3b2a089bf09f94808654899a/lib/debug/thread_client.rb#L510)

@st0012
Copy link
Member

st0012 commented Apr 4, 2024

I want to second this proposal as I also often need to chain whereami after moving to a different frame, which IMO is not the best user experience in most cases.

@HeyNonster HeyNonster force-pushed the nony--show-src-lines-up-down branch from c07fda0 to caec1c5 Compare April 4, 2024 20:57
@HeyNonster
Copy link
Author

Also probably useful to note that byebug displays more lines by default making it quite a difference switching from byebug to debug:

byebug-vs-debug.mov

@HeyNonster HeyNonster force-pushed the nony--show-src-lines-up-down branch from caec1c5 to b1963e7 Compare May 16, 2024 04:20
Copy link

launchable-app bot commented May 16, 2024

Launchable Report

❌ Test session #2907805 failedos:ubuntu-latest test_task:test_protocoldetails on CI
🔔 no issues ✖️1 test failed ✔️63 tests passed

❌ Test session #2907807 failedos:ubuntu-latest test_task:test_protocoldetails on CI
🔔 no issues ✖️1 test failed ✔️63 tests passed

Passed test sessions

✅ Test session #2907791 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2907792 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2907793 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2907794 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2907796 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2907798 passed os:ubuntu-latest test_task:test_testdetails on CI
✅ Test session #2907799 passed os:ubuntu-latest test_task:test_protocoldetails on CI
✅ Test session #2907800 passed os:ubuntu-latest test_task:test_protocoldetails on CI
✅ Test session #2907801 passed os:ubuntu-latest test_task:test_protocoldetails on CI
✅ Test session #2907803 passed os:ubuntu-latest test_task:test_protocoldetails on CI
✅ Test session #2907815 passed os:ubuntu-latest test_task:test_protocoldetails on CI
✅ Test session #2907818 passed os:macos-latest test_task:test_consoledetails on CI
✅ Test session #2907822 passed os:macos-latest test_task:test_consoledetails on CI
✅ Test session #2907823 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2907824 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2907825 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2907826 passed os:macos-latest test_task:test_consoledetails on CI
✅ Test session #2907829 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2907831 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2907834 passed os:ubuntu-latest test_task:test_consoledetails on CI
✅ Test session #2907857 passed os:ubuntu-latest test_task:test_consoledetails on CI

Build: refs_pull_1094_merge_b1963e7b72554c9672900ba046c3088598955488

@HeyNonster
Copy link
Author

Seems the protocol tests are flaky: #1060

@HeyNonster HeyNonster force-pushed the nony--show-src-lines-up-down branch from b1963e7 to a1df646 Compare June 12, 2024 11:02
Both `up` and `down` only show 1 source line when called, I think it
would be more useful if they provided more context. This removes the
`max_lines: 1` kwarg when they call `show_src`. `max_lines` in `show_src` will default
to `CONFIG[:show_src_lines]`[^1].

[^1]:(https://github.com/ruby/debug/blob/0b77e8294b5b220b3b2a089bf09f94808654899a/lib/debug/thread_client.rb#L510)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants