[llvm-commits] [PATCH] llvm-symbolizer: symbolize global variables

Dmitry Vyukov dvyukov at google.com
Thu Jan 10 04:25:31 PST 2013


  >  Regarding eugenis@ suggestion: I think that adding "explicit" keyword is probably fine (I don't like CAPS, though). But we should be able to do a "best effort" in case it's not provided - we may either try to symbolize address assuming it's in .text, and if we fail, try .data, or do smth better like actually looking at where these sections are (it's not really portable and, yes, have problems with tls).


  It will complicate code and won't be used. Moreover, caller won't know how to parse it. Let's don't do that.


  ================
  Comment at: tools/llvm-symbolizer/llvm-symbolizer.cpp:141
  @@ +140,3 @@
  +                     uint64_t &Start, uint64_t &Size) const {
  +    return getNameFromSymbolTable(SymbolRef::ST_Data,
  +                                  ModuleOffset, Name, Start, Size);
  ----------------
  There is a UseSymbolTable option, which may be used here (if it's false, just don't access it). In this case, the comment for this option should be changed accordingly.


  Done


  ================
  Comment at: tools/llvm-symbolizer/llvm-symbolizer.cpp:305
  @@ +304,3 @@
  +static void symbolizeData(std::string ModuleName, std::string ModuleOffsetStr) {
  +  std::string Name = "??";
  +  uint64_t Start = 0;
  ----------------
  There is kSymbolizerBadString already defined in other function.


  Done


  ================
  Comment at: tools/llvm-symbolizer/llvm-symbolizer.cpp:314
  @@ +313,3 @@
  +        int status = 0;
  +        char *DemangledName = __cxa_demangle(Name.c_str(), 0, 0, &status);
  +        if (status == 0) {
  ----------------
  You would need to #ifdef-guard this code on platforms which don't have __cxa_demangle.


  Done

Hi kcc, samsonov, eugenis,

http://llvm-reviews.chandlerc.com/D277

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D277?vs=653&id=655#toc

Files:
  tools/llvm-symbolizer/llvm-symbolizer.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D277.2.patch
Type: text/x-patch
Size: 7500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130110/ccf48120/attachment.bin>


More information about the llvm-commits mailing list