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

improve big struct display #32

Open
cch123 opened this issue Mar 5, 2018 · 2 comments
Open

improve big struct display #32

cch123 opened this issue Mar 5, 2018 · 2 comments

Comments

@cch123
Copy link

cch123 commented Mar 5, 2018

I combined memviz with https://github.com/sitano/gsysint to display structure of runtime.g, and there are many fields in this struct.

Expected Behaviour

What were you wanting/expecting to happen?
The layout of a struct can be displayed as multiple lines or a table or something.

Actual Behaviour

What actually happens at the moment?
The struct is displayed as a single line, and too wide.

Example input

If possible, provide a small code sample which reproduces the issue (or, for a feature request, code that should work after the feature is implemented)

package main

import (
	"os"
	"sync/atomic"
	"unsafe"

	"github.com/bradleyjkemp/memviz"
	"github.com/sitano/gsysint"
)

func main() {
	var gp unsafe.Pointer

	atomic.StorePointer(&gp, gsysint.GetG())

	gg := (*gsysint.G)(gp)
	memviz.Map(os.Stdout, gg)
}

Screenshot/Example output (if applicable)

digraph {

}
@bradleyjkemp
Copy link
Owner

bradleyjkemp commented Mar 5, 2018

Hmm yeah that's a tricky one. I think displaying it as multiple rows would be quite messy with pointers coming out of the middle.

Would it help if the struct could be drawn vertically instead of horizontally? Then it's a lot easier to scroll through each field

@cch123
Copy link
Author

cch123 commented Mar 5, 2018

vertical display is also ok~

my render result can be found here

https://github.com/cch123/misc/blob/master/demo.jpg

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

No branches or pull requests

2 participants