[PATCH 3/5] addr2line: Add -a, --address. Print address before for each entry.
Roland McGrath
roland at hack.frob.com
Wed May 20 18:22:50 UTC 2015
> 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%".
More information about the elfutils-devel
mailing list