This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH 3/5] addr2line: Add -a, --address. Print address before for each entry.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 20 May 2015 11:22:50 -0700
- Subject: Re: [PATCH 3/5] addr2line: Add -a, --address. Print address before for each entry.
> static int
> +get_addr_width (Dwfl_Module *mod)
> +{
> + // Try to find the address wide if possible.
s/wide/width/
> + if (width == 0 && mod)
mod != NULL please, and other cases like that below.
> + if (print_addresses)
> + {
> + int width = get_addr_width (mod);
> + printf ("0x%0*" PRIx64 "\n", width, addr);
> + }
I tend to prefer %.* though it has the same effect for hex. I also tend to
prefer %# to 0x%. IIRC, that includes the 0x in the width but not in the
precision, so "%#.*" PRIx64 is probably best. The only real difference is
0x0 vs 0, but for some reason I really hate seeing "0x%".