[PATCH] D65537: Print reasonable representations of type names in llvm-nm, readelf and readobj.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 02:28:49 PDT 2019


jhenderson added inline comments.


================
Comment at: lib/Object/ELFObjectFile.cpp:54
+    {"Proc Specific 14", "<processor specific>: 14", 14},
+    {"Proc Specific 15", "<processor specific>: 15", 15}
+};
----------------
Sunil_Srivastava wrote:
> grimar wrote:
> > It looks a bit confusing to me. When I see "Unknown 7" it looks like its a 7th `Unknown`.
> > What do you think about hte following format?
> > 
> > ```
> >     {"Unknown(7)", "<unknown>(7)", 7},
> >     {"Unknown(8)", "<unknown>(8)", 8},
> >     {"Unknown(9)", "<unknown>(9)", 9},
> >     {"OS Specific(11)", "<OS specific>(11)", 11},
> >     {"OS Specific(12)", "<OS specific>(12)", 12},
> >     {"Proc Specific(13)", "<processor specific>(13)", 13},
> >     {"Proc Specific(14)", "<processor specific>(14)", 14},
> >     {"Proc Specific(15)", "<processor specific>(15)", 15}
> > 
> > ```
> I am open to any format for the first column; whatever the consensus is.
> 
> The second column comes from what the GNU nm prints, so that has to remain "<unknown>: 7", even with the inconsistent styles between 7, 11 and 13.
I forgot this, but as demonstrated by your test, a typical symbol type output for a symbol in LLVM output style is "Section (0x3)". I don't think we want to repeat the number, and I therefore think simply printing "Unknown"/"OS Specific" etc in the first column is sufficient - the rest of the code then will append the "(0x7)" or whatever. In other words, the entries should be 3 "Unknown" strings, 2 "OS Specific" and 3 "Proc Specific".


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65537/new/

https://reviews.llvm.org/D65537





More information about the llvm-commits mailing list