summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Mangled.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move classes from Core -> Utility.Zachary Turner2017-02-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
* Fix build for mingw.Hafiz Abid Qadeer2016-12-151-2/+2
| | | | | | | | | | | | Summary: I was building lldb using cross mingw-w64 toolchain on Linux and observed some issues. This is first patch in the series to fix that build. It mostly corrects the case of include files and adjusts some #ifdefs from _MSC_VER to _WIN32 and vice versa. I built lldb on windows with VS after applying this patch to make sure it does not break the build there. Reviewers: zturner, labath, abidh Subscribers: ki.stfu, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D27759 llvm-svn: 289821
* Convert some Args index-based iteration to range-style iteration.Zachary Turner2016-10-051-0/+10
| | | | | | | | | | | | | | This is better for a number of reasons. Mostly style, but also: 1) Signed-unsigned comparison warnings disappear since there is no loop index. 2) Iterating with the range-for style gives you back an entry that has more than just a const char*, so it's more efficient and more useful. 3) Makes code safter since the type system enforces that it's impossible to index out of bounds. llvm-svn: 283413
* Make lldb -Werror clean on Windows.Zachary Turner2016-10-051-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D25247 llvm-svn: 283344
* Use llvm's demangler.Rafael Espindola2016-09-071-2/+3
| | | | | | | LLVM now has a copy of libcxxabi demangler, so lldb doesn't need to keep one too. llvm-svn: 280821
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-318/+255
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Add cmake option to choose whether to use the builtin demanglerPavel Labath2016-08-261-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously the builting demangler was on for platforms that explicitly set a flag by modifying Mangled.cpp (windows, freebsd). The Xcode build always used builtin demangler by passing a compiler flag. This adds a cmake flag (defaulting to ON) to configure the demangling library used at build time. The flag is only available on non-windows platforms as there the system demangler is not present (in the form we're trying to use it, at least). The impact of this change is: - linux: switches to the builtin demangler - freebsd, windows: NFC (I hope) - netbsd: switches to the builtin demangler - osx cmake build: switches to the builtin demangler (matching the XCode build) The main motivation for this is the cross-platform case, where it should bring more consistency by removing the dependency on the host demangler (which can be completely unrelated to the debug target). Reviewers: zturner, emaste, krytarowski Subscribers: emaste, clayborg, lldb-commits Differential Revision: https://reviews.llvm.org/D23830 llvm-svn: 279808
* Delete Host/windows/win32.hZachary Turner2016-08-091-1/+1
| | | | | | | | | | | | | | | | | | | It's always hard to remember when to include this file, and when you do include it it's hard to remember what preprocessor check it needs to be behind, and then you further have to remember whether it's windows.h or win32.h which you need to include. This patch changes the name to PosixApi.h, which is more appropriately named, and makes it independent of any preprocessor setting. There's still the issue of people not knowing when to include this, because there's not a well-defined set of things it exposes other than "whatever is missing on Windows", but at least this should make it less painful to fix when problems arise. This patch depends on LLVM revision r278170. llvm-svn: 278177
* Add a new "lldb" log channel named "demangle". If we have crashes that are ↵Greg Clayton2016-05-271-0/+23
| | | | | | | | related to demangling, we now can enable this logging and we will be able to reproduce demangler crashes (usually due to overflowing the stack) without needing someone's project. <rdar://problem/25221899> llvm-svn: 270941
* Don't demangle a name when Mangled::GetName() is called with ePreferMangled. ↵Greg Clayton2015-12-171-6/+4
| | | | | | Only demangle if this isn't the the value for the "preference" argument indicating the user wants the demangled name. This will stop a lot of symbols from being demangled when parsing the symbol table in ObjectFileMachO. llvm-svn: 255864
* Rework breakpoint language filtering to use the symbol context's language.Dawn Perchik2015-12-161-2/+14
| | | | | | | | | | | | | | | | This patch reworks the breakpoint filter-by-language patch to use the symbol context instead of trying to guess the language solely from the symbol's name. This has the advantage that symbols compiled with debug info will have their actual language known. Symbols without debug info will still do the same "guess"ing because Symbol::GetLanguage() is implemented using Mangled::GuessLanguage(). The recognition of ObjC names was merged into Mangled::GuessLanguage. Reviewed by: jingham, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15326 llvm-svn: 255808
* Move more functionality from the LanguageRuntimes to the Languages.Jim Ingham2015-09-021-2/+2
| | | | llvm-svn: 246616
* Improve C++ function name handling and step-in avoid regerxp handlingTamas Berghammer2015-07-241-3/+4
| | | | | | | | | | | | | | | | | | | If the function is a template then the return type is part of the function name. This CL fixes the parsing of these function names in the case when the return type contains ':'. The name of free functions in C++ don't have context part. Fix the logic geting the function name without arguments out from a full function name to handle this case. Change the handling of step-in-avoid-regexp to match the value against the function name without it's arguments and return value. This is required because the default regex ("^std::") would match any template function returning an std object. Fifferential revision: http://reviews.llvm.org/D11461 llvm-svn: 243099
* Make many mangled functions that might demangle a name be allowed to specify ↵Greg Clayton2015-07-081-23/+19
| | | | | | a language to use in order to soon support Pascal and Java demangling. Dawn Perchik will take care of making this so. llvm-svn: 241751
* Add a GetDisplayName() API to SBFrame, SBFunction and SBSymbolEnrico Granata2015-07-061-0/+6
| | | | | | | | | | This API is currently a no-op (in the sense that it has the same behavior as the already existing GetName()), but is meant long-term to provide a best-for-visualization version of the name of a function It is still not hooked up to the command line 'bt' command, nor to the 'gui' mode, but I do have ideas on how to make that work going forward rdar://21203242 llvm-svn: 241482
* Fix linking issue after r241271 (dbghelp.lib was removed from default ↵Leny Kholodov2015-07-021-0/+1
| | | | | | dependencies on Windows) llvm-svn: 241278
* Add const qualifier to Mangled::GuessLanguageDawn Perchik2015-06-251-1/+1
| | | | llvm-svn: 240676
* Rename Mangled::GetLanguage to Mangled::GuessLanguageDawn Perchik2015-06-251-1/+1
| | | | | | | | | | | The language can not be definitively determined from the mangling, so this new name helps clarify that fact. This addresses the concerns raised in http://reviews.llvm.org/rL226962. Reviewed by: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10723 llvm-svn: 240662
* Fix a variety of typos.Bruce Mitchener2015-06-181-1/+1
| | | | | | No functional change. llvm-svn: 239995
* Resubmitting r238459 and r238460 with fix for Linux.Chaoren Lin2015-05-281-4993/+63
| | | | llvm-svn: 238499
* Revert "Move inlined cxa_demangle.cpp to a separate file."Ying Chen2015-05-281-2/+4953
| | | | | | This reverts commit 8cb47a2140f3e93a34597fc9f11c8cd96130076d. llvm-svn: 238497
* Revert "Allow both MSVC and Itanium mangling schemes."Ying Chen2015-05-281-61/+40
| | | | | | | | Cause build break. This reverts commit 6d986061393f2863fec739e04412281148acc1f3. llvm-svn: 238496
* Allow both MSVC and Itanium mangling schemes.Chaoren Lin2015-05-281-40/+61
| | | | | | | | | | | | | | | | | | | Summary: LLDB on Windows should now be able to demangle Linux/Android symbols. Also updated CxaDemangle.cpp to be compatible with MSVC. Depends on D9949, D9954, D10048. Reviewers: zturner, emaste, clayborg Reviewed By: clayborg Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D10040 llvm-svn: 238460
* Move inlined cxa_demangle.cpp to a separate file.Chaoren Lin2015-05-281-4953/+2
| | | | | | | | | | | | | | Summary: In preparation for some changes to make this compatible with MSVC. Reviewers: emaste, zturner, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9949 llvm-svn: 238459
* Bug 23051 - Fix build failure on Freebsd with gcc 4.9.Sylvestre Ledru2015-03-281-1/+1
| | | | | | Patch by Craig Rodrigues llvm-svn: 233478
* Adding the ability to get the language from a mangled name. This isn't used ↵Greg Clayton2015-01-231-0/+15
| | | | | | in the SVN LLDB, but will be used in another codebase based on the SVN LLDB. llvm-svn: 226962
* Fix a little thinko in r226017 - the code to actually add the demangled name ↵Jim Ingham2015-01-151-4/+6
| | | | | | | | | | | | | to the Mangled object got moved into the #else branch of the #if/#elif/#endif, so it wasn't getting done in the #if case anymore. Keep the code to add the demangled name outside of the #if, and then just free the demangled_name and set it back to NULL in the Windows case. <rdar://problem/19479499> llvm-svn: 226088
* Implement demangling on Windows.Zachary Turner2015-01-141-7/+22
| | | | llvm-svn: 226017
* Fix unused variable warning from r219544.Eric Christopher2014-10-101-1/+0
| | | | llvm-svn: 219547
* Add a new disassembly-format specification so that the disassemblerJason Molenda2014-10-101-0/+62
| | | | | | | | | | | | | | | | | | | | | output style can be customized. Change the built-in default to be more similar to gdb's disassembly formatting. The disassembly-format for a gdb-like output is ${addr-file-or-load} <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>: The disassembly-format for the lldb style output is {${function.initial-function}{${module.file.basename}`}{${function.name-without-args}}:\n}{${function.changed}\n{${module.file.basename}`}{${function.name-without-args}}:\n}{${current-pc-arrow} }{${addr-file-or-load}}: The two backticks in the lldb style formatter triggers the sub-expression evaluation in CommandInterpreter::PreprocessCommand() so you can't use that one as-is ... changing to use ' characters instead of ` would work around that. <rdar://problem/9885398> llvm-svn: 219544
* Mangled: Fix an 'unused variable' warning on GNU/LinuxDavid Majnemer2014-07-221-2/+1
| | | | | | | | | | Platforms which don't use LLDB's built-in demangler don't use the 'mangled_length' variable. Instead, replace it's only use by an expression it is equivalent to. Differential Revision: http://reviews.llvm.org/D4625 llvm-svn: 213681
* Dramatically improves C++ demangling performance by introducing a new ↵Kate Stone2014-07-221-2/+16
| | | | | | | | | | implementation that is much faster than the existing demangler. While not yet complete, the new demangler will fail gracefully when it encounters symbols it isn’t prepared to deal with. In these cases LLDB will fall back to using the full demangler to prevent a loss in functionality. On sizable code bases the fast path succeeds 95% of the time, providing a significant net win. The new implementation is located in source/Core/FastDemangle.cpp. It’s fairly straightforward C code with a few basic C++ extensions. It should compile with little or no change on a variety of platforms, but of course it is still only useful for symbols that comply with the Itanium ABI mangling spec (plus a few Clang extensions.) <rdar://problem/15397553> <rdar://problem/15794867> llvm-svn: 213671
* Improve LLDB's embedded C++ demangler by addressing the following two issues:Kate Stone2014-07-221-4/+5
| | | | | | | | 1) Preserve ref qualification state in a local variable while parsing a nested name. Previously, the state was recorded in the shared db reference and could therefore be overwritten when parsing multiple levels of nested names (e.g.: when a qualified name has qualified template args.) 2) Address an off-by-one error when testing whether or not a thunk is non-virtual. This resulted in the demangled identifying all thunks as non-virtual. llvm-svn: 213591
* Revert r205769 as it breaks the build on FreeBSD:Ed Maste2014-04-081-13/+7
| | | | | | | error: declaration of constexpr static data member 'spec' requires an initializer llvm-svn: 205776
* Improve demangler to compile with MSVC.Virgile Bello2014-04-081-7/+13
| | | | llvm-svn: 205769
* sweep up -Wformat warnings from gccSaleem Abdulrasool2014-04-041-1/+2
| | | | | | | This is a purely mechanical change explicitly casting any parameters for printf style conversion. This cleans up the warnings emitted by gcc 4.8 on Linux. llvm-svn: 205607
* Updated to latest and greatest demangler sources.Greg Clayton2014-01-231-1/+14
| | | | | | <rdar://problem/15736085> llvm-svn: 199946
* Pickup fixes for demangling crashers.Greg Clayton2013-12-121-18/+271
| | | | | | <rdar://problem/15600471> llvm-svn: 197171
* Fix MSVC buildColin Riley2013-11-201-1/+6
| | | | | | The demangler added in r193708 from cxa_demangle.cpp uses language features which are not supported by the latest visual studio. In order to preserve the msvc build, this patch restores the previous (non)functionality in windows under msvc by disabling the demangler. llvm-svn: 195254
* Added more details on the exact version of the cxa_demangle.cpp file for the ↵Greg Clayton2013-10-311-4/+12
| | | | | | built in demangler. This will help us track when we need to update this file. llvm-svn: 193784
* Use inlined demangler on FreeBSDEd Maste2013-10-311-1/+1
| | | | | | | | FreeBSD includes the elftoolchain project's demangler in the base system. It does not handle some unusual mangled names, so use the inlined libcxxabi one. llvm-svn: 193776
* <rdar://problem/15201312>Greg Clayton2013-10-301-4/+4683
| | | | | | | | | | Inlined a copy of cxa_demangle.cpp from: http://llvm.org/svn/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp For systems that don't have demangling built into the system, and for systems that don't want to use the version that is installed. Defining LLDB_USE_BUILTIN_DEMANGLER in your build system allows you to use the built in demangler. This setting is curently automatically enabled for Windows builds. llvm-svn: 193708
* Visual Studio 2013 compilation support: added some #ifdef _MSC_VER for ↵Virgile Bello2013-09-181-0/+6
| | | | | | unsupported code in MSVC. llvm-svn: 190924
* Remove lldb's custom copy of the C++ demangler, used only on MacJason Molenda2013-07-031-12/+0
| | | | | | | | OS X. Testsuite shows no change in results using the system runtime's demangler. <rdar://problem/12029914> llvm-svn: 185510
* Use C-style include to match style in file (instead of C++ style)Daniel Malea2013-05-311-1/+1
| | | | | | - as per review comment from Dimitry Andric! llvm-svn: 183039
* FreeBSD cmake build fixes.Daniel Malea2013-05-311-0/+1
| | | | | | | | | - missing #include <cstdlib> in Mangled.cpp - missing include dirs in FreeBSD CMakeLists.txt Patch by Ed Maste! llvm-svn: 183032
* Make size_t known before including cxxabi.h (FreeBSD fix)Filipe Cabecinhas2012-09-111-0/+2
| | | | llvm-svn: 163640
* <rdar://problem/12029894>Greg Clayton2012-08-061-2/+14
| | | | | | Use the built in demangler for Apple builds for now which has needed demangling fixes, and make the cxa_demangle.cpp use rtti in the Xcode project settings as it requires it be enabled. llvm-svn: 161323
* Pull in cxa_demangle.cpp/.h from llvm's libcxxabi project. Change the ↵Johnny Chen2012-08-041-0/+2
| | | | | | | | namespace to lldb_cxxabiv1 for the time being. Mangled.cpp is not wired in to call it yet. llvm-svn: 161293
* Cleaned up the lldb_private::Mangled class to get rid of the tokenizing code ↵Greg Clayton2012-07-181-522/+1
| | | | | | that has bit rotted and isn't being used. Also cleaned up the API to the "lldb_private::Mangled" to always take "const ConstString &" arguments instead of both "const ConstString &" and "const char *". llvm-svn: 160466
OpenPOWER on IntegriCloud