This is the mail archive of the elfutils-devel@sourceware.org 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 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%".


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