public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Disassembly readability (/r no spaces)
@ 2013-10-11 16:19 Reini Urban
  2013-10-11 17:01 ` [PATCH] Disassembly readability (/r no spaces) [2] Reini Urban
  0 siblings, 1 reply; 4+ messages in thread
From: Reini Urban @ 2013-10-11 16:19 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 4688 bytes --]

Attached patch improves disassemble/r readability

Rationale:

compare this libudis64 output:
0x7ffff7fb88e9 0xcc1 488945e8                 	mov %rax, -0x18(%rbp)
0x7ffff7fb88ed 0xcc5 488b45f0                 	mov -0x10(%rbp), %rax
0x7ffff7fb88f1 0xcc9 488b4038                 	mov 0x38(%rax), %rax
0x7ffff7fb88f5 0xccd 488945f0                 	mov %rax, -0x10(%rbp)
0x7ffff7fb88f9 0xcd1 813805002500             	cmp $0x250005, (%rax)
0x7ffff7fb88ff 0xcd7 741e                     	jz 0xcf7
0x7ffff7fb8901 0xcd9 488b45f0                 	mov -0x10(%rbp), %rax
0x7ffff7fb8905 0xcdd 488945e8                 	mov %rax, -0x18(%rbp)
0x7ffff7fb8909 0xce1 488bbd70ffffff           	mov -0x90(%rbp), %rdi
0x7ffff7fb8910 0xce8 488b75f0                 	mov -0x10(%rbp), %rsi
0x7ffff7fb8914 0xcec 48b84a9fb8f7ff7f0000     	mov $0x7ffff7b89f4a, %rax
0x7ffff7fb891e 0xcf6 ffd0                     	call *%rax
0x7ffff7fb8920 0xcf8 eb04                     	jmp 0xcfe
0x7ffff7fb8922 0xcfa 488b45f0                 	mov -0x10(%rbp), %rax
0x7ffff7fb8926 0xcfe 488b4008                 	mov 0x8(%rax), %rax
0x7ffff7fb892a 0xd02 488bbd70ffffff           	mov -0x90(%rbp), %rdi
0x7ffff7fb8931 0xd09 488b75f0                 	mov -0x10(%rbp), %rsi
0x7ffff7fb8935 0xd0d 488b55e8                 	mov -0x18(%rbp), %rdx
0x7ffff7fb8939 0xd11 ffd0                     	call *%rax
0x7ffff7fb893b 0xd13 488945f0                 	mov %rax, -0x10(%rbp)
0x7ffff7fb893f 0xd17 488bbd70ffffff           	mov -0x90(%rbp), %rdi
0x7ffff7fb8946 0xd1e 488b75f8                 	mov -0x8(%rbp), %rsi
0x7ffff7fb894a 0xd22 488b55f0                 	mov -0x10(%rbp), %rdx
0x7ffff7fb894e 0xd26 48b8f6f1baf7ff7f0000     	mov $0x7ffff7baf1f6, %rax
0x7ffff7fb8958 0xd30 ffd0                     	call *%rax
0x7ffff7fb895a 0xd32 488945f8                 	mov %rax, -0x8(%rbp)
0x7ffff7fb895e 0xd36 488b45f8                 	mov -0x8(%rbp), %rax
0x7ffff7fb8962 0xd3a c9                       	leave
0x7ffff7fb8963 0xd3b c3                       	ret

against the current gdb output:
    0x00007ffff7ff035b:	f7 c0 f8 ff ff ff	test   $0xfffffff8,%eax
    0x00007ffff7ff0361:	74 0c	je     0x7ffff7ff036f
    0x00007ffff7ff0363:	81 38 04 00 25 00	cmpl   $0x250004,(%rax)
    0x00007ffff7ff0369:	75 04	jne    0x7ffff7ff036f
    0x00007ffff7ff036b:	48 89 50 08	mov    %rdx,0x8(%rax)
    0x00007ffff7ff036f:	48 89 55 b0	mov    %rdx,-0x50(%rbp)
    0x00007ffff7ff0373:	48 b8 6f 00 00 00 00 00 00 00	movabs $0x6f,%rax
    0x00007ffff7ff037d:	48 89 45 f8	mov    %rax,-0x8(%rbp)
    0x00007ffff7ff0381:	48 8b 55 f8	mov    -0x8(%rbp),%rdx
    0x00007ffff7ff0385:	48 8b 45 a8	mov    -0x58(%rbp),%rax
    0x00007ffff7ff0389:	f6 c0 01	test   $0x1,%al
    0x00007ffff7ff038c:	75 14	jne    0x7ffff7ff03a2
    0x00007ffff7ff038e:	f7 c0 f8 ff ff ff	test   $0xfffffff8,%eax
    0x00007ffff7ff0394:	74 0c	je     0x7ffff7ff03a2
    0x00007ffff7ff0396:	81 38 04 00 25 00	cmpl   $0x250004,(%rax)
    0x00007ffff7ff039c:	75 04	jne    0x7ffff7ff03a2
    0x00007ffff7ff039e:	48 89 50 08	mov    %rdx,0x8(%rax)
    0x00007ffff7ff03a2:	48 89 55 a8	mov    %rdx,-0x58(%rbp)
    0x00007ffff7ff03a6:	48 8b bd 70 ff ff ff	mov    -0x90(%rbp),%rdi
    0x00007ffff7ff03ad:	48 8b b5 68 ff ff ff	mov    -0x98(%rbp),%rsi
    0x00007ffff7ff03b4:	48 b8 03 00 00 00 00 00 00 00	movabs $0x3,%rax
    0x00007ffff7ff03be:	48 89 45 f8	mov    %rax,-0x8(%rbp)
    0x00007ffff7ff03c2:	48 8b 55 f8	mov    -0x8(%rbp),%rdx
    0x00007ffff7ff03c6:	48 b8 9d 9d bc f7 ff 7f 00 00	movabs 
$0x7ffff7bc9d9d,%rax
    0x00007ffff7ff03d0:	ff d0	callq  *%rax
    0x00007ffff7ff03d2:	48 89 45 f8	mov    %rax,-0x8(%rbp)
    0x00007ffff7ff03d6:	48 b8 68 50 f8 f7 ff 7f 00 00	movabs 
$0x7ffff7f85068,%rax
    0x00007ffff7ff03e0:	48 89 85 70 ff ff ff	mov    %rax,-0x90(%rbp)
    0x00007ffff7ff03e7:	48 8b bd 70 ff ff ff	mov    -0x90(%rbp),%rdi
    0x00007ffff7ff03ee:	48 8b 75 a8	mov    -0x58(%rbp),%rsi
    0x00007ffff7ff03f2:	48 b8 b0 ad b8 f7 ff 7f 00 00	movabs 
$0x7ffff7b8adb0,%rax
    0x00007ffff7ff03fc:	ff d0	callq  *%rax
    0x00007ffff7ff03fe:	48 89 c2	mov    %rax,%rdx
    0x00007ffff7ff0401:	48 89 45 a8	mov    %rax,-0x58(%rbp)
    0x00007ffff7ff0405:	48 8b 45 f8	mov    -0x8(%rbp),%rax
    0x00007ffff7ff0409:	48 89 50 38	mov    %rdx,0x38(%rax)
    0x00007ffff7ff040d:	48 8b 55 f8	mov    -0x8(%rbp),%rdx
    0x00007ffff7ff0411:	48 8b 45 a0	mov    -0x60(%rbp),%rax
    0x00007ffff7ff0415:	f6 c0 01	test   $0x1,%al
    0x00007ffff7ff0418:	75 14	jne    0x7ffff7ff042e
    0x00007ffff7ff041a:	f7 c0 f8 ff ff ff	test   $0xfffffff8,%eax
    0x00007ffff7ff0420:	74 0c	je     0x7ffff7ff042e


2013-10-11  Reini Urban  <rurban@cpanel.net>

	* disasm.c (dump_insns): Remove spacer = " "


-- 
Reini

[-- Attachment #2: 0001-disasm.c-dump_insns-Remove-spacer.patch --]
[-- Type: text/x-patch, Size: 830 bytes --]

From 9825d8619f4b74ebbc572ae8d240ce46ac0225de Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@cpanel.net>
Date: Fri, 11 Oct 2013 11:18:04 -0500
Subject: [PATCH] disasm.c (dump_insns): Remove spacer = " "

Improve disassemble/r readability
---
 gdb/disasm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gdb/disasm.c b/gdb/disasm.c
index e643c2d..d1ba103 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -169,7 +169,6 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
                 (*di->memory_error_func) (status, old_pc, di);
               fprintf_filtered (opcode_stream, "%s%02x",
                                 spacer, (unsigned) data);
-              spacer = " ";
             }
           ui_out_field_stream (uiout, "opcodes", opcode_stream);
           ui_out_text (uiout, "\t");
-- 
1.8.4.rc3


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Disassembly readability (/r no spaces) [2]
  2013-10-11 16:19 [PATCH] Disassembly readability (/r no spaces) Reini Urban
@ 2013-10-11 17:01 ` Reini Urban
  2013-10-14  9:39   ` Andrew Burgess
  0 siblings, 1 reply; 4+ messages in thread
From: Reini Urban @ 2013-10-11 17:01 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 7863 bytes --]

On 10/11/2013 11:19 AM, Reini Urban wrote:
> Attached patch improves disassemble/r readability

I disliked my first patch a bit.

The second attempt aligns the opcodes to max 10 byte insn

1st patch:
(gdb) disassemble /r 0x7ffff7ff0000,0x7ffff7ff0f00
Dump of assembler code from 0x7ffff7ff0000 to 0x7ffff7ff0f00:
    0x00007ffff7ff0000:	55           	push   %rbp
    0x00007ffff7ff0001:	4889e5         	mov    %rsp,%rbp
    0x00007ffff7ff0004:	4881ecc0000000     	sub    $0xc0,%rsp
    0x00007ffff7ff000b:	4889bd70ffffff     	mov    %rdi,-0x90(%rbp)
    0x00007ffff7ff0012:	4889b568ffffff     	mov    %rsi,-0x98(%rbp)
    0x00007ffff7ff0019:	48899560ffffff     	mov    %rdx,-0xa0(%rbp)
    0x00007ffff7ff0020:	488955f8        	mov    %rdx,-0x8(%rbp)
    0x00007ffff7ff0024:	48b80000000000000000  	movabs $0x0,%rax
    0x00007ffff7ff002e:	488945d8        	mov    %rax,-0x28(%rbp)
    0x00007ffff7ff0032:	48b80000000000000000  	movabs $0x0,%rax
    0x00007ffff7ff003c:	488945d0        	mov    %rax,-0x30(%rbp)
    0x00007ffff7ff0040:	48b80000000000000000  	movabs $0x0,%rax
...
2nd patch:
(gdb) disassemble/r 0x7ffff7ff0000,0x7ffff7ff0f00
Dump of assembler code from 0x7ffff7ff0000 to 0x7ffff7ff0f00:
    0x00007ffff7ff0000:	55                  	push   %rbp
    0x00007ffff7ff0001:	4889e5              	mov    %rsp,%rbp
    0x00007ffff7ff0004:	4881ecc0000000      	sub    $0xc0,%rsp
    0x00007ffff7ff000b:	4889bd70ffffff      	mov    %rdi,-0x90(%rbp)
    0x00007ffff7ff0012:	4889b568ffffff      	mov    %rsi,-0x98(%rbp)
    0x00007ffff7ff0019:	48899560ffffff      	mov    %rdx,-0xa0(%rbp)
    0x00007ffff7ff0020:	488955f8            	mov    %rdx,-0x8(%rbp)
    0x00007ffff7ff0024:	48b80000000000000000 	movabs $0x0,%rax
    0x00007ffff7ff002e:	488945d8            	mov    %rax,-0x28(%rbp)
    0x00007ffff7ff0032:	48b80000000000000000 	movabs $0x0,%rax
    0x00007ffff7ff003c:	488945d0            	mov    %rax,-0x30(%rbp)
    0x00007ffff7ff0040:	48b80000000000000000 	movabs $0x0,%rax
    0x00007ffff7ff004a:	488945c8            	mov    %rax,-0x38(%rbp)
    0x00007ffff7ff004e:	48b80000000000000000 	movabs $0x0,%rax
    0x00007ffff7ff0058:	488945c0            	mov    %rax,-0x40(%rbp)
    0x00007ffff7ff005c:	48b80000000000000000 	movabs $0x0,%rax
    0x00007ffff7ff0066:	488945b8            	mov    %rax,-0x48(%rbp)
    0x00007ffff7ff006a:	48b80000000000000000 	movabs $0x0,%rax
...

> Rationale:
>
> compare this libudis64 output:
> 0x7ffff7fb88e9 0xcc1 488945e8                     mov %rax, -0x18(%rbp)
> 0x7ffff7fb88ed 0xcc5 488b45f0                     mov -0x10(%rbp), %rax
> 0x7ffff7fb88f1 0xcc9 488b4038                     mov 0x38(%rax), %rax
> 0x7ffff7fb88f5 0xccd 488945f0                     mov %rax, -0x10(%rbp)
> 0x7ffff7fb88f9 0xcd1 813805002500                 cmp $0x250005, (%rax)
> 0x7ffff7fb88ff 0xcd7 741e                         jz 0xcf7
> 0x7ffff7fb8901 0xcd9 488b45f0                     mov -0x10(%rbp), %rax
> 0x7ffff7fb8905 0xcdd 488945e8                     mov %rax, -0x18(%rbp)
> 0x7ffff7fb8909 0xce1 488bbd70ffffff               mov -0x90(%rbp), %rdi
> 0x7ffff7fb8910 0xce8 488b75f0                     mov -0x10(%rbp), %rsi
> 0x7ffff7fb8914 0xcec 48b84a9fb8f7ff7f0000         mov $0x7ffff7b89f4a, %rax
> 0x7ffff7fb891e 0xcf6 ffd0                         call *%rax
> 0x7ffff7fb8920 0xcf8 eb04                         jmp 0xcfe
> 0x7ffff7fb8922 0xcfa 488b45f0                     mov -0x10(%rbp), %rax
> 0x7ffff7fb8926 0xcfe 488b4008                     mov 0x8(%rax), %rax
> 0x7ffff7fb892a 0xd02 488bbd70ffffff               mov -0x90(%rbp), %rdi
> 0x7ffff7fb8931 0xd09 488b75f0                     mov -0x10(%rbp), %rsi
> 0x7ffff7fb8935 0xd0d 488b55e8                     mov -0x18(%rbp), %rdx
> 0x7ffff7fb8939 0xd11 ffd0                         call *%rax
> 0x7ffff7fb893b 0xd13 488945f0                     mov %rax, -0x10(%rbp)
> 0x7ffff7fb893f 0xd17 488bbd70ffffff               mov -0x90(%rbp), %rdi
> 0x7ffff7fb8946 0xd1e 488b75f8                     mov -0x8(%rbp), %rsi
> 0x7ffff7fb894a 0xd22 488b55f0                     mov -0x10(%rbp), %rdx
> 0x7ffff7fb894e 0xd26 48b8f6f1baf7ff7f0000         mov $0x7ffff7baf1f6, %rax
> 0x7ffff7fb8958 0xd30 ffd0                         call *%rax
> 0x7ffff7fb895a 0xd32 488945f8                     mov %rax, -0x8(%rbp)
> 0x7ffff7fb895e 0xd36 488b45f8                     mov -0x8(%rbp), %rax
> 0x7ffff7fb8962 0xd3a c9                           leave
> 0x7ffff7fb8963 0xd3b c3                           ret
>
> against the current gdb output:
>     0x00007ffff7ff035b:    f7 c0 f8 ff ff ff    test   $0xfffffff8,%eax
>     0x00007ffff7ff0361:    74 0c    je     0x7ffff7ff036f
>     0x00007ffff7ff0363:    81 38 04 00 25 00    cmpl   $0x250004,(%rax)
>     0x00007ffff7ff0369:    75 04    jne    0x7ffff7ff036f
>     0x00007ffff7ff036b:    48 89 50 08    mov    %rdx,0x8(%rax)
>     0x00007ffff7ff036f:    48 89 55 b0    mov    %rdx,-0x50(%rbp)
>     0x00007ffff7ff0373:    48 b8 6f 00 00 00 00 00 00 00    movabs
> $0x6f,%rax
>     0x00007ffff7ff037d:    48 89 45 f8    mov    %rax,-0x8(%rbp)
>     0x00007ffff7ff0381:    48 8b 55 f8    mov    -0x8(%rbp),%rdx
>     0x00007ffff7ff0385:    48 8b 45 a8    mov    -0x58(%rbp),%rax
>     0x00007ffff7ff0389:    f6 c0 01    test   $0x1,%al
>     0x00007ffff7ff038c:    75 14    jne    0x7ffff7ff03a2
>     0x00007ffff7ff038e:    f7 c0 f8 ff ff ff    test   $0xfffffff8,%eax
>     0x00007ffff7ff0394:    74 0c    je     0x7ffff7ff03a2
>     0x00007ffff7ff0396:    81 38 04 00 25 00    cmpl   $0x250004,(%rax)
>     0x00007ffff7ff039c:    75 04    jne    0x7ffff7ff03a2
>     0x00007ffff7ff039e:    48 89 50 08    mov    %rdx,0x8(%rax)
>     0x00007ffff7ff03a2:    48 89 55 a8    mov    %rdx,-0x58(%rbp)
>     0x00007ffff7ff03a6:    48 8b bd 70 ff ff ff    mov    -0x90(%rbp),%rdi
>     0x00007ffff7ff03ad:    48 8b b5 68 ff ff ff    mov    -0x98(%rbp),%rsi
>     0x00007ffff7ff03b4:    48 b8 03 00 00 00 00 00 00 00    movabs
> $0x3,%rax
>     0x00007ffff7ff03be:    48 89 45 f8    mov    %rax,-0x8(%rbp)
>     0x00007ffff7ff03c2:    48 8b 55 f8    mov    -0x8(%rbp),%rdx
>     0x00007ffff7ff03c6:    48 b8 9d 9d bc f7 ff 7f 00 00    movabs
> $0x7ffff7bc9d9d,%rax
>     0x00007ffff7ff03d0:    ff d0    callq  *%rax
>     0x00007ffff7ff03d2:    48 89 45 f8    mov    %rax,-0x8(%rbp)
>     0x00007ffff7ff03d6:    48 b8 68 50 f8 f7 ff 7f 00 00    movabs
> $0x7ffff7f85068,%rax
>     0x00007ffff7ff03e0:    48 89 85 70 ff ff ff    mov    %rax,-0x90(%rbp)
>     0x00007ffff7ff03e7:    48 8b bd 70 ff ff ff    mov    -0x90(%rbp),%rdi
>     0x00007ffff7ff03ee:    48 8b 75 a8    mov    -0x58(%rbp),%rsi
>     0x00007ffff7ff03f2:    48 b8 b0 ad b8 f7 ff 7f 00 00    movabs
> $0x7ffff7b8adb0,%rax
>     0x00007ffff7ff03fc:    ff d0    callq  *%rax
>     0x00007ffff7ff03fe:    48 89 c2    mov    %rax,%rdx
>     0x00007ffff7ff0401:    48 89 45 a8    mov    %rax,-0x58(%rbp)
>     0x00007ffff7ff0405:    48 8b 45 f8    mov    -0x8(%rbp),%rax
>     0x00007ffff7ff0409:    48 89 50 38    mov    %rdx,0x38(%rax)
>     0x00007ffff7ff040d:    48 8b 55 f8    mov    -0x8(%rbp),%rdx
>     0x00007ffff7ff0411:    48 8b 45 a0    mov    -0x60(%rbp),%rax
>     0x00007ffff7ff0415:    f6 c0 01    test   $0x1,%al
>     0x00007ffff7ff0418:    75 14    jne    0x7ffff7ff042e
>     0x00007ffff7ff041a:    f7 c0 f8 ff ff ff    test   $0xfffffff8,%eax
>     0x00007ffff7ff0420:    74 0c    je     0x7ffff7ff042e
>
>
> 2013-10-11  Reini Urban  <rurban@cpanel.net>
>
>      * disasm.c (dump_insns): Remove spacer = " "
>

2013-10-11  Reini Urban  <rurban@cpanel.net>

     * disasm.c (dump_insns): Remove spacer = " "
       Align opcodes to max 10 byte insn

[Disclaimer: The views expressed in this letter are my own, and do not 
represent those of my employer.]
-- 
Reini

Working towards a true Modern Perl.
Slim, functional, unbloated, compile-time optimizable

[-- Attachment #2: 0001-disasm.c-dump_insns-Remove-spacer-2.patch --]
[-- Type: text/x-patch, Size: 1741 bytes --]

From 0eec915497f7845d60a0ce97405dabb860620b33 Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@cpanel.net>
Date: Fri, 11 Oct 2013 11:18:04 -0500
Subject: [PATCH] disasm.c (dump_insns): Remove spacer = " "

Improve disassemble/r readability
Align opcodes to max 10 byte insn
---
 gdb/disasm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gdb/disasm.c b/gdb/disasm.c
index e643c2d..b34800d 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -153,7 +153,7 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
           CORE_ADDR old_pc = pc;
           bfd_byte data;
           int status;
-          const char *spacer = "";
+          int space;
 
           /* Build the opcodes using a temporary stream so we can
              write them out in a single go for the MI.  */
@@ -162,15 +162,16 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
             make_cleanup_ui_file_delete (opcode_stream);
 
           pc += gdbarch_print_insn (gdbarch, pc, di);
+          space = pc - old_pc;
           for (;old_pc < pc; old_pc++)
             {
               status = (*di->read_memory_func) (old_pc, &data, 1, di);
               if (status != 0)
                 (*di->memory_error_func) (status, old_pc, di);
-              fprintf_filtered (opcode_stream, "%s%02x",
-                                spacer, (unsigned) data);
-              spacer = " ";
+              fprintf_filtered (opcode_stream, "%02x", (unsigned) data);
             }
+          fprintf_filtered (opcode_stream, "%*s",
+                            space > 10 ? 1 : 20 -(space*2), " ");
           ui_out_field_stream (uiout, "opcodes", opcode_stream);
           ui_out_text (uiout, "\t");
 
-- 
1.8.4.rc3


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Disassembly readability (/r no spaces) [2]
  2013-10-11 17:01 ` [PATCH] Disassembly readability (/r no spaces) [2] Reini Urban
@ 2013-10-14  9:39   ` Andrew Burgess
  2013-10-14 16:00     ` Reini Urban
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Burgess @ 2013-10-14  9:39 UTC (permalink / raw)
  To: gdb-patches; +Cc: Reini Urban

On 11/10/2013 6:01 PM, Reini Urban wrote:
> On 10/11/2013 11:19 AM, Reini Urban wrote:
>> Attached patch improves disassemble/r readability
> 
> 
> 2013-10-11  Reini Urban  <rurban@cpanel.net>
> 
>     * disasm.c (dump_insns): Remove spacer = " "
>       Align opcodes to max 10 byte insn
> 

For x86 the current style, a space between every byte, matches the style
used by objdump, which might be the most familiar to users.

I think what we should really be doing is using the bytes_per_chunk
field of the disassemble_info structure in the same way objdump does so
we always group bytes in a similar way, matching the objdump style seems
like a good idea to me unless there's a compelling reason not to.

The aligning of instruction text does seem like a good idea though, and
would match the objdump behaviour.

Thanks,
Andrew




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Disassembly readability (/r no spaces) [2]
  2013-10-14  9:39   ` Andrew Burgess
@ 2013-10-14 16:00     ` Reini Urban
  0 siblings, 0 replies; 4+ messages in thread
From: Reini Urban @ 2013-10-14 16:00 UTC (permalink / raw)
  To: Andrew Burgess, gdb-patches

On 10/14/2013 04:39 AM, Andrew Burgess wrote:
> On 11/10/2013 6:01 PM, Reini Urban wrote:
>> On 10/11/2013 11:19 AM, Reini Urban wrote:
>>> Attached patch improves disassemble/r readability
>>
>>
>> 2013-10-11  Reini Urban  <rurban@cpanel.net>
>>
>>      * disasm.c (dump_insns): Remove spacer = " "
>>        Align opcodes to max 10 byte insn
>>
>
> For x86 the current style, a space between every byte, matches the style
> used by objdump, which might be the most familiar to users.
>
> I think what we should really be doing is using the bytes_per_chunk
> field of the disassemble_info structure in the same way objdump does so
> we always group bytes in a similar way, matching the objdump style seems
> like a good idea to me unless there's a compelling reason not to.
>
> The aligning of instruction text does seem like a good idea though, and
> would match the objdump behaviour.

I see but I disagree with objdump.
I'lll try convincing binutils then :)

[Disclaimer: The views expressed in this letter are my own, and do not 
represent those of my employer.]
-- 
Reini

Working towards a true Modern Perl.
Slim, functional, unbloated, compile-time optimizable

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-14 16:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-11 16:19 [PATCH] Disassembly readability (/r no spaces) Reini Urban
2013-10-11 17:01 ` [PATCH] Disassembly readability (/r no spaces) [2] Reini Urban
2013-10-14  9:39   ` Andrew Burgess
2013-10-14 16:00     ` Reini Urban

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).