summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Mangled.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* <rdar://problem/10998370>Greg Clayton2012-07-181-6/+91
| | | | | | | | Improved the error message when we can find a function in the current program by printing the demangled name. Also added the ability to create lldb_private::Mangled instances with a ConstString when we already have a ConstString for a mangled or demangled name. Also added the ability to call SetValue with a ConstString and also without a boolean to indicate if the string is mangled where we will now auto-detect if the string is mangled. llvm-svn: 160450
* Added new symbol types for Objective C classes, metaclasses, and ivars. EachGreg Clayton2011-12-031-19/+0
| | | | | | | | object file can correctly make these symbols which will abstract us from the file format and ABI and we can then ask for the objective C class symbol for a class and find out which object file it was defined in. llvm-svn: 145744
* I modified the StringMap that was being used to unique our debugger C stringsGreg Clayton2011-06-091-27/+3
| | | | | | | | | | | | | | to have the value for the map be a "const char *" instead of an unused uint32_t. This allows us to store the uniqued mangled/demangled counterpart in this map for mangled names. This also speeds up the mangled/demangled counterpart lookup that used to be maintained in a STL map by having direct access to the data. If we eventually need to associate other strings to strings to more data, we can make the value of the StringMap have a more complex value. Added the start of a history source and history event class. It isn't being used by anything yet, but might be shortly. llvm-svn: 132813
* Did some work on the "register read" command to only show the first registerGreg Clayton2011-04-221-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set by default when dumping registers. If you want to see all of the register sets you can use the "--all" option: (lldb) register read --all If you want to just see some register sets, you can currently specify them by index: (lldb) register read --set 0 --set 2 We need to get shorter register set names soon so we can specify the register sets by name without having to type too much. I will make this change soon. You can also have any integer encoded registers resolve the address values back to any code or data from the object files using the "--lookup" option. Below is sample output when stopped in the libc function "puts" with some const strings in registers: Process 8973 stopped * thread #1: tid = 0x2c03, 0x00007fff828fa30f libSystem.B.dylib`puts + 1, stop reason = instruction step into frame #0: 0x00007fff828fa30f libSystem.B.dylib`puts + 1 (lldb) register read --lookup General Purpose Registers: rax = 0x0000000100000e98 "----------------------------------------------------------------------" rbx = 0x0000000000000000 rcx = 0x0000000000000001 rdx = 0x0000000000000000 rdi = 0x0000000100000e98 "----------------------------------------------------------------------" rsi = 0x0000000100800000 rbp = 0x00007fff5fbff710 rsp = 0x00007fff5fbff280 r8 = 0x0000000000000040 r9 = 0x0000000000000000 r10 = 0x0000000000000000 r11 = 0x0000000000000246 r12 = 0x0000000000000000 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x0000000000000000 rip = 0x00007fff828fa30f libSystem.B.dylib`puts + 1 rflags = 0x0000000000000246 cs = 0x0000000000000027 fs = 0x0000000000000000 gs = 0x0000000000000000 As we can see, we see two constant strings and the PC (register "rip") is showing the code it resolves to. I fixed the register "--format" option to work as expected. Added a setting to disable skipping the function prologue when setting breakpoints as a target settings variable: (lldb) settings set target.skip-prologue false Updated the user settings controller boolean value handler funciton to be able to take the default value so it can correctly respond to the eVarSetOperationClear operation. Did some usability work on the OptionValue classes. Fixed the "image lookup" command to correctly respond to the "--verbose" option and display the detailed symbol context information when looking up line table entries and functions by name. This previously was only working for address lookups. llvm-svn: 129977
* Move the demangle-failed indication out a bit so other failing casesJason Molenda2010-12-151-6/+6
| | | | | | | also get marked as having failed (so we don't try to demangle the same symbol multiple times). llvm-svn: 121835
* Fix a crash on some platforms where a dSYM for a system library lists a ↵Jason Molenda2010-12-151-1/+2
| | | | | | | | | | DW_AT_mips_linkage_name for a non-mangled function - we pass the non mangled string down through abi::__cxa_demangle and it crashes. Usually passing non mangled strings to abi::__cxa_demangle works out fine but not always, apparently. llvm-svn: 121834
* Just like functions can have a basename and a mangled/demangled name, variableGreg Clayton2010-11-141-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | can too. So now the lldb_private::Variable class has support for this. Variables now have support for having a basename ("i"), and a mangled name ("_ZN12_GLOBAL__N_11iE"), and a demangled name ("(anonymous namespace)::i"). Nowwhen searching for a variable by name, users might enter the fully qualified name, or just the basename. So new test functions were added to the Variable and Mangled classes as: bool NameMatches (const ConstString &name); bool NameMatches (const RegularExpression &regex); I also modified "ClangExpressionDeclMap::FindVariableInScope" to also search for global variables that are not in the current file scope by first starting with the current module, then moving on to all modules. Fixed an issue in the DWARF parser that could cause a varaible to get parsed more than once. Now, once we have parsed a VariableSP for a DIE, we cache the result even if a variable wasn't made so we don't do any re-parsing. Some DW_TAG_variable DIEs don't have locations, or are missing vital info that stops a debugger from being able to display anything for it, we parse a NULL variable shared pointer for these DIEs so we don't keep trying to reparse it. llvm-svn: 119085
* The Mangled name comparision should prefer the mangled name.Jim Ingham2010-09-151-1/+1
| | | | llvm-svn: 113908
* Fixed a case where Mangled::GetName(...) could return a invalid demangled ↵Greg Clayton2010-09-141-7/+7
| | | | | | name when one could be calculated. llvm-svn: 113900
* Fixed a compiler warning.Greg Clayton2010-09-141-18/+12
| | | | llvm-svn: 113899
* Add the ability for "ThreadPlanRunToAddress" to run to multiple addresses.Jim Ingham2010-09-141-6/+22
| | | | | | | | Added the ability to specify a preference for mangled or demangled to Mangled::GetName. Changed one place where mangled was prefered in GetName. The Dynamic loader should look up the target of a stub by mangled name if it exists. llvm-svn: 113869
* Improved name demangling performance by 20% on darwin.Greg Clayton2010-09-031-8/+39
| | | | llvm-svn: 113032
* Removed the thread specific data that was being used for demangling sinceGreg Clayton2010-07-021-55/+4
| | | | | | | | removing it didn't cause any performance loss, and leaks were showing up when run under instruments when we tried to re-use the buffer. We are now leak free and still just as performant. llvm-svn: 107453
* Turns out __cxa_demangle returns the size of the buffer instead of the size ofBenjamin Kramer2010-06-221-5/+2
| | | | | | the demangled name. Fall back to strlen. llvm-svn: 106579
* Ensure GetDemangledName's thread safety by making the demangle buffer thread ↵Benjamin Kramer2010-06-221-12/+54
| | | | | | | | | | | | | | | specific. I'm not sure when multiple threads enter this method but a race-condition causing a crash in malloc can be reproduced with this little script: echo file $(which lldb) > cmd echo "run\nbreak set -n main\nrun\nexit" >> cmd lldb -s cmd It may need a few runs before it crashes though. llvm-svn: 106544
* Add missing includes.Eli Friedman2010-06-091-0/+2
| | | | llvm-svn: 105712
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+733
llvm-svn: 105619
OpenPOWER on IntegriCloud