This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
There's an incorrect text alignment in GDB 5.3 and 5.0 (probably others) that causes the instruction in first line of the disassembly text to be incorrectly aligned with the others, if the function name is less than 3 characters long (and in some other cases). ... int fa(int a) { return 0; } ... (gdb) disas fa Dump of assembler code for function fa: 0x8048448 <fa>: push %ebp 0x8048449 <fa+1>: mov %esp,%ebp 0x804844b <fa+3>: mov $0x0,%eax 0x8048450 <fa+8>: pop %ebp 0x8048451 <fa+9>: ret 0x8048452 <fa+10>: mov %esi,%esi End of assembler dump. So, I've changed disassemble_command, print_address and print_symbolic_address in the gdb/printcmd.c and their prototypes in gdb/defs.h to get correct text alignment. After patching with text-align.patch (attached) the disassembly looks like this: (gdb) disas fa Dump of assembler code for function fa: 0x8048448 <fa>: push %ebp 0x8048449 <fa+1>: mov %esp,%ebp 0x804844b <fa+3>: mov $0x0,%eax 0x8048450 <fa+8>: pop %ebp 0x8048451 <fa+9>: ret 0x8048452 <fa+10>: mov %esi,%esi End of assembler dump. I've tested it for many functions and it seems to work OK. I should do the same for the case when we also print file names and line numbers, but I thought I'd better get a more informed opinion first. Hope this helps in some way, Please let me know if I need to change anything, Cornel
Attachment:
text-align.patch
Description: Fix incorrect text-alignment
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |