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

Feature req 'print' to a file or pager #3615

Closed
thockin opened this issue Jan 1, 2024 · 4 comments · Fixed by #3620
Closed

Feature req 'print' to a file or pager #3615

thockin opened this issue Jan 1, 2024 · 4 comments · Fixed by #3620

Comments

@thockin
Copy link
Contributor

thockin commented Jan 1, 2024

  1. What version of Delve are you using (dlv version)?

Delve Debugger
Version: 1.21.1
Build: $Id: a358c02f24aa7047ecc562b0587dc2d08330b2cf $

  1. What version of Go are you using? (go version)?

go version go1.21.3 linux/amd64

  1. What operating system and processor architecture are you using?

linux amd64

  1. What did you do?

Printed a large stucture

  1. What did you expect to see?

A way to redirect output to a file

  1. What did you see instead?

No option for this

Two use cases:

  1. p bigObj | less

  2. p bigObj > out.file

@aarzilli
Copy link
Member

aarzilli commented Jan 1, 2024

For the file:

(dlv) transcript test.txt
(dlv) p bigObj
(dlv) transcript -off

aarzilli added a commit to aarzilli/delve that referenced this issue Jan 2, 2024
Add automatic paging to the output of print, vars, args and locals.

Fixes go-delve#3615
@aarzilli
Copy link
Member

aarzilli commented Jan 2, 2024

The approach we have for paging so far is that it is done automatically when needed. The attached PR extends this mechanism to print (and a few related commands). Thoughts?

@thockin
Copy link
Contributor Author

thockin commented Jan 2, 2024

oh, I didn't know about transcript. That's what I need.

Whatever existing paging we have did NOT kick in when printing my large object. That PR looks like it would fix it. How does paging intersect with transcript? :)

@aarzilli
Copy link
Member

aarzilli commented Jan 2, 2024

Whatever existing paging we have did NOT kick in when printing my large object

It wasn't applied to print, deliberately.

How does paging intersect with transcript?

It'll write to the file everything you see, at least.

aarzilli added a commit to aarzilli/delve that referenced this issue Jan 3, 2024
Add automatic paging to the output of print, vars, args and locals.

Fixes go-delve#3615
derekparker pushed a commit that referenced this issue Jan 9, 2024
Add automatic paging to the output of print, vars, args and locals.

Fixes #3615
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants