This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Re: [patch] Print register names also for DWARF loc/expr


On Fri, Jul 23, 2010 at 10:37:10AM +0200, Jan Kratochvil wrote:
> currently this DWARF (~ELF) output is perfectly readable:
> 	Contents of the .eh_frame section:
> 	  DW_CFA_offset: r3 (rbx) at cfa-40
> 	  DW_CFA_offset: r6 (rbp) at cfa-32
> 
> But this variant of output has still difficult to parse numbers->registers:
> Contents of the .debug_loc section:
>     Offset   Begin    End      Expression
>     000002d4 00000000004015d5 00000000004015d9 (DW_OP_breg0: 0; DW_OP_lit3; DW_OP_shl; DW_OP_breg3: 0; DW_OP_plus; DW_OP_plus_uconst: 8)
>     000002d4 00000000004015d9 0000000000401622 (DW_OP_reg6)
>     000002d4 <End of list>
>     <fc1>   DW_AT_location    : 1 byte block: 55        (DW_OP_reg5)
> 
> Provided patch will print instead:
>     Offset   Begin    End      Expression
>     000002d4 00000000004015d5 00000000004015d9 (DW_OP_breg0: (rax) 0; DW_OP_lit3; DW_OP_shl; DW_OP_breg3: (rbx) 0; DW_OP_plus; DW_OP_plus_uconst: 8)
>     000002d4 00000000004015d9 0000000000401622 (DW_OP_reg6 (rbp))
>     000002d4 <End of list>
>     <fc1>   DW_AT_location    : 1 byte block: 55        (DW_OP_reg5 (rdi))

I think it would be nicer if DW_OP_bregN printed the register name
before : instead of after it, so
DW_OP_breg0 (rax): 0
instead of
DW_OP_breg0: (rax) 0
because the register is part of the opcode, rather than its operand.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]