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

make BB.debugDescription print xxd -r -p compatible format #367

Merged
merged 2 commits into from
Apr 27, 2018

Conversation

weissi
Copy link
Member

@weissi weissi commented Apr 27, 2018

Motivation:

When debugging, I often use ByteBuffer.debugDescription which dumps
the bytes. Unfortunately, the format wasn't compatible with what
xxd -r -p expects. Now you can just copy some output, for example

echo '04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12' | xxd -r -p

and xxd -r -p will correctly parse the byte values.

Modifications:

made BB.debugDescription prefix byte values under 0x10 with a 0 instead
of a space.

Result:

easier debugging with the standard tools

Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Apr 27, 2018
@Lukasa Lukasa added this to the 1.6.0 milestone Apr 27, 2018
@normanmaurer
Copy link
Member

@weissi can you please rebase and resolve the conflicts ?

Motivation:

When debugging, I often use ByteBuffer.debugDescription which dumps
the bytes. Unfortunately, the format wasn't compatible with what
`xxd -r -p` expects. Now you can just copy some output, for example

    echo '04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12' | xxd -r -p

and xxd -r -p will correctly parse the byte values.

Modifications:

made BB.debugDescription prefix byte values under 0x10 with a 0 instead
of a space.

Result:

easier debugging with the standard tools
@weissi
Copy link
Member Author

weissi commented Apr 27, 2018

@normanmaurer done

@Lukasa Lukasa merged commit a4318d5 into apple:master Apr 27, 2018
@weissi weissi deleted the jw-bb-xxd branch April 27, 2018 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants