summaryrefslogtreecommitdiff
path: root/tools/llvm-symbolizer
Commit message (Collapse)AuthorAge
* Convert a few methods to use ErrorOr.Rafael Espindola2014-06-23
| | | | | | | It used to be inconvenient to mix ErrorOr and UniquePtr, but with c++11 they work OK together. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211532 91177308-0d34-0410-b5e6-96231b3b80d8
* Finishing touch for the std::error_code transition.Rafael Espindola2014-06-13
| | | | | | | | | | | While std::error_code itself seems to work OK in all platforms, there are few annoying differences with regards to the std::errc enumeration. This patch adds a simple llvm enumeration, which will hopefully avoid build breakages in other platforms and surprises as we get more uses of std::error_code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210920 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210876 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-12
| | | | | | This should make sure that most new uses use the std prefix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210835 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this patch is to turn llvm/Support/system_error.h into a transitional header that just brings in the erorr_code api to the llvm namespace. I will remove it shortly afterwards. The cases where the general idea needed some tweaking: * std::errc is a namespace in msvc, so we cannot use "using std::errc". I could add an #ifdef, but there were not that many uses, so I just added std:: to them in this patch. * Template specialization had to be moved to the std namespace in this patch set already. * The msvc implementation of default_error_condition doesn't seem to provide the same transformations as we need. Not too surprising since the standard doesn't actually say what "equivalent" means. I fixed the problem by keeping our old mapping and using it at error_code construction time. Despite these shortcomings I think this is still a good thing. Some reasons: * The different implementations of system_error might improve over time. * It removes 925 lines of code from llvm already. * It removes 6313 bytes from the text segment of the clang binary when it is built with gcc and 2816 bytes when building with clang and libstdc++. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210687 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF parser] Teach DIContext to fetch short (non-linkage) function names ↵Alexey Samsonov2014-05-17
| | | | | | | | | | | for a given address. Change --functions option in llvm-symbolizer tool to accept values "none", "short" or "linkage". Update the tests and docs accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209050 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF parser] Use enums instead of bitfields in DILineInfoSpecifier.Alexey Samsonov2014-05-15
| | | | | | | | | | | | | It is more appropriate than the current situation, when one flag (AbsoluteFilePath) is relevant only if another flag is set. This refactoring would also simplify fetching the short function name (stored in DW_AT_name) instead of a linkage name returned currently. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208921 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++] Use 'nullptr'. Tools edition.Craig Topper2014-04-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207176 91177308-0d34-0410-b5e6-96231b3b80d8
* Use unique_ptr to manage ParsedBinariesAndObjects in LLVMSymbolizerDavid Blaikie2014-04-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206866 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF parser] Turn DILineInfo into a struct.Alexey Samsonov2014-04-18
| | | | | | | | | | | Immutable DILineInfo doesn't bring any benefits and complicates code. Also, use std::string instead of SmallString<16> for file and function names - their length can vary significantly. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206654 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Introduce ObjectFile::symbols() to use range-based loops.Alexey Samsonov2014-03-17
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3081 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204031 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use ObjectFile::sections() in commandline llvm toolsAlexey Samsonov2014-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203802 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-06
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203083 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202957 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: use dynamic symbol table if the regular one is stripped.Alexey Samsonov2014-02-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202265 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola2014-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201108 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the handling of iterators in ObjectFile.Rafael Espindola2014-01-30
| | | | | | | | | | | | None of the object file formats reported error on iterator increment. In retrospect, that is not too surprising: no object format stores symbols or sections in a linked list or other structure that requires chasing pointers. As a consequence, all error checking can be done on begin() and end(). This reduces the text segment of bin/llvm-readobj in my machine from 521233 to 518526 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200442 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: make mangled name heuristic apply to all symbolsEd Maste2014-01-16
| | | | | | | | PR: http://llvm.org/pr18431 Review: http://llvm-reviews.chandlerc.com/D2552 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199404 91177308-0d34-0410-b5e6-96231b3b80d8
* Return an ErrorOr<Binary *> from createBinary.Rafael Espindola2014-01-15
| | | | | | | | I did write a version returning ErrorOr<OwningPtr<Binary> >, but it is too cumbersome to use without std::move. I will keep the patch locally and submit when we switch to c++11. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199326 91177308-0d34-0410-b5e6-96231b3b80d8
* Check the error code and save a call to sys::fs::exists.Rafael Espindola2014-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199293 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-sort #include lines again, prior to moving headers around.Chandler Carruth2014-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199080 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: add --obj flag to specify a single object file that should ↵Alexey Samsonov2013-12-24
| | | | | | be symbolized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197988 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.NAKAMURA Takumi2013-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196908 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: don't always run demangler on global object namesAlexey Samsonov2013-10-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192781 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: use real path when looking for debug binary locationAlexey Samsonov2013-08-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189250 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: add support for .gnu_debuglink sectionAlexey Samsonov2013-08-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188386 91177308-0d34-0410-b5e6-96231b3b80d8
* LLVMSymbolize.cpp: Fix build. Triple::ArchType is not a namespace.NAKAMURA Takumi2013-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186494 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: be more careful with colons in file namesAlexey Samsonov2013-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186493 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: Recognize a drive letter on win32. Then "REQUIRES: shell" ↵NAKAMURA Takumi2013-07-01
| | | | | | | | can be removed. FIXME: Could we use llvm::sys::Path here? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185322 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: don't leave dangling pointers after flushing ↵Alexey Samsonov2013-06-28
| | | | | | LLVMSymbolizer. Add a destructor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185154 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: skip leading underscore in Mach-O symbol table entriesAlexey Samsonov2013-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185151 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: make name demangling a public static method of LLVMSymbolizerAlexey Samsonov2013-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185143 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: add support for Mach-O universal binariesAlexey Samsonov2013-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185137 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-symbolizer] rewrite r183213 in a more clear wayAlexey Samsonov2013-06-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183526 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-symbolizer] Avoid calling slow getSymbolSize for Mach-O files. Assume ↵Alexey Samsonov2013-06-04
| | | | | | that symbols with zero size are in fact large enough. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183213 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct handling invalid filename in llvm-symbolizerAlexey Samsonov2013-06-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183102 91177308-0d34-0410-b5e6-96231b3b80d8
* At Jim Grosbach's request detemplate Object/MachO.h.Rafael Espindola2013-04-18
| | | | | | | We are still able to handle mixed endian objects by swapping one struct at a time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179778 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert MachOObjectFile to a template.Rafael Espindola2013-04-09
| | | | | | | For now it is templated only on being 64 or 32 bits. I will add little/big endian next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179097 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: correctly parse filenames given in quotesAlexey Samsonov2013-04-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178859 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for r177390: map values are pointers, use DeleteContainerSeconds() ↵Alexey Samsonov2013-03-19
| | | | | | instead of .clear() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177409 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: flush internal caches functionalityDmitry Vyukov2013-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177390 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-formatize llvm-symbolizer codeAlexey Samsonov2013-02-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175255 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: speedup symbol lookupDmitry Vyukov2013-02-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175158 91177308-0d34-0410-b5e6-96231b3b80d8
* Print error messages from MemoryBuffer::getFile() in llvm-symbolizerAlexey Samsonov2013-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174346 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace global std::string with const char[]Alexey Samsonov2013-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174332 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: factor out bits of the tool into separate ↵Alexey Samsonov2013-01-22
| | | | | | LLVMSymbolize.{h,cpp} files. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173159 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-symbolizer: add DATA command that allows to symbolize global variables.Dmitry Vyukov2013-01-11
| | | | | | | | | | | | Example: >DATA bin/clang 0x26e8e40 <llvm::SparcSubTypeKV <40799808 416 The last line is address and size of the object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172180 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for tools/...Chandler Carruth2012-12-04
| | | | | | | | Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169252 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite DIContext interface to take an object. Update all callers.Eric Christopher2012-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167757 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use __cxa_demangle under MSVC (which doesn't have it)Alexander Potapenko2012-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167730 91177308-0d34-0410-b5e6-96231b3b80d8