RFC: Adding visualization of jumps to objdump's disassembly output

Rich Felker dalias@libc.org
Wed Jan 8 16:58:00 GMT 2020


On Tue, Jan 07, 2020 at 06:18:48PM +0000, Nick Clifton wrote:
> Hi Guys,
> 
>   Attached is the latest version of Thomas Troeger's patch to add
>   visualization of jumps to objdump's output.  When enabled, the output
>   changes to look something like this snippet:
>   
>   c6:	|  |     \----------> be 00 00 00 00       	mov    $0x0,%esi
>   cb:	|  |           /----> 48 8b 3d 00 00 00 00 	mov    0x0(%rip),%rdi        # d2 <main+0xd2>
>   d2:	|  |           |      31 c0                	xor    %eax,%eax
>   d4:	|  |           |  /-- e8 00 00 00 00       	callq  d9 <main+0xd9>
>   d9:	|  |           |  \-> bf 02 00 00 00       	mov    $0x2,%edi
>   de:	|  +-----------|----- e8 00 00 00 00       	callq  e3 <main+0xe3>
>   e3:	|  \-----------|----> 48 89 da             	mov    %rbx,%rdx
>   e6:	|              |      be 00 00 00 00       	mov    $0x0,%esi
>   eb:	|              \----- eb de                	jmp    cb <main+0xcb>
>   ed:	\-------------------> 48 8b 16             	mov    (%rsi),%rdx
> 
>   (Not shown in this email is the fact that you can also add
>   color/colour to the output...)
>    
>   I am posting the patch here as I would very much like to see it added
>   before the 2.34 branch is cut, but I wanted more pairs of eyes than
>   just mine to have a look over it.  So - does anyone have any concerns
>   or issues with the patch ?

I love the concept. I've been meaning to find a tool I like that would
do this (lots of RE tools do), but I'd rather just be able to do it
with binutils and no heavy tooling.

One request: could you do Unicode output instead of ASCII? It would be
a lot more readable. It could be contingent on nl_langinfo(CODESET)
being "UTF-8" or similar, or an explicit command line option
(personally I'd prefer it be default if the locale supports it).

Rich



More information about the Binutils mailing list