This is the mail archive of the mailing list for the elfutils 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] readelf.c: Use real output width [Re: [patch] Implement reglocs for s390/s390x]

> The "debug dump" I provided:
>     ebx:          21687<11:%11d>  ecx:          21689<11:%11d>  edx:              6<11:%11d>
>     esi:              0<11:%11d>  edi:     -143585292<11:%11d>  ebp:     0xf7562308<11: 0x%.8x>
>     eax:              0<11:%11d>  eip:     0xf774d430<11: 0x%.8x>  eflags:  0x00000296<11: 0x%.8x>
> shows both FORMAT_MAX and FORMAT used for each field:
> 	printf ("<%zu:%s>", format_max, format);
> One can see FORMAT "%11d" (or "0x %.8x") is enough to keep the output aligned,
> without the need for additional FORMAT_MAX.

I didn't see where that "11" was, but now I see you have it for the
register formats but not the item formats.  That's what confused me.

> In the case of si_signo/si_code:
>     info.si_signo: 6<11:%d>, info.si_code: 0<11:%d>, info.si_errno: 0<11:%d>, cursig: 6<6:%d>
> There is already just "%d" which also seems to match what we want.

Yes, it does seem to suffice for the non-register items that we actually have.

> I do not see any change now on the files I tried.

OK.  Then this change is OK with me.  

But I found the comment "... the FORMAT strings typically already contain
their maximum width" confusing/misleading when the non-register item
formats in fact do not do any padding.

> Then it will be sometimes unaligned.
> I really do not mind much, we got far away from the goal of upstreaming an
> unwinder.

Yes, but the issues in this are so much smaller and easier to decide! ;-)


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