public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "Jiří Wolker" <jwo@jwo.cz>
Cc: binutils@sourceware.org
Subject: Re: [PATCH WIP] objdump: UTF-8 jump visuzalization
Date: Wed, 12 Jun 2024 09:33:37 +0200	[thread overview]
Message-ID: <78847c55-d5fa-423b-8b38-1bdf5dd9d366@suse.com> (raw)
In-Reply-To: <cb383920-d1ec-4f6c-aa79-5240e809ee52@jwo.cz>

On 11.06.2024 20:14, Jiří Wolker wrote:
> I've just modified the objdump to render the jump visualization using 
> UTF-8 characters. I attach the patch and a screenshot of the new output 
> with extended color enabled.
> 
> I send this message to ask whether this feature has an opportunity to be 
> added to the binutils.

I see no reason why it shouldn't be acceptable once finished.

> My patch is not finished – it is required to add 
> some other characters to the output to make the output cleaner, also 
> autodetection of UTF-8 environment (and enabling the UTF-8 on such 
> machines) should be added. Also, fine-tuning the output (such as 
> changing arrow shape) for user's needs would be a nice feature.

Right, even the rendering in the browser on the mailing list archive
shows, like at least my email UI, that ...

> Output of the objdump, in plain text:
> 
> 00000000000001ed <print_msg>:
>   1ed:	          50                   	push   %rax
>   1ee:	          52                   	push   %rdx
>   1ef:	          56                   	push   %rsi
>   1f0:	   ╭────→ ac                   	lods   %ds:(%rsi),%al

... arrows aren't quite smooth. Unlike in the picture you had attached.

As to selection of characters, I'd like to note that in the viewer I'm
using to look at your patch as well as in one of the the two consoles I
tried, I can't properly see two of the characters, apparently due to
limitations of the font used. While use of the feature is optional
anyway, it might be nice if characters chosen were covered by a wide
range of commonly used fonts (including ones specifically aiming at use
for console output, which I've often found to support more limited sets).

As to the new command line option: I think the way you have it would
end up somewhat ambiguous if both it and the original option were used.
Instead I think you want to make this a new sub-option of
--visualize-jumps, i.e. --visualize-jumps=utf8. Further, just to
mention it because you don't say so above, please don't forget to also
adjust doc/binutils.texi.

Jan

>   1f1:	   │      08 c0                	or     %al,%al
>   1f3:	   │  ╭─  74 04                	je     1f9 <print_msg+0xc>
>   1f5:	   │  │   e6 e9                	out    %al,$0xe9
>   1f7:	   ╰──│─  eb f7                	jmp    1f0 <print_msg+0x3>
>   1f9:	      ╰─→ 8b 34 24             	mov    (%rsp),%esi
>   1fc:	╭───────→ 66 ba fd 03          	mov    $0x3fd,%dx
>   200:	│         ec                   	in     (%dx),%al
>   201:	│         24 20                	and    $0x20,%al
>   203:	├───────  74 f7                	je     1fc <print_msg+0xf>
>   205:	│         66 ba f8 03          	mov    $0x3f8,%dx
>   209:	│         ac                   	lods   %ds:(%rsi),%al
>   20a:	│         08 c0                	or     %al,%al
>   20c:	│     ╭─  74 07                	je     215 <print_msg+0x28>
>   20e:	│     │   3c 0a                	cmp    $0xa,%al
>   210:	│  ╭──│─  74 07                	je     219 <print_msg+0x2c>
>   212:	│  │  │   ee                   	out    %al,(%dx)
>   213:	├──│──│─  eb e7                	jmp    1fc <print_msg+0xf>
>   215:	│  │  ╰─→ 5e                   	pop    %rsi
>   216:	│  │      5a                   	pop    %rdx
>   217:	│  │      58                   	pop    %rax
>   218:	│  │      c3                   	ret
>   219:	│  ╰────→ b0 0d                	mov    $0xd,%al
>   21b:	│         ee                   	out    %al,(%dx)
>   21c:	│     ╭─→ 66 ba fd 03          	mov    $0x3fd,%dx
>   220:	│     │   ec                   	in     (%dx),%al
>   221:	│     │   24 20                	and    $0x20,%al
>   223:	│     ╰─  74 f7                	je     21c <print_msg+0x2f>
>   225:	│         66 ba f8 03          	mov    $0x3f8,%dx
>   229:	│         b0 0a                	mov    $0xa,%al
>   22b:	│         ee                   	out    %al,(%dx)
>   22c:	╰───────  eb ce                	jmp    1fc <print_msg+0xf>
> 


       reply	other threads:[~2024-06-12  7:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cb383920-d1ec-4f6c-aa79-5240e809ee52@jwo.cz>
2024-06-12  7:33 ` Jan Beulich [this message]
2024-06-12  7:48   ` Jiří Wolker
2024-06-12  8:40     ` Jan Beulich
2024-06-29 16:38       ` [PATCH][objdump] " Jiří Wolker
2024-07-03 14:49         ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78847c55-d5fa-423b-8b38-1bdf5dd9d366@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=jwo@jwo.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).