Commit Graph

29 Commits

Author SHA1 Message Date
Eugene Zelenko bbd16815b0 Fix Clang-tidy modernize-use-nullptr warnings in source/Plugins/Language; other minor fixes.
llvm-svn: 262246
2016-02-29 19:41:30 +00:00
Enrico Granata fdecea7f59 Remove an unnecessary include
llvm-svn: 260761
2016-02-12 23:12:27 +00:00
Enrico Granata 75995b5e86 Data formatter support for libc++ std::atomic<T>
On libc++ std::atomic is a fairly simple data type (layout wise, at least), wrapping actual contents in a member variable named "__a_"

All the formatters are doing is "peel away" this intermediate layer and exposing user data as direct children or values of the std::atomic root variable

Fixes rdar://24329405

llvm-svn: 260752
2016-02-12 22:18:24 +00:00
Eugene Zelenko c33088f41e Remove autoconf support from source directories.
Differential revision: http://reviews.llvm.org/D16662

llvm-svn: 259098
2016-01-28 22:05:24 +00:00
Siva Chandra 9293fc4185 Better scheme to lookup alternate mangled name when looking up function address.
Summary:
This change is relevant for inferiors compiled with GCC. GCC does not
emit complete debug info for std::basic_string<...>, and consequently, Clang
(the LLDB compiler) does not generate correct mangled names for certain
functions.

This change removes the hard-coded alternate names in
ItaniumABILanguageRuntime.cpp.

Before the hard-coded names were put in ItaniumABILanguageRuntime.cpp, one could
not evaluate std::string methods (ex. std::string::length). After putting in
the hard-coded names, one could evaluate them. However, it did not still
enable one to call methods on, say for example, std::vector<string>.
This change makes that possible.

There is some amount of incompleteness in this change. Consider the
following example:

std::string hello("hello"), world("world");
std::map<std::string, std::string> m;
m[hello] = world;

One can still not evaluate the expression "m[hello]" in LLDB. Will
address this issue in another pass.

Reviewers: jingham, vharron, evgeny777, spyffe, dawn

Subscribers: clayborg, dawn, lldb-commits

Differential Revision: http://reviews.llvm.org/D12809

llvm-svn: 257113
2016-01-07 23:32:34 +00:00
Enrico Granata 4c2bf56850 Reduce memory traffic in ConstString in the std::map formatter
llvm-svn: 254787
2015-12-04 22:49:27 +00:00
Enrico Granata a0b75d7eb4 Do the same iterator caching optimization for std::map
This brings the timings down for 1500 elements from 166 to 2 seconds on my machine - if I can math correctly, that is a 98% improvement

llvm-svn: 254781
2015-12-04 22:25:52 +00:00
Enrico Granata 26935d9a09 Cache the incremental iterators as you traverse the list, so that you don't have to keep recomputing them
If memory turns out to be a problem, which I don't think it will in practice because all these ValueObjects, we'd be keeping alive anyway, I can always resort to caching the farthest-most iterator only

This gains us an order of magnitude in my benchmark, cutting the time to traverse a 1500-elements list from 22 seconds down to 2

llvm-svn: 254762
2015-12-04 20:12:46 +00:00
Enrico Granata 367e2fe123 Improve the std::list data formatter to not need to calculate indices for every loop iteration
This saves about 5 seconds on a 1500 elements list from my local estimates

llvm-svn: 254757
2015-12-04 19:48:08 +00:00
Enrico Granata b766292951 Fix an issue where LLDB would truncate summaries for string types without producing any evidence thereof
llvm-svn: 252018
2015-11-04 00:02:08 +00:00
Enrico Granata e5839f3eae Remove two #if0ed regions of code that we were using for an experiment but don't really want
llvm-svn: 251670
2015-10-29 23:53:34 +00:00
Tamas Berghammer 458d3d6a5e Fix MSVC build after r251402
llvm-svn: 251403
2015-10-27 10:56:35 +00:00
Tamas Berghammer 9fa1147052 Some minor improvements on the symtab parsing code
* Remove an unneccessary re-computaion on arch spec from the ELF file
* Use a local cache to optimize name based section lookups in symtab
  parsing
* Optimize C++ method basename validation with replacing a regex with
  hand written code

These modifications reduce the time required to parse the symtab from
large applications by ~25% (tested with LLDB as inferior)

Differential revision: http://reviews.llvm.org/D14088

llvm-svn: 251402
2015-10-27 10:43:27 +00:00
Todd Fiala 82ffb8e904 Fix libstdc++ data formatters on Ubuntu 15.10 x86_64
See http://reviews.llvm.org/D13964 for details.

llvm-svn: 250965
2015-10-22 00:23:38 +00:00
Pavel Labath 65a16e56b9 [DataFormatters] Make libc++ list loop detection linear
Summary:
Loop detection code is being called before every element access. Although it tries to cache some
of the data by remembering the loop-free initial segment, every time it needs to increase this
segment, it will start from scratch. For the typical usage pattern, where one accesses the
elements in order, the loop detection will need to be run after every access, resulting in
quadratic behavior. This behavior is noticable even for the default 255 element limit.

In this commit, I rewrite the algorithm to be truly incremental -- it maintains the state of its
loop-detection runners between calls, and reuses them when it needs to check another segment.
This way, each part of the list is scanned only once, resulting in linear behavior.

Also note that I have changed the operator== of ListEntry to do the comparison based on the
value() function (instead of relying on ValueObjectSP equality). In my experiments, I kept
getting different ValueObjectSPs when going through the same element twice.

Reviewers: granata.enrico

Subscribers: lldb-commits, sivachandra

Differential Revision: http://reviews.llvm.org/D13902

llvm-svn: 250890
2015-10-21 10:17:21 +00:00
Eugene Zelenko 8d15f33b45 Fix Clang-tidy modernize-use-override warnings in source/Plugins/Language; other minor fixes.
Differential Revision: http://reviews.llvm.org/D13876

llvm-svn: 250789
2015-10-20 01:10:59 +00:00
Enrico Granata d54f7fb8eb Enable the StringPrinter to have prefixes that are strings instead of just a single character; and also introduce a comparable suffix mechanism
llvm-svn: 249506
2015-10-07 02:06:48 +00:00
Dawn Perchik 045c829223 Fix evaluation of unicode character arrays (char16_t[] and char32_t[])
Suppose we have the UTF-16 string:
    char16_t[] s = u"hello";
Before this patch, evaluating the string in lldb would get:
    (char16_t [6]) $0 = ([0] = U+0068 u'h', [1] = U+0065 u'e', [2] = U+006c u'l', [3] = U+006c u'l', [4] = U+006f u'o', [5] = U+0000 u'\0')
After applying the patch, we now get:
    (char16_t [6]) $0 = u"hello"

Patch from evgeny.leviant@gmail.com
Reviewed by: granata.enrico
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13053

llvm-svn: 248555
2015-09-25 02:16:52 +00:00
Bruce Mitchener 3ad353f3f4 Rename clang_type -> compiler_type for variables.
Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13102

llvm-svn: 248461
2015-09-24 03:54:50 +00:00
Enrico Granata 7cb59e1a0f Move hardcoded formatters from the FormatManager to the Language plugins
llvm-svn: 247831
2015-09-16 18:28:11 +00:00
Enrico Granata ac49453b58 Introduce the notion of an escape helper. Different languages have different notion of what to print in a string and how to escape non-printable things. The escape helper is where this notion is provided to LLDB
This is NFC, other than a code re-org

llvm-svn: 247200
2015-09-09 22:30:24 +00:00
Enrico Granata ad650a189c Preparatory work for letting language plugins help the StringPrinter with formatting special characters
llvm-svn: 247189
2015-09-09 20:59:49 +00:00
Keno Fischer 311435dbb6 Fix Makefile build
llvm-svn: 246932
2015-09-05 20:01:56 +00:00
Enrico Granata c6bbb8b69a Never mind, I see what the problem is on the Windows build. Attempt a fix
llvm-svn: 246876
2015-09-04 21:22:54 +00:00
Enrico Granata 33e97e63a5 Move the C++ data formatters to the C++ language plugin
llvm-svn: 246873
2015-09-04 21:01:18 +00:00
Bruce Mitchener db25a7a245 [cmake] Remove LLVM_NO_RTTI.
Summary:
This doesn't exist in other LLVM projects any longer and doesn't
do anything.

Reviewers: chaoren, labath

Subscribers: emaste, tberghammer, lldb-commits, danalbert

Differential Revision: http://reviews.llvm.org/D12586

llvm-svn: 246749
2015-09-03 08:46:55 +00:00
Jim Ingham aa816b8f3b Move more functionality from the LanguageRuntimes to the Languages.
llvm-svn: 246616
2015-09-02 01:59:14 +00:00
Enrico Granata 578c8a7841 Use Language::LanguageIsCPlusPlus instead of doing the same switch over language
llvm-svn: 246613
2015-09-02 01:28:24 +00:00
Enrico Granata 5f9d310640 Add a new type of plugin: Language plugin
The Language plugin is menat to answer language-specific questions that are not bound to the existence of a process. Those are still the domain of the LanguageRuntime plugin

The Language plugin will, instead, answer questions such as providing language-specific data formatters or expression evaluation

At the moment, the interface is hollowed out, and empty do-nothing plugins have been setup for ObjC, C++ and ObjC++

llvm-svn: 246212
2015-08-27 21:33:50 +00:00